|
Lines 332-338
Link Here
|
| 332 |
{ |
332 |
{ |
| 333 |
const char *cp = *cpp, *end; |
333 |
const char *cp = *cpp, *end; |
| 334 |
char quot; |
334 |
char quot; |
| 335 |
int i; |
335 |
int i, j; |
| 336 |
|
336 |
|
| 337 |
cp += strspn(cp, WHITESPACE); |
337 |
cp += strspn(cp, WHITESPACE); |
| 338 |
if (!*cp) { |
338 |
if (!*cp) { |
|
Lines 345-351
Link Here
|
| 345 |
if (*cp == '\"' || *cp == '\'') { |
345 |
if (*cp == '\"' || *cp == '\'') { |
| 346 |
quot = *cp++; |
346 |
quot = *cp++; |
| 347 |
|
347 |
|
| 348 |
end = strchr(cp, quot); |
348 |
/* Search for terminating quote */ |
|
|
349 |
end = cp; |
| 350 |
for (j = 0; j <= strlen(end); j++) { |
| 351 |
if (end[j] == quot) { /* Found quote */ |
| 352 |
end += j; |
| 353 |
break; |
| 354 |
} |
| 355 |
if (end[j] == '\0') { /* End of string */ |
| 356 |
end = NULL; |
| 357 |
break; |
| 358 |
} |
| 359 |
if (end[j] == '\\') /* Skip escaped character */ |
| 360 |
j++; |
| 361 |
} |
| 362 |
|
| 349 |
if (end == NULL) { |
363 |
if (end == NULL) { |
| 350 |
error("Unterminated quote"); |
364 |
error("Unterminated quote"); |
| 351 |
goto fail; |
365 |
goto fail; |