X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=binutils%2Fstrings.c;h=06fd8e995b72d1f772129b9d3ec8f2d1d79ab70f;hb=0313a2b8d2bc3ac3a15912d7fa9fe02722eaa14c;hp=30d27490379124d286d04fa54e4c161653fab175;hpb=508e676df1a21a34a1b53b004bed87a3358d776b;p=deliverable%2Fbinutils-gdb.git diff --git a/binutils/strings.c b/binutils/strings.c index 30d2749037..06fd8e995b 100644 --- a/binutils/strings.c +++ b/binutils/strings.c @@ -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 @@ -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\ @ Read options from \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);