diff options
-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'; |