diff options
| author | Marc Jeanmougin <marc@jeanmougin.fr> | 2017-10-07 16:23:02 +0000 |
|---|---|---|
| committer | Marc Jeanmougin <marc@jeanmougin.fr> | 2017-10-07 16:23:02 +0000 |
| commit | 8ef6761023610724a1e78e8c82cef80fd92827df (patch) | |
| tree | c96e0e7329cca62e5529ea6899d3f5f2a9ee8e53 /src/uri.cpp | |
| parent | Fix a few draw-geometry-* icons (diff) | |
| parent | Refactoring: avoid duplicate code. (diff) | |
| download | inkscape-8ef6761023610724a1e78e8c82cef80fd92827df.tar.gz inkscape-8ef6761023610724a1e78e8c82cef80fd92827df.zip | |
Merge branch 'refactoring' of gitlab.com:shlomif/inkscape
Diffstat (limited to 'src/uri.cpp')
| -rw-r--r-- | src/uri.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/uri.cpp b/src/uri.cpp index 9178c8ae8..219792b6e 100644 --- a/src/uri.cpp +++ b/src/uri.cpp @@ -159,7 +159,7 @@ const std::string URI::getFullPath(std::string const &base) const { path = Glib::build_filename(base, path); } // Check the existance of the file - if(! g_file_test(path.c_str(), G_FILE_TEST_EXISTS) + if(! g_file_test(path.c_str(), G_FILE_TEST_EXISTS) || g_file_test(path.c_str(), G_FILE_TEST_IS_DIR) ) { path.clear(); } @@ -207,13 +207,11 @@ URI URI::fromUtf8( gchar const* path ) { tmp += (gunichar)one; } else { gchar scratch[4]; - g_snprintf( scratch, 4, "%c%02X", '%', one ); + g_snprintf( scratch, 4, "%%%02X", one ); tmp.append( scratch ); } } - const gchar *uri = tmp.data(); - URI result(uri); - return result; + return URI( tmp.data() ); } /* TODO !!! proper error handling */ |
