Commit b4fc678e b4fc678e33736d710996d36499272e333940ed14 by Sergey Poznyakoff

(argcv_scan): Honor escaped whitespace.

1 parent 2cb73f9f
...@@ -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 }
......