From 51f7c9361de62d7106eafc6cb0c33cc6701de9e2 Mon Sep 17 00:00:00 2001 From: Christos Zoulas Date: Thu, 1 Aug 2019 10:28:50 -0400 Subject: [PATCH 50/58] PR/88: sharifib: Preserve empty arguments in arrays as quoted NUL's --- sh.lex.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sh.lex.c b/sh.lex.c index b879a1d..2893768 100644 --- a/sh.lex.c +++ b/sh.lex.c @@ -1020,8 +1020,10 @@ domod(Char *cp, Char type) switch (type) { - case 'x': case 'q': + case 'x': + if (*cp == '\0') + return Strsave(STRQNULL); wp = Strsave(cp); for (xp = wp; (c = *xp) != 0; xp++) if ((c != ' ' && c != '\t') || type == 'q') -- 1.8.3.1