From 3441298ed44e1a00f2c71b73a582755d7bda7cd5 Mon Sep 17 00:00:00 2001 From: Nicolas Dufour Date: Fri, 15 Feb 2013 14:12:46 +0100 Subject: Better fix for Bug #911146 (Inkscape reads .eps files from /tmp instead of the current directory) by Michael Karcher. (bzr r12127) --- src/extension/system.cpp | 34 ---------------------------------- 1 file changed, 34 deletions(-) (limited to 'src/extension/system.cpp') diff --git a/src/extension/system.cpp b/src/extension/system.cpp index 60cd21d71..a9ca5c456 100644 --- a/src/extension/system.cpp +++ b/src/extension/system.cpp @@ -69,34 +69,6 @@ static Extension *build_from_reprdoc(Inkscape::XML::Document *doc, Implementatio */ SPDocument *open(Extension *key, gchar const *filename) { - // Convert to absolute pathname to tolerate chdir(). - bool relpath = (filename[0] != '/'); -#ifdef WIN32 - 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 - curdir = getcwd(NULL, 0); -#else - curdir = _getcwd(NULL, 0); -#endif - - filename = g_build_filename(curdir, filename, NULL); - free(curdir); - } - Input *imod = NULL; if (key == NULL) { @@ -138,9 +110,6 @@ SPDocument *open(Extension *key, gchar const *filename) } if (!imod->prefs(filename)) { - if (relpath){ - free((void *) filename); - } return NULL; } @@ -163,9 +132,6 @@ SPDocument *open(Extension *key, gchar const *filename) imod->set_gui(true); } - if (relpath){ - free((void *) filename); - } return doc; } -- cgit v1.2.3