summaryrefslogtreecommitdiffstats
path: root/src/extension/implementation/script.cpp
diff options
context:
space:
mode:
authorAdib Taraben <theadib@gmail.com>2008-03-28 00:01:10 +0000
committertheadib <theadib@users.sourceforge.net>2008-03-28 00:01:10 +0000
commit003a320921a2b1440c6b6c8b5ea10f383ead3fdc (patch)
tree0c20c06b4c1c1f359877f5ff11dee4696e5e67e6 /src/extension/implementation/script.cpp
parentadd linking to other paths to lpe-PathParam (diff)
downloadinkscape-003a320921a2b1440c6b6c8b5ea10f383ead3fdc.tar.gz
inkscape-003a320921a2b1440c6b6c8b5ea10f383ead3fdc.zip
handle (better) whitespaces in path names
(bzr r5210)
Diffstat (limited to 'src/extension/implementation/script.cpp')
-rw-r--r--src/extension/implementation/script.cpp17
1 files changed, 13 insertions, 4 deletions
diff --git a/src/extension/implementation/script.cpp b/src/extension/implementation/script.cpp
index 69f8cec53..b395f6f1d 100644
--- a/src/extension/implementation/script.cpp
+++ b/src/extension/implementation/script.cpp
@@ -376,8 +376,11 @@ Script::load(Inkscape::Extension::Extension *module)
resolveInterpreterExecutable(interpretstr);
command.insert(command.end(), interpretstr);
}
+ Glib::ustring tmp = "\"";
+ tmp += solve_reldir(child_repr);
+ tmp += "\"";
- command.insert(command.end(), solve_reldir(child_repr));
+ command.insert(command.end(), tmp);
}
if (!strcmp(child_repr->name(), "helper_extension")) {
helper_extension = sp_repr_children(child_repr)->content();
@@ -986,19 +989,25 @@ Script::execute (const std::list<std::string> &in_command,
//std::cout << "first quote " << first_quote << std::endl;
if((first_quote != std::string::npos) && (first_quote == 0)) {
- size_t next_quote = param_str.find_first_of('"', first_quote);
+ size_t next_quote = param_str.find_first_of('"', first_quote + 1);
//std::cout << "next quote " << next_quote << std::endl;
if(next_quote != std::string::npos) {
//std::cout << "now split " << next_quote << std::endl;
- //std::cout << "now split " << param_str.substr(1, next_quote) << std::endl;
+ //std::cout << "now split " << param_str.substr(1, next_quote - 1) << std::endl;
//std::cout << "now split " << param_str.substr(next_quote + 1) << std::endl;
- std::string part_str = param_str.substr(1, next_quote);
+ std::string part_str = param_str.substr(1, next_quote - 1);
if(part_str.size() > 0)
argv.push_back(part_str);
param_str = param_str.substr(next_quote + 1);
}
+ else {
+ if(param_str.size() > 0)
+ argv.push_back(param_str);
+ param_str = "";
+ }
+
}
else if(first_space != std::string::npos) {
//std::cout << "now split " << first_space << std::endl;