From 8ec53514453258fbbc55c1420676d59bc7a5afe2 Mon Sep 17 00:00:00 2001 From: Nicolas Dufour Date: Thu, 19 Jul 2012 18:47:52 +0200 Subject: Fix for Bug #1022719 (Inkscape fails to open file from the web (via URL) on the command line) by Patrick Monnerat. (bzr r11556) --- src/extension/system.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/extension/system.cpp') 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 -- cgit v1.2.3