summaryrefslogtreecommitdiffstats
path: root/src/object/uri.cpp
diff options
context:
space:
mode:
authorThomas Holder <thomas@thomas-holder.de>2018-11-05 19:41:55 +0000
committerThomas Holder <thomas@thomas-holder.de>2018-11-05 22:35:47 +0000
commit5b8cb9394c8e01763d300dbb57a7ded19edf96b1 (patch)
tree99116cb59d1102c80e48022251d50718523a485f /src/object/uri.cpp
parentContextMenu: Harmonize with menu bar (diff)
downloadinkscape-5b8cb9394c8e01763d300dbb57a7ded19edf96b1.tar.gz
inkscape-5b8cb9394c8e01763d300dbb57a7ded19edf96b1.zip
fix URI::from_dirname("/")
Diffstat (limited to 'src/object/uri.cpp')
-rw-r--r--src/object/uri.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/object/uri.cpp b/src/object/uri.cpp
index ce0953501..7c5ab657e 100644
--- a/src/object/uri.cpp
+++ b/src/object/uri.cpp
@@ -290,7 +290,12 @@ URI URI::from_dirname(gchar const *path)
pathstr = Glib::build_filename(Glib::get_current_dir(), pathstr);
}
- auto uristr = Glib::filename_to_uri(pathstr) + "/";
+ auto uristr = Glib::filename_to_uri(pathstr);
+
+ if (uristr[uristr.size() - 1] != '/') {
+ uristr.push_back('/');
+ }
+
return URI(uristr.c_str());
}