summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2006-09-18 20:38:54 +0000
committerPaul Eggert <eggert@cs.ucla.edu>2006-09-18 20:38:54 +0000
commitbebf83d0fd198ea199f6df9684141d284b5323e2 (patch)
tree6ebf8dfe50ec79a44449d1bb9f2c925b09534628
parent46dd4b1a8ede10b94591d9302f92dc49d3f90838 (diff)
downloadcoreutils-bebf83d0fd198ea199f6df9684141d284b5323e2.tar.xz
* src/shuf.c (main): Quote the entire range when reporting an
invalid one, rather than just the part that contained the error.
-rw-r--r--ChangeLog3
-rw-r--r--src/shuf.c5
2 files changed, 6 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 8b32b4c1e..7f741fbe6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
2006-09-18 Paul Eggert <eggert@cs.ucla.edu>
+ * src/shuf.c (main): Quote the entire range when reporting an
+ invalid one, rather than just the part that contained the error.
+
* tests/stty/row-col-1: Rewrite to avoid temporary file that is
sometimes left behind if the test is skipped or interrupted.
diff --git a/src/shuf.c b/src/shuf.c
index 4d215ee67..39cfdfffb 100644
--- a/src/shuf.c
+++ b/src/shuf.c
@@ -279,6 +279,7 @@ main (int argc, char **argv)
{
unsigned long int argval = 0;
char *p = strchr (optarg, '-');
+ char const *hi_optarg = optarg;
bool invalid = !p;
if (input_numbers_option_used (lo_input, hi_input))
@@ -292,10 +293,10 @@ main (int argc, char **argv)
|| SIZE_MAX < argval);
*p = '-';
lo_input = argval;
- optarg = p + 1;
+ hi_optarg = p + 1;
}
- invalid |= ((xstrtoul (optarg, NULL, 10, &argval, NULL)
+ invalid |= ((xstrtoul (hi_optarg, NULL, 10, &argval, NULL)
!= LONGINT_OK)
|| SIZE_MAX < argval);
hi_input = argval;