bug#79095: [PATCH] test: removed dead code for unrecognised binary operators

Collin Funk <[email protected]>
Newsgroups gmane.comp.gnu.core-utils.bugs
Message-ID <[email protected]>
Hi Paul,

Paul Eggert <[email protected]> writes:

> +    case NT_BINOP: case OT_BINOP:
> +      {
> +        if (l_is_l | r_is_l)
> +          test_syntax_error (_("%s does not accept -l"), argv[op]);

This causes 'make syntax-check' to fail with the following:

     error_quotes
     test.c:332:          test_syntax_error (_("%s does not accept -l"), argv[op]);
     maint.mk: Use quote() for error string arguments
     make: *** [cfg.mk:204: sc_error_quotes] Error 1

Using quote would be incorrect here, since we still have the following
message without quotes:

    test_syntax_error (_("-ef does not accept -l"));

I pushed the attached patch to fix it. We can just place the argument on
another line.

Collin
0001-maint-avoid-syntax-check-failure-from-previous-commi.patch (text/x-patch, 1.1 KB)
From ba8e55ea95c6e13ec1ab05ef3c9060c55f5c7043 Mon Sep 17 00:00:00 2001
Message-ID: <ba8e55ea95c6e13ec1ab05ef3c9060c55f5c7043.1753514479.git.collin.funk1@gmail.com>
From: Collin Funk <[email protected]>
Date: Sat, 26 Jul 2025 00:17:16 -0700
Subject: [PATCH] maint: avoid syntax-check failure from previous commit

* src/test.c (binary_operator): Place string argument on a separate line
to avoid sc_error_quotes syntax-check failure.
---
 src/test.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/test.c b/src/test.c
index cb57324bb..fd9aa0d29 100644
--- a/src/test.c
+++ b/src/test.c
@@ -329,7 +329,8 @@ binary_operator (bool l_is_l, enum binop bop)
     case NT_BINOP: case OT_BINOP:
       {
         if (l_is_l | r_is_l)
-          test_syntax_error (_("%s does not accept -l"), argv[op]);
+          test_syntax_error (_("%s does not accept -l"),
+                             argv[op]);
         int cmp = timespec_cmp (get_mtime (argv[op - 1]),
                                 get_mtime (argv[op + 1]));
         return bop == OT_BINOP ? cmp < 0 : cmp > 0;
-- 
2.50.1
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.