Print empty arguments properly.

pull/2172/head
nicm 2020-04-12 20:54:28 +00:00
parent de6b30a51c
commit ad38ef6ff4
1 changed files with 4 additions and 2 deletions

View File

@ -216,8 +216,10 @@ args_escape(const char *s)
char *escaped, *result;
int flags;
if (*s == '\0')
return (xstrdup(s));
if (*s == '\0') {
xasprintf(&result, "''");
return (result);
}
if (s[0] != ' ' &&
(strchr(quoted, s[0]) != NULL || s[0] == '~') &&
s[1] == '\0') {