From 5b8cb9394c8e01763d300dbb57a7ded19edf96b1 Mon Sep 17 00:00:00 2001 From: Thomas Holder Date: Mon, 5 Nov 2018 20:41:55 +0100 Subject: fix URI::from_dirname("/") --- src/object/uri.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/object/uri.cpp') 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()); } -- cgit v1.2.3