X-Git-Url: https://git.tokkee.org/?p=inkscape.git;a=blobdiff_plain;f=src%2Fextension%2Fimplementation%2Fscript.cpp;fp=src%2Fextension%2Fimplementation%2Fscript.cpp;h=0f234c7d44f60d6c5d3dbe440ca77cd3a1c66154;hp=428ee626fd361f79342dc7624d67f192e62da165;hb=8a5d51c6de77a7dc98b33580378b12a65c360ed2;hpb=813b66bcd40ec0e340de03703a7b8dd397cd1edf diff --git a/src/extension/implementation/script.cpp b/src/extension/implementation/script.cpp index 428ee626f..0f234c7d4 100644 --- a/src/extension/implementation/script.cpp +++ b/src/extension/implementation/script.cpp @@ -45,7 +45,7 @@ #include "xml/attribute-record.h" #include "util/glib-list-iterators.h" - +#include "path-prefix.h" #ifdef WIN32 @@ -229,7 +229,6 @@ Script::solve_reldir(Inkscape::XML::Node *reprin) { */ bool Script::check_existence(const std::string &command) { - // Check the simple case first if (command.empty()) { return false; @@ -243,13 +242,14 @@ bool Script::check_existence(const std::string &command) return false; } } - - std::string path = Glib::getenv("PATH"); - if (path.empty()) { - /* There is no `PATH' in the environment. - The default search path is the current directory */ - path = G_SEARCHPATH_SEPARATOR_S; - } + + // First search in the extension path and the current directory + std::string path = INKSCAPE_EXTENSIONDIR; + path.append(";"); + path.append(G_SEARCHPATH_SEPARATOR_S); + path.append(";"); + // And then the PATH environment variable. + path.append(Glib::getenv("PATH")); std::string::size_type pos = 0; std::string::size_type pos2 = 0;