From 2d8c3edb26dfaa9f10ab7ad11235eed116ffe346 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Tue, 3 Aug 2004 19:07:36 +0000 Subject: (canonicalize): Remove. All uses now merely inspect can_mode. (no_newline, verbose): Use bool for booleans. (can_mode): Now of type int; use -1 to denote otherwise-uninitialized. --- src/readlink.c | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) (limited to 'src/readlink.c') diff --git a/src/readlink.c b/src/readlink.c index 7df0a2d31..a99ab32c8 100644 --- a/src/readlink.c +++ b/src/readlink.c @@ -37,14 +37,14 @@ /* Name this program was run with. */ char *program_name; - /* If nonzero, canonicalize file name. */ -static int canonicalize; - /* If nonzero, do not output the trailing newline. */ -static int no_newline; - /* If nonzero, report error messages. */ -static int verbose; - /* In canonicalize mode, use this method. */ -canonicalize_mode_t can_mode = CAN_ALL_BUT_LAST; +/* If true, do not output the trailing newline. */ +static bool no_newline; + +/* If true, report error messages. */ +static bool verbose; + +/* If not -1, use this method to canonicalize. */ +int can_mode = -1; static struct option const longopts[] = { @@ -121,26 +121,23 @@ main (int argc, char *const argv[]) case 0: break; case 'e': - canonicalize = 1; can_mode = CAN_EXISTING; break; case 'f': - canonicalize = 1; can_mode = CAN_ALL_BUT_LAST; break; case 'm': - canonicalize = 1; can_mode = CAN_MISSING; break; case 'n': - no_newline = 1; + no_newline = true; break; case 'q': case 's': - verbose = 0; + verbose = false; break; case 'v': - verbose = 1; + verbose = true; break; case_GETOPT_HELP_CHAR; case_GETOPT_VERSION_CHAR (PROGRAM_NAME, AUTHORS); @@ -163,7 +160,7 @@ main (int argc, char *const argv[]) usage (EXIT_FAILURE); } - value = (canonicalize + value = (can_mode != -1 ? canonicalize_fname (fname) : xreadlink (fname, 1024)); if (value) -- cgit v1.2.3-54-g00ecf