summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMaxime Coste <frrrwww@gmail.com>2012-02-27 14:25:07 +0000
committerMaxime Coste <frrrwww@gmail.com>2012-02-27 14:25:07 +0000
commit13d74414e1bf7190989e979ce5bdf4244385e09c (patch)
tree0f6b61280aef199561599b692df9bbb847ac7c37 /src
parentb6b66aecc961ad1ec8f1268b8b236702bd5b926b (diff)
fix exec_commands_in_file parsing of [\'"`] strings
Diffstat (limited to 'src')
-rw-r--r--src/main.cc7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/main.cc b/src/main.cc
index 49a1ad28..25195303 100644
--- a/src/main.cc
+++ b/src/main.cc
@@ -468,8 +468,8 @@ void exec_commands_in_file(const CommandParameters& params,
{
char delimiter = file_content[end_pos];
++end_pos;
- while (file_content[end_pos] != delimiter or
- file_content[end_pos-1] == '\\' and end_pos != length)
+ while ((file_content[end_pos] != delimiter or
+ file_content[end_pos-1] == '\\') and end_pos != length)
++end_pos;
if (end_pos == length)
@@ -481,7 +481,8 @@ void exec_commands_in_file(const CommandParameters& params,
++end_pos;
}
- ++end_pos;
+ if (end_pos != length)
+ ++end_pos;
}
if (end_pos != pos and end_pos != length and
file_content[end_pos - 1] == '\\')