(argcv_scan): Honor escaped whitespace.
Showing
1 changed file
with
4 additions
and
3 deletions
... | @@ -61,10 +61,11 @@ argcv_scan (int len, const char *command, const char *delim, const char* cmnt, | ... | @@ -61,10 +61,11 @@ argcv_scan (int len, const char *command, const char *delim, const char* cmnt, |
61 | /*FALLTHRU*/ default: | 61 | /*FALLTHRU*/ default: |
62 | if (isdelim (command[i], delim)) | 62 | if (isdelim (command[i], delim)) |
63 | break; | 63 | break; |
64 | /* Skip until next whitespace character or end of line */ | 64 | /* Skip until next whitespace character or end of line. Honor |
65 | escaped whitespace. */ | ||
65 | while (++i < len && | 66 | while (++i < len && |
66 | !(isws (command[i]) || isdelim (command[i], delim))) | 67 | !((isws (command[i]) && command[i-1] != '\\') |
67 | ; | 68 | || isdelim (command[i], delim))); |
68 | i--; | 69 | i--; |
69 | break; | 70 | break; |
70 | } | 71 | } | ... | ... |
-
Please register or sign in to post a comment