From daa208e90763d304dc1d554a834d0066e0b9937c Mon Sep 17 00:00:00 2001
From: Peter Stephenson
Date: Tue, 10 Aug 2021 09:19:32 +0100
Subject: 49269: Fix "[ ! -o ]".
This should detect "-o" as non-empty string; "-a" was alrady working.
Update the test.
---
Src/parse.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'Src/parse.c')
diff --git a/Src/parse.c b/Src/parse.c
index b09c7989a..be26112a5 100644
--- a/Src/parse.c
+++ b/Src/parse.c
@@ -2509,7 +2509,7 @@ par_cond_2(void)
* In "test" compatibility mode, "! -a ..." and "! -o ..."
* are treated as "[string] [and] ..." and "[string] [or] ...".
*/
- if (!(n_testargs > 1 && (check_cond(*testargs, "a") ||
+ if (!(n_testargs > 2 && (check_cond(*testargs, "a") ||
check_cond(*testargs, "o"))))
{
condlex();
--
cgit v1.2.3