From e02fd6026055e30c1c26b0d69b552cf427a7c45d Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Sat, 8 Jan 2000 18:02:42 +0000 Subject: [PATCH] (PAGES_OPTION, COLUMNS_OPTION): Define these and use them instead of `CHAR_MAX + n'. --- src/pr.c | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/src/pr.c b/src/pr.c index 1e62c3bfd3..115b6a4a5f 100644 --- a/src/pr.c +++ b/src/pr.c @@ -1,5 +1,5 @@ /* pr -- convert text files for printing. - Copyright (C) 88, 91, 1995-1999 Free Software Foundation, Inc. + Copyright (C) 88, 91, 1995-2000 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -725,11 +725,19 @@ static int last_line = FALSE; -h HEADER using pr test-suite */ static int test_suite; +/* For long options that have no equivalent short option, use a + non-character as a pseudo short option, starting with CHAR_MAX + 1. */ +enum +{ + PAGES_OPTION = CHAR_MAX + 1, + COLUMNS_OPTION +}; + static struct option const long_options[] = { {"test", no_argument, &test_suite, 1}, - {"pages", required_argument, NULL, CHAR_MAX + 1}, - {"columns", required_argument, NULL, CHAR_MAX + 2}, + {"pages", required_argument, NULL, PAGES_OPTION}, + {"columns", required_argument, NULL, COLUMNS_OPTION}, {"across", no_argument, NULL, 'a'}, {"show-control-chars", no_argument, NULL, 'c'}, {"double-space", no_argument, NULL, 'd'}, @@ -901,7 +909,7 @@ main (int argc, char **argv) case 0: /* getopt long option */ break; - case CHAR_MAX + 1: /* --pages=FIRST_PAGE[:LAST_PAGE] */ + case PAGES_OPTION: /* --pages=FIRST_PAGE[:LAST_PAGE] */ { /* dominates old opt +... */ if (optarg) first_last_page (optarg); @@ -911,7 +919,7 @@ main (int argc, char **argv) break; } - case CHAR_MAX + 2: /* --columns=COLUMN */ + case COLUMNS_OPTION: /* --columns=COLUMN */ { long int tmp_long; if (xstrtol (optarg, NULL, 10, &tmp_long, "") != LONGINT_OK -- 2.47.3