Skip to content

Commit

Permalink
Improve parsing of invalid substitutions.
Browse files Browse the repository at this point in the history
Do not skip over invalid characters. Even if we know the substitution is
invalid either way, the invalid character may affect how the rest of the
substitution is parsed.

Test case:

  : || : ${$""}
  • Loading branch information
hvdijk committed Jun 27, 2019
1 parent f9b8fdf commit 7efcad5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/parser.c
Original file line number Diff line number Diff line change
Expand Up @@ -1445,7 +1445,7 @@ readtoken1_parsesub(char *out, int c, char *eofmark, int flags)
default:
p = strchr(types, c);
if (p == NULL)
break;
goto badsub;
subtype |= p - types + VSNORMAL;
break;
case '%':
Expand Down

0 comments on commit 7efcad5

Please sign in to comment.