From fbafc5b509e311efee064bbd12396a2e207f3393 Mon Sep 17 00:00:00 2001 From: Oliver Kiddle Date: Fri, 16 Sep 2016 00:00:28 +0200 Subject: 39332: support ksh's [[ -v varname ]] condition for checking if variables are set --- Src/parse.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Src/parse.c') diff --git a/Src/parse.c b/Src/parse.c index d3c418184..24b8cd97f 100644 --- a/Src/parse.c +++ b/Src/parse.c @@ -2385,7 +2385,7 @@ par_cond_2(void) s1 = tokstr; dble = (s1 && *s1 == '-' && (!n_testargs - || strspn(s1+1, "abcdefghknoprstuwxzLONGS") == 1) + || strspn(s1+1, "abcdefghknoprstuvwxzLONGS") == 1) && !s1[2]); if (tok != STRING) { /* Check first argument for [[ STRING ]] re-interpretation */ @@ -2464,7 +2464,7 @@ par_cond_double(char *a, char *b) { if (a[0] != '-' || !a[1]) COND_ERROR("parse error: condition expected: %s", a); - else if (!a[2] && strspn(a+1, "abcdefgknoprstuwxzhLONGS") == 1) { + else if (!a[2] && strspn(a+1, "abcdefgknoprstuvwxzhLONGS") == 1) { ecadd(WCB_COND(a[1], 0)); ecstr(b); } else { -- cgit 1.4.1