Skip to content

Commit

Permalink
[Fix/hphpd] Only escape the cases needed
Browse files Browse the repository at this point in the history
Summary:
This diff makes it hphpd command line tokenizer only escape the cases
that are needed so that it doesn't do any inappropriate escaping.

Test Plan:
make fast_tests
the case in the task

Reviewers: mwilliams

Reviewed By: mwilliams

CC: ps, mwilliams, qigao

Differential Revision: 351968

Task ID: 778864
  • Loading branch information
qigao authored and macvicar committed Nov 29, 2011
1 parent ae79ab7 commit a132a6f
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/runtime/eval/debugger/debugger_client.cpp
Expand Up @@ -1404,7 +1404,7 @@ void DebuggerClient::parseCommand(const char *line) {
break;
case '"':
case '\'':
if (token.empty() && quote == 0) {
if (quote == 0) {
quote = ch;
token += ch;
break;
Expand All @@ -1418,11 +1418,15 @@ void DebuggerClient::parseCommand(const char *line) {
token += ch;
break;
case '\\':
if (p[1]) {
if ((p[1] == ' ' || p[1] == '"' || p[1] == '\'' || p[1] == '\\')) {
if (quote == '\'') {
token += ch;
}
p++;
token += *p;
break;
}
break;
// fall through
default:
token += ch;
break;
Expand Down

0 comments on commit a132a6f

Please sign in to comment.