This is the mail archive of the binutils-cvs@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[binutils-gdb/binutils-2_29-branch] Correct previous fix to ar, so that it now only comaplains about a lack of input files if not runnin


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=274cdf7e10956056f4c86449ebafcf4005b8cec5

commit 274cdf7e10956056f4c86449ebafcf4005b8cec5
Author: Nick Clifton <nickc@redhat.com>
Date:   Mon Jul 17 10:53:53 2017 +0100

    Correct previous fix to ar, so that it now only comaplains about a lack of input files if not running in MRI mode.
    
    	PR 21433
    	* ar.c (main): Skip check for no files on the command line when
    	running in MRI mode.

Diff:
---
 binutils/ChangeLog | 6 ++++++
 binutils/ar.c      | 9 ++++++---
 2 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/binutils/ChangeLog b/binutils/ChangeLog
index 206e4b7..c442fde 100644
--- a/binutils/ChangeLog
+++ b/binutils/ChangeLog
@@ -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.
diff --git a/binutils/ar.c b/binutils/ar.c
index ef8b5bd..25f3b3d 100644
--- a/binutils/ar.c
+++ b/binutils/ar.c
@@ -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.  */


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]