Skip to content

Commit

Permalink
Resolve issue with # inside a string
Browse files Browse the repository at this point in the history
  • Loading branch information
philwhineray committed Oct 28, 2015
1 parent ce924fc commit bd75f10
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/engines/bash-engine.cc
Original file line number Diff line number Diff line change
Expand Up @@ -485,6 +485,10 @@ class BashEngine : public ScriptEngineBase
if ((comment >= 1 && s[comment - 1] == '$') ||
(comment >= 2 && s.rfind("${", comment) != std::string::npos && s.find("}", comment) != std::string::npos)) {
// Do nothing
// Nor if in a string
} else if (comment >= 1
&& (s.find("\"") < comment || s.find("'") < comment)) {
// Do nothing
} else {
s = trim_string(s);
s = s.substr(0, comment);
Expand Down

0 comments on commit bd75f10

Please sign in to comment.