diff options
author | Thomas Adam <thomas@xteddy.org> | 2019-05-31 15:02:27 +0100 |
---|---|---|
committer | Thomas Adam <thomas@xteddy.org> | 2019-05-31 15:02:27 +0100 |
commit | adf9e77702cf4c7638cd09816d57529f0f4adfd4 (patch) | |
tree | 27272113e5ca59183b506027add8e8be6a6bfc2a /cmd-parse.y | |
parent | 41b8bb4eef44260729d8cfd649be4e3a8ed74015 (diff) | |
parent | 82e47403c6a8d6fff90f77e9262840050b8e6b2e (diff) | |
download | rtmux-adf9e77702cf4c7638cd09816d57529f0f4adfd4.tar.gz rtmux-adf9e77702cf4c7638cd09816d57529f0f4adfd4.tar.bz2 rtmux-adf9e77702cf4c7638cd09816d57529f0f4adfd4.zip |
Merge branch 'obsd-master'
Diffstat (limited to 'cmd-parse.y')
-rw-r--r-- | cmd-parse.y | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/cmd-parse.y b/cmd-parse.y index d5d12d95..0a627268 100644 --- a/cmd-parse.y +++ b/cmd-parse.y @@ -998,11 +998,15 @@ yylex(void) if (ch == '%') { /* - * % is a condition unless it is alone, then it is a - * token. + * % is a condition unless it is all % or all numbers, + * then it is a token. */ yylval.token = yylex_get_word('%'); - if (strcmp(yylval.token, "%") == 0) + for (cp = yylval.token; *cp != '\0'; cp++) { + if (*cp != '%' && !isdigit((u_char)*cp)) + break; + } + if (*cp == '\0') return (TOKEN); if (strcmp(yylval.token, "%if") == 0) { free(yylval.token); |