From 8188c3b48ded8b53d88440f0736690d2e30508ed Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sat, 4 Aug 2007 13:36:59 +0200 Subject: Adapt to new human and xstrtol API. * src/df.c (long_options): Prepend "--" to long options that OPT_STR might decode. * src/du.c (long_options): Likewise. * src/od.c (long_options): Likewise. * src/sort.c (long_options): Likewise. * src/df.c (main): Adjust to new human and xstrtol API. * src/du.c (main): Likewise. * src/ls.c (decode_switches): Likewise. * src/od.c (main): Likewise. * src/pr.c (first_last_page): Likewise. New argument OPTION. All callers changed. * src/sort.c (specify_sort_size): New arg OPTION. All callers changed. Adjust to new xstrtol API. * src/system.h (opt_str_storage): New static var. (OPT_STR, LONG_OPT_STR, OPT_STR_INIT): New macros. --- src/ls.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'src/ls.c') diff --git a/src/ls.c b/src/ls.c index ee736227e..064a51f74 100644 --- a/src/ls.c +++ b/src/ls.c @@ -1450,8 +1450,8 @@ decode_switches (int argc, char **argv) { char const *ls_block_size = getenv ("LS_BLOCK_SIZE"); - human_output_opts = human_options (ls_block_size, false, - &output_block_size); + human_options (ls_block_size, + &human_output_opts, &output_block_size); if (ls_block_size || getenv ("BLOCK_SIZE")) file_output_block_size = output_block_size; } @@ -1793,8 +1793,13 @@ decode_switches (int argc, char **argv) break; case BLOCK_SIZE_OPTION: - human_output_opts = human_options (optarg, true, &output_block_size); - file_output_block_size = output_block_size; + { + enum strtol_error e = human_options (optarg, &human_output_opts, + &output_block_size); + if (e != LONGINT_OK) + STRTOL_FATAL_ERROR ("--block-size", optarg, e); + file_output_block_size = output_block_size; + } break; case SI_OPTION: -- cgit v1.2.3-54-g00ecf