summaryrefslogtreecommitdiff
path: root/dviware/dvisvgm/src/FilePath.cpp
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2020-03-16 03:01:06 +0000
committerNorbert Preining <norbert@preining.info>2020-03-16 03:01:06 +0000
commitd50a41b6ab3d05fe5605a3a3b50ff68f61059296 (patch)
tree29468e087e9c19acf30b392dc705a54288d79137 /dviware/dvisvgm/src/FilePath.cpp
parent87cddce361c3b477029d13b27bdaa57190b2d74b (diff)
CTAN sync 202003160301
Diffstat (limited to 'dviware/dvisvgm/src/FilePath.cpp')
-rw-r--r--dviware/dvisvgm/src/FilePath.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/dviware/dvisvgm/src/FilePath.cpp b/dviware/dvisvgm/src/FilePath.cpp
index 6f162bfab9..2150cf31f7 100644
--- a/dviware/dvisvgm/src/FilePath.cpp
+++ b/dviware/dvisvgm/src/FilePath.cpp
@@ -2,7 +2,7 @@
** FilePath.cpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
@@ -191,14 +191,16 @@ string FilePath::suffix () const {
/** Changes the suffix of the filename. If FilePath represents the
- * location of a directory (and not of a file) nothing happens.
- * @param[in] s new suffix */
-void FilePath::suffix (const string &s) {
+ * location of a directory (and not of a file) nothing happens. An
+ * empty new suffix leads to the removal of the current one.
+ * @param[in] newSuffix the new suffix */
+void FilePath::suffix (const string &newSuffix) {
if (!_fname.empty()) {
string current_suffix = suffix();
if (!current_suffix.empty())
_fname.erase(_fname.length()-current_suffix.length()-1);
- _fname += "."+s;
+ if (!newSuffix.empty())
+ _fname += "."+newSuffix;
}
}