PR 10288
[deliverable/binutils-gdb.git] / binutils / strings.c
index 30d27490379124d286d04fa54e4c161653fab175..06fd8e995b72d1f772129b9d3ec8f2d1d79ab70f 100644 (file)
@@ -1,6 +1,7 @@
 /* strings -- print the strings of printable characters in files
    Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
-   2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+   2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
+   Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -53,6 +54,7 @@
    -h          Print the usage message on the standard output.
 
    --version
+   -V
    -v          Print the program version number.
 
    Written by Richard Stallman <rms@gnu.ai.mit.edu>
@@ -156,6 +158,7 @@ main (int argc, char **argv)
   int exit_status = 0;
   bfd_boolean files_given = FALSE;
   char *s;
+  int numeric_opt = 0;
 
 #if defined (HAVE_SETLOCALE)
   setlocale (LC_ALL, "");
@@ -245,13 +248,17 @@ main (int argc, char **argv)
          usage (stderr, 1);
 
        default:
-         string_min = (int) strtoul (argv[optind - 1] + 1, &s, 0);
-         if (s != NULL && *s != 0)
-           fatal (_("invalid integer argument %s"), argv[optind - 1] + 1);
+         numeric_opt = optind;
          break;
        }
     }
 
+  if (numeric_opt != 0)
+    {
+      string_min = (int) strtoul (argv[numeric_opt - 1] + 1, &s, 0);
+      if (s != NULL && *s != 0)
+       fatal (_("invalid integer argument %s"), argv[numeric_opt - 1] + 1);
+    }
   if (string_min < 1)
     fatal (_("invalid minimum string length %d"), string_min);
 
@@ -663,7 +670,7 @@ usage (FILE *stream, int status)
                             s = 7-bit, S = 8-bit, {b,l} = 16-bit, {B,L} = 32-bit\n\
   @<file>                   Read options from <file>\n\
   -h --help                 Display this information\n\
-  -v --version              Print the program's version number\n"));
+  -v -V --version           Print the program's version number\n"));
   list_supported_targets (program_name, stream);
   if (REPORT_BUGS_TO[0] && status == 0)
     fprintf (stream, _("Report bugs to %s\n"), REPORT_BUGS_TO);
This page took 0.023636 seconds and 4 git commands to generate.