Hello,

This is my first patch contribution to GNU coreutils. It removes dead code
related to unrecognized binary operators in test.c. The fallback error was
unreachable because invalid binary operators are filtered earlier in the
logic.

I’ve attached the patch file to this email.

Please let me know if you need any further information or changes.

Thank you for your time and for maintaining this project!

Best regards,
Harry Fellowes
From 96beb7e79346a17b14487d6d6667ce9958771698 Mon Sep 17 00:00:00 2001
From: Harry Fellowes <harryfellow...@gmail.com>
Date: Fri, 25 Jul 2025 14:26:38 +0100
Subject: [PATCH] test: removed dead code for unrecognised binary operators

the fallback error in binary_operator() was unreachable, since invalid
binary operators are rejected in three_arguments() via binop() which
returns false and prevents entry into binary_operator().

this dead code was unreachable and safe to remove

ref: line 636 where "binary operator expected" is generated.

Signed-off-by: Harry Fellowes <harryfellow...@gmail.com>
---
 src/test.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/src/test.c b/src/test.c
index 3df6adf28..d8be5a70b 100644
--- a/src/test.c
+++ b/src/test.c
@@ -353,8 +353,7 @@ binary_operator (bool l_is_l)
           break;
         }
 
-      /* FIXME: is this dead code? */
-      test_syntax_error (_("%s: unknown binary operator"), quote (argv[op]));
+      /* Dead code removed: unrecognised binary operators are filtered before binary_operator() is called, see line 636*/
     }
 
   if (argv[op][0] == '='
-- 
2.50.1

Reply via email to