summaryrefslogtreecommitdiffstats
path: root/arguments.c
diff options
context:
space:
mode:
authorThomas Adam <thomas@xteddy.org>2020-04-13 10:30:00 +0100
committerThomas Adam <thomas@xteddy.org>2020-04-13 10:30:00 +0100
commitb117c3b81217a11946ac784cfbe2ef1f3725b207 (patch)
tree196cc4a27cb75def4466d418cb91dd3fcfdfbf5b /arguments.c
parent52e3d960e7ebe2006509d48c427ffd8f25a0cf52 (diff)
parentc20eb0c0ae3347c768894a6355adfd7ebae6f2f3 (diff)
Merge branch 'obsd-master'
Diffstat (limited to 'arguments.c')
-rw-r--r--arguments.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/arguments.c b/arguments.c
index e9af70ac..73d492c0 100644
--- a/arguments.c
+++ b/arguments.c
@@ -215,8 +215,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') {