about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog6
-rw-r--r--Src/parse.c2
-rw-r--r--Test/C02cond.ztst2
3 files changed, 8 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 4690121fc..b7ba668f4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2021-08-10  Peter Stephenson  <p.stephenson@samsung.com>
+
+	* 49269: Src/parse.c, Test/C02cond.ztst: "[ ! -o ]" should
+	detect "-o" as a non-empty string and return status 1.  Update
+	test to reflect this.
+
 2021-07-30  dana  <dana@dana.is>
 
 	* github #77: Stavros Ntentos: Completion/X/Command/_sublimetext:
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();
diff --git a/Test/C02cond.ztst b/Test/C02cond.ztst
index 5b105b2a0..4366b4142 100644
--- a/Test/C02cond.ztst
+++ b/Test/C02cond.ztst
@@ -380,7 +380,7 @@ F:scenario if you encounter it.
 >0
 >0
 >1
->0
+>1
 >0
 >0
 >1