]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Correct previous fix to ar, so that it now only comaplains about a lack of input...
authorNick Clifton <nickc@redhat.com>
Mon, 17 Jul 2017 09:53:53 +0000 (10:53 +0100)
committerNick Clifton <nickc@redhat.com>
Mon, 17 Jul 2017 09:53:53 +0000 (10:53 +0100)
PR 21433
* ar.c (main): Skip check for no files on the command line when
running in MRI mode.

binutils/ChangeLog
binutils/ar.c

index 206e4b745401132cd0c8f663e57f5bcf66253797..c442fde6be8a337c38dc5808e09f1982aa48971b 100644 (file)
@@ -1,3 +1,9 @@
+2017-07-17  Nick Clifton  <nickc@redhat.com>
+
+       PR 21433
+       * ar.c (main): Skip check for no files on the command line when
+       running in MRI mode.
+
 2017-07-12  Nick Clifton  <nickc@redhat.com>
 
        Fix compile time warnings using gcc 7.1.1.
index ef8b5bdb12bede18c47f65e2615b9e0ade8f9a56..25f3b3d0bf0318af1279314a2a40c5b840a96bf0 100644 (file)
@@ -738,9 +738,6 @@ main (int argc, char **argv)
 
   arg_index = 0;
 
-  if (argv[arg_index] == NULL)
-    usage (0);
-
   if (mri_mode)
     {
       default_deterministic ();
@@ -750,6 +747,12 @@ main (int argc, char **argv)
     {
       bfd *arch;
 
+      /* Fail if no files are specified on the command line.
+        (But not for MRI mode which allows for reading arguments
+        and filenames from stdin).  */
+      if (argv[arg_index] == NULL)
+       usage (0);
+
       /* We don't use do_quick_append any more.  Too many systems
         expect ar to always rebuild the symbol table even when q is
         used.  */