summaryrefslogtreecommitdiff
path: root/library
diff options
context:
space:
mode:
Diffstat (limited to 'library')
-rw-r--r--library/Core.cpp28
m---------library/xml0
2 files changed, 27 insertions, 1 deletions
diff --git a/library/Core.cpp b/library/Core.cpp
index 735359a7..8a8d39e0 100644
--- a/library/Core.cpp
+++ b/library/Core.cpp
@@ -126,8 +126,34 @@ struct Core::Private
void Core::cheap_tokenise(string const& input, vector<string> &output)
{
string *cur = NULL;
+ size_t i = 0;
- for (size_t i = 0; i < input.size(); i++) {
+ // Check the first non-space character
+ while (i < input.size() && isspace(input[i])) i++;
+
+ // Special verbatim argument mode?
+ if (i < input.size() && input[i] == ':')
+ {
+ // Read the command
+ std::string cmd;
+ i++;
+ while (i < input.size() && !isspace(input[i]))
+ cmd.push_back(input[i++]);
+ if (!cmd.empty())
+ output.push_back(cmd);
+
+ // Find the argument
+ while (i < input.size() && isspace(input[i])) i++;
+
+ if (i < input.size())
+ output.push_back(input.substr(i));
+
+ return;
+ }
+
+ // Otherwise, parse in the regular quoted mode
+ for (; i < input.size(); i++)
+ {
unsigned char c = input[i];
if (isspace(c)) {
cur = NULL;
diff --git a/library/xml b/library/xml
-Subproject d52c7181fb439a5fead143188d17d659d82e7f8
+Subproject e6a59bfebd56e209a0719c173f93a3326275152