summaryrefslogtreecommitdiffstats
path: root/src/extension/implementation/script.cpp
diff options
context:
space:
mode:
authorNicolas Dufour <nicoduf@yahoo.fr>2011-02-02 17:26:59 +0000
committerJazzyNico <nicoduf@yahoo.fr>2011-02-02 17:26:59 +0000
commit0f535660ee7c8ba0a6befb9066a9f97168e034db (patch)
tree28af7c0066062cb09b16344be92a8a63bcd4b0cd /src/extension/implementation/script.cpp
parentExtensions. Compressed+media export improvements (see Bug #386664, Gather Res... (diff)
downloadinkscape-0f535660ee7c8ba0a6befb9066a9f97168e034db.tar.gz
inkscape-0f535660ee7c8ba0a6befb9066a9f97168e034db.zip
Extensions. Check element now search in the extension directory (see Bug #668895, Extensions with <check> tags fail to load).
(bzr r10023)
Diffstat (limited to '')
-rw-r--r--src/extension/implementation/script.cpp18
1 files changed, 9 insertions, 9 deletions
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;