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] Move nothing to do warning to main


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

commit 5656ba2c217cff434621d6caf135cbda5ae92ac4
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Tue Mar 10 06:57:14 2015 -0700

    Move nothing to do warning to main
    
    	PR binutils/18101
    	* readelf.c (parse_args): Move nothing to do warning to ...
    	(main): Here.

Diff:
---
 binutils/ChangeLog |  6 ++++++
 binutils/readelf.c | 10 +++++-----
 2 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/binutils/ChangeLog b/binutils/ChangeLog
index 062cec4..f59c0d1 100644
--- a/binutils/ChangeLog
+++ b/binutils/ChangeLog
@@ -1,3 +1,9 @@
+2015-03-10  H.J. Lu  <hongjiu.lu@intel.com>
+
+	PR binutils/18101
+	* readelf.c (parse_args): Move nothing to do warning to ...
+	(main): Here.
+
 2015-03-10  Nick Clifton  <nickc@redhat.com>
 
 	PR binutils/18101
diff --git a/binutils/readelf.c b/binutils/readelf.c
index 771d29d..20cfc47 100644
--- a/binutils/readelf.c
+++ b/binutils/readelf.c
@@ -4232,11 +4232,6 @@ parse_args (int argc, char ** argv)
       && !do_section_groups && !do_archive_index
       && !do_dyn_syms)
     usage (stderr);
-  else if (argc < 3 || (do_wide && argc < 4))
-    {
-      warn (_("Nothing to do.\n"));
-      usage (stderr);
-    }
 }
 
 static const char *
@@ -16131,6 +16126,11 @@ main (int argc, char ** argv)
 
   if (optind < (argc - 1))
     show_name = 1;
+  else if (optind >= argc)
+    {
+      warn (_("Nothing to do.\n"));
+      usage (stderr);
+    }
 
   err = 0;
   while (optind < argc)


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