diff options
author | nicm <nicm> | 2020-06-04 07:12:05 +0000 |
---|---|---|
committer | nicm <nicm> | 2020-06-04 07:12:05 +0000 |
commit | b3782d2dc8f872c43fcf53b9436c4e881d3f1e2d (patch) | |
tree | f7c75fcbdc0ce56e6f55cce00480a49a3dd02f84 /arguments.c | |
parent | 3f6af4156f451cfbee867babe74cc6675eb3f947 (diff) | |
download | rtmux-b3782d2dc8f872c43fcf53b9436c4e881d3f1e2d.tar.gz rtmux-b3782d2dc8f872c43fcf53b9436c4e881d3f1e2d.tar.bz2 rtmux-b3782d2dc8f872c43fcf53b9436c4e881d3f1e2d.zip |
Instead of using a custom parse function to process {}, treat it as a
set of statements and parse with yacc, then convert back to a string as
the last step. This means the rules are consistent inside and outside
{}, %if and friends work at the right time, and the final result isn't
littered with unnecessary newlines.
Diffstat (limited to 'arguments.c')
-rw-r--r-- | arguments.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/arguments.c b/arguments.c index ef67107d..0495aa0e 100644 --- a/arguments.c +++ b/arguments.c @@ -227,6 +227,11 @@ args_escape(const char *s) return (escaped); } + if (strchr(s, ' ') != NULL && strchr(s, '\'') == NULL) { + xasprintf(&escaped, "'%s'", s); + return (escaped); + } + flags = VIS_OCTAL|VIS_CSTYLE|VIS_TAB|VIS_NL; if (s[strcspn(s, quoted)] != '\0') flags |= VIS_DQ; |