Hi all,

I noticed this small issue in base64 (seems the code is from
the original commit in 2006 when switching to git).

WDYT?
-assaf

>From d4a42d2bee33b5de5bcca995538cdd4e481af26f Mon Sep 17 00:00:00 2001
From: Assaf Gordon <[email protected]>
Date: Wed, 19 Dec 2018 01:02:32 -0700
Subject: [PATCH] base64: fix 'extra operand' error message

In the following invocation, 'a' is the input file, and 'b' is the extra
operand:

  $ base64 a b

Report 'b' in the error message instead of 'a':

  $ base64 a b
  base64: extra operand 'b'

* src/base64.c (main): If there is more than one non-option operand,
report the second one (assuming the first is a the input file name).
---
 src/base64.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/base64.c b/src/base64.c
index 1f5c09aae..3ee5b3388 100644
--- a/src/base64.c
+++ b/src/base64.c
@@ -310,7 +310,7 @@ main (int argc, char **argv)
 
   if (argc - optind > 1)
     {
-      error (0, 0, _("extra operand %s"), quote (argv[optind]));
+      error (0, 0, _("extra operand %s"), quote (argv[optind+1]));
       usage (EXIT_FAILURE);
     }
 
-- 
2.11.0

Reply via email to