aboutsummaryrefslogtreecommitdiff
path: root/coreutils/sort.c
diff options
context:
space:
mode:
Diffstat (limited to 'coreutils/sort.c')
-rw-r--r--coreutils/sort.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/coreutils/sort.c b/coreutils/sort.c
index 9860dca64..ceea24491 100644
--- a/coreutils/sort.c
+++ b/coreutils/sort.c
@@ -94,7 +94,7 @@
94*/ 94*/
95 95
96/* These are sort types */ 96/* These are sort types */
97static const char OPT_STR[] ALIGN1 = "ngMucszbrdfimS:T:o:k:*t:"; 97#define OPT_STR "ngMucszbrdfimS:T:o:k:*t:"
98enum { 98enum {
99 FLAG_n = 1, /* Numeric sort */ 99 FLAG_n = 1, /* Numeric sort */
100 FLAG_g = 2, /* Sort using strtod() */ 100 FLAG_g = 2, /* Sort using strtod() */
@@ -378,9 +378,11 @@ int sort_main(int argc UNUSED_PARAM, char **argv)
378 xfunc_error_retval = 2; 378 xfunc_error_retval = 2;
379 379
380 /* Parse command line options */ 380 /* Parse command line options */
381 /* -o and -t can be given at most once */ 381 opts = getopt32(argv, "^"
382 opt_complementary = "o--o:t--t"; /* -t, -o: at most one of each */ 382 OPT_STR
383 opts = getopt32(argv, OPT_STR, &str_ignored, &str_ignored, &str_o, &lst_k, &str_t); 383 "\0" "o--o:t--t"/*-t, -o: at most one of each*/,
384 &str_ignored, &str_ignored, &str_o, &lst_k, &str_t
385 );
384 /* global b strips leading and trailing spaces */ 386 /* global b strips leading and trailing spaces */
385 if (opts & FLAG_b) 387 if (opts & FLAG_b)
386 option_mask32 |= FLAG_bb; 388 option_mask32 |= FLAG_bb;