diff options
| author | Nicolas Dufour <nicoduf@yahoo.fr> | 2012-07-19 16:47:52 +0000 |
|---|---|---|
| committer | JazzyNico <nicoduf@yahoo.fr> | 2012-07-19 16:47:52 +0000 |
| commit | 8ec53514453258fbbc55c1420676d59bc7a5afe2 (patch) | |
| tree | 52927b772aa72c6368eedf324a32bc32bb2319b9 /src/extension/system.cpp | |
| parent | Translations. PO template update. (diff) | |
| download | inkscape-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.cpp | 10 |
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 |
