diff options
author | Jim Meyering <jim@meyering.net> | 1995-07-09 16:42:31 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 1995-07-09 16:42:31 +0000 |
commit | 6dfad5e900f643e1aa85ea46f165338228aafab0 (patch) | |
tree | dcffa16074db2a13aef776a1669891962851c520 /src | |
parent | ccfb7f032d0a7f68059ea13824d1f1d73cf65ba0 (diff) | |
download | coreutils-6dfad5e900f643e1aa85ea46f165338228aafab0.tar.xz |
(main): When using obsolescent +pos -pos syntax, allow
omission of field spec only when character offset is specified.
Otherwise, -. +. would be accepted.
Diffstat (limited to 'src')
-rw-r--r-- | src/sort.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/sort.c b/src/sort.c index 1ed071b36..23dc11bbc 100644 --- a/src/sort.c +++ b/src/sort.c @@ -1541,7 +1541,7 @@ main (argc, argv) key->skipsblanks = key->skipeblanks = 0; key->numeric = key->month = key->reverse = 0; s = argv[i] + 1; - if (!digits[UCHAR (*s)] && *s != '.') + if (! (digits[UCHAR (*s)] || (*s == '.' && digits[s[1]]))) badfieldspec (argv[i]); for (t = 0; digits[UCHAR (*s)]; ++s) t = 10 * t + *s - '0'; @@ -1563,7 +1563,7 @@ main (argc, argv) else if (argv[i][0] == '-' && argv[i][1]) { s = argv[i] + 1; - if (digits[UCHAR (*s)] || *s == '.') + if (digits[UCHAR (*s)] || (*s == '.' && digits[s[1]])) { if (!key) usage (2); @@ -1612,7 +1612,7 @@ main (argc, argv) key->skipsblanks = key->skipeblanks = 0; key->numeric = key->month = key->reverse = 0; /* Get POS1. */ - if (!digits[UCHAR (*s)] && *s != '.') + if (!digits[UCHAR (*s)]) badfieldspec (argv[i]); for (t = 0; digits[UCHAR (*s)]; ++s) t = 10 * t + *s - '0'; |