summaryrefslogtreecommitdiffstats
path: root/src/extension
diff options
context:
space:
mode:
Diffstat (limited to 'src/extension')
-rw-r--r--src/extension/implementation/script.cpp9
-rw-r--r--src/extension/system.cpp34
2 files changed, 8 insertions, 35 deletions
diff --git a/src/extension/implementation/script.cpp b/src/extension/implementation/script.cpp
index d3aeace55..4af778e04 100644
--- a/src/extension/implementation/script.cpp
+++ b/src/extension/implementation/script.cpp
@@ -956,7 +956,14 @@ int Script::execute (const std::list<std::string> &in_command,
// assemble the rest of argv
std::copy(in_params.begin(), in_params.end(), std::back_inserter(argv));
if (!filein.empty()) {
- argv.push_back(filein);
+ if(Glib::path_is_absolute(filein))
+ argv.push_back(filein);
+ else {
+ std::vector<std::string> buildargs;
+ buildargs.push_back(Glib::get_current_dir());
+ buildargs.push_back(filein);
+ argv.push_back(Glib::build_filename(buildargs));
+ }
}
int stdout_pipe, stderr_pipe;
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;
}