summaryrefslogtreecommitdiffstats
path: root/arguments.c
diff options
context:
space:
mode:
authorThomas Adam <thomas@xteddy.org>2020-06-04 10:01:20 +0100
committerThomas Adam <thomas@xteddy.org>2020-06-04 10:01:20 +0100
commitb0a60258979faeb9e35863eb1bb2deab269d168b (patch)
tree3210103bb307cc74d4b945975666f149ca568f69 /arguments.c
parentf837dcdd58706d936308afd2617b7cecbfa1d264 (diff)
parentd3c5202f50c28586a5a4e97b77332b57b798335b (diff)
Merge branch 'obsd-master'
Diffstat (limited to 'arguments.c')
-rw-r--r--arguments.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/arguments.c b/arguments.c
index 9466f8f4..166eb1ba 100644
--- a/arguments.c
+++ b/arguments.c
@@ -226,6 +226,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;