summaryrefslogtreecommitdiffstats
path: root/src/extension/system.cpp
diff options
context:
space:
mode:
authorNicolas Dufour <nicoduf@yahoo.fr>2012-07-19 16:47:52 +0000
committerJazzyNico <nicoduf@yahoo.fr>2012-07-19 16:47:52 +0000
commit8ec53514453258fbbc55c1420676d59bc7a5afe2 (patch)
tree52927b772aa72c6368eedf324a32bc32bb2319b9 /src/extension/system.cpp
parentTranslations. PO template update. (diff)
downloadinkscape-8ec53514453258fbbc55c1420676d59bc7a5afe2.tar.gz
inkscape-8ec53514453258fbbc55c1420676d59bc7a5afe2.zip
Fix for Bug #1022719 (Inkscape fails to open file from the web (via URL) on the command line) by Patrick Monnerat.
(bzr r11556)
Diffstat (limited to 'src/extension/system.cpp')
-rw-r--r--src/extension/system.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/extension/system.cpp b/src/extension/system.cpp
index 476499385..fc20095c5 100644
--- a/src/extension/system.cpp
+++ b/src/extension/system.cpp
@@ -74,6 +74,16 @@ SPDocument *open(Extension *key, gchar const *filename)
relpath &= (filename[0] != '\\') && !(isalpha(filename[0]) && (filename[1] == ':'));
#endif
+ // Do not consider an URI as a relative path.
+ if (relpath) {
+ gchar const * cp = filename;
+
+ while (isalpha(*cp) || isdigit(*cp) || *cp == '+' || *cp == '-' || *cp == '.')
+ cp++;
+
+ relpath = *cp != ':' || cp[1] != '/' || cp[2] != '/';
+ }
+
if (relpath) {
gchar * curdir = NULL;
#ifndef WIN32