mirror of
https://github.com/tmux/tmux.git
synced 2025-09-01 20:57:00 +00:00
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.
This commit is contained in:
@ -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;
|
||||
|
Reference in New Issue
Block a user