From 7c2d5de6c7a61c075fe3fe8012301966c8dfb7b9 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Sat, 3 Apr 1999 05:01:48 +0000 Subject: [PATCH] define PROGRAM_NAME --- src/cat.c | 3 +++ src/cksum.c | 3 +++ src/comm.c | 3 +++ src/csplit.c | 3 +++ src/cut.c | 3 +++ src/expand.c | 3 +++ src/fmt.c | 3 +++ src/fold.c | 3 +++ src/head.c | 3 +++ src/join.c | 3 +++ src/md5sum.c | 3 +++ src/nl.c | 3 +++ src/od.c | 3 +++ src/paste.c | 3 +++ src/pr.c | 3 +++ src/ptx.c | 3 +++ src/sort.c | 3 +++ src/split.c | 3 +++ src/sum.c | 3 +++ src/tac.c | 3 +++ src/tail.c | 3 +++ src/tr.c | 3 +++ src/tsort.c | 3 +++ src/unexpand.c | 3 +++ src/uniq.c | 3 +++ src/wc.c | 3 +++ 26 files changed, 78 insertions(+) diff --git a/src/cat.c b/src/cat.c index 8e429a7161..503efe7e54 100644 --- a/src/cat.c +++ b/src/cat.c @@ -35,6 +35,9 @@ #include "long-options.h" #include "safe-read.h" +/* The official name of this program (e.g., no `g' prefix). */ +#define PROGRAM_NAME "cat" + /* Undefine, to avoid warning about redefinition on some systems. */ #undef max #define max(h,i) ((h) > (i) ? (h) : (i)) diff --git a/src/cksum.c b/src/cksum.c index 6d67585d96..2f3cf38c89 100644 --- a/src/cksum.c +++ b/src/cksum.c @@ -42,6 +42,9 @@ #include +/* The official name of this program (e.g., no `g' prefix). */ +#define PROGRAM_NAME "cksum" + #ifdef CRCTAB # include diff --git a/src/comm.c b/src/comm.c index a31e0a9b01..774aee07f8 100644 --- a/src/comm.c +++ b/src/comm.c @@ -27,6 +27,9 @@ #include "long-options.h" #include "error.h" +/* The official name of this program (e.g., no `g' prefix). */ +#define PROGRAM_NAME "comm" + /* Undefine, to avoid warning about redefinition on some systems. */ #undef min #define min(x, y) ((x) < (y) ? (x) : (y)) diff --git a/src/csplit.c b/src/csplit.c index c52d90f20d..b993ecd374 100644 --- a/src/csplit.c +++ b/src/csplit.c @@ -36,6 +36,9 @@ #include "xstrtoul.h" #include "xalloc.h" +/* The official name of this program (e.g., no `g' prefix). */ +#define PROGRAM_NAME "csplit" + #ifdef STDC_HEADERS # include #endif diff --git a/src/cut.c b/src/cut.c index 9a1d685b97..05bf8433d3 100644 --- a/src/cut.c +++ b/src/cut.c @@ -69,6 +69,9 @@ #include "long-options.h" #include "error.h" +/* The official name of this program (e.g., no `g' prefix). */ +#define PROGRAM_NAME "cut" + char *xstrdup (); #define FATAL_ERROR(Message) \ diff --git a/src/expand.c b/src/expand.c index b0fe973fc1..b1c448ea9d 100644 --- a/src/expand.c +++ b/src/expand.c @@ -42,6 +42,9 @@ #include "error.h" #include "long-options.h" +/* The official name of this program (e.g., no `g' prefix). */ +#define PROGRAM_NAME "expand" + /* The number of bytes added at a time to the amount of memory allocated for the output line. */ #define OUTPUT_BLOCK 256 diff --git a/src/fmt.c b/src/fmt.c index d27a4d8f4a..81f6917543 100644 --- a/src/fmt.c +++ b/src/fmt.c @@ -31,6 +31,9 @@ #include "long-options.h" #include "xstrtol.h" +/* The official name of this program (e.g., no `g' prefix). */ +#define PROGRAM_NAME "fmt" + /* The following parameters represent the program's idea of what is "best". Adjust to taste, subject to the caveats given. */ diff --git a/src/fold.c b/src/fold.c index aaa42afcbd..a3c387ec98 100644 --- a/src/fold.c +++ b/src/fold.c @@ -28,6 +28,9 @@ #include "long-options.h" #include "xstrtol.h" +/* The official name of this program (e.g., no `g' prefix). */ +#define PROGRAM_NAME "fold" + /* The name this program was run with. */ char *program_name; diff --git a/src/head.c b/src/head.c index 8a4fdbe99b..ad03cdd4a3 100644 --- a/src/head.c +++ b/src/head.c @@ -35,6 +35,9 @@ #include "xstrtoul.h" #include "safe-read.h" +/* The official name of this program (e.g., no `g' prefix). */ +#define PROGRAM_NAME "head" + /* FIXME: someday, make this really *be* `long long'. */ typedef long int U_LONG_LONG; diff --git a/src/join.c b/src/join.c index 087899c5f7..e74bbab678 100644 --- a/src/join.c +++ b/src/join.c @@ -36,6 +36,9 @@ #include "error.h" #include "memcasecmp.h" +/* The official name of this program (e.g., no `g' prefix). */ +#define PROGRAM_NAME "join" + #define join system_join /* Undefine, to avoid warning about redefinition on some systems. */ diff --git a/src/md5sum.c b/src/md5sum.c index c49a48040e..c0973fb00b 100644 --- a/src/md5sum.c +++ b/src/md5sum.c @@ -32,6 +32,9 @@ #include "system.h" #include "error.h" +/* The official name of this program (e.g., no `g' prefix). */ +#define PROGRAM_NAME "md5sum" + /* Most systems do not distinguish between external and internal text representations. */ /* FIXME: This begs for an autoconf test. */ diff --git a/src/nl.c b/src/nl.c index 4365686c8a..b0b3c85dd0 100644 --- a/src/nl.c +++ b/src/nl.c @@ -33,6 +33,9 @@ #include "long-options.h" #include "xstrtol.h" +/* The official name of this program (e.g., no `g' prefix). */ +#define PROGRAM_NAME "nl" + #ifndef TRUE # define TRUE 1 # define FALSE 0 diff --git a/src/od.c b/src/od.c index 03eba93668..dd2176282c 100644 --- a/src/od.c +++ b/src/od.c @@ -28,6 +28,9 @@ #include "long-options.h" #include "xstrtoul.h" +/* The official name of this program (e.g., no `g' prefix). */ +#define PROGRAM_NAME "od" + #if defined(__GNUC__) || defined(STDC_HEADERS) # include #endif diff --git a/src/paste.c b/src/paste.c index f5a3f8d6ec..bdf31ccdea 100644 --- a/src/paste.c +++ b/src/paste.c @@ -47,6 +47,9 @@ #include "error.h" #include "long-options.h" +/* The official name of this program (e.g., no `g' prefix). */ +#define PROGRAM_NAME "paste" + /* Indicates that no delimiter should be added in the current position. */ #define EMPTY_DELIM '\0' diff --git a/src/pr.c b/src/pr.c index ccf3e31284..43ab930eae 100644 --- a/src/pr.c +++ b/src/pr.c @@ -305,6 +305,9 @@ #include "long-options.h" #include "xstrtol.h" +/* The official name of this program (e.g., no `g' prefix). */ +#define PROGRAM_NAME "pr" + #ifndef TRUE # define TRUE 1 # define FALSE 0 diff --git a/src/ptx.c b/src/ptx.c index c343c2e82f..75c4f94b0d 100644 --- a/src/ptx.c +++ b/src/ptx.c @@ -31,6 +31,9 @@ #include "long-options.h" #include "regex.h" +/* The official name of this program (e.g., no `g' prefix). */ +#define PROGRAM_NAME "ptx" + /* Number of possible characters in a byte. */ #define CHAR_SET_SIZE 256 diff --git a/src/sort.c b/src/sort.c index ee0514b769..20c05e152e 100644 --- a/src/sort.c +++ b/src/sort.c @@ -33,6 +33,9 @@ #include "xstrtod.h" #include "xalloc.h" +/* The official name of this program (e.g., no `g' prefix). */ +#define PROGRAM_NAME "sort" + #if defined ENABLE_NLS && HAVE_LANGINFO_H # include #endif diff --git a/src/split.c b/src/split.c index 10bcd17703..9a0407c516 100644 --- a/src/split.c +++ b/src/split.c @@ -33,6 +33,9 @@ #include "safe-read.h" #include "xstrtol.h" +/* The official name of this program (e.g., no `g' prefix). */ +#define PROGRAM_NAME "split" + int full_write (); /* The name this program was run with. */ diff --git a/src/sum.c b/src/sum.c index 0a7d8ca4e7..c2c7fc076a 100644 --- a/src/sum.c +++ b/src/sum.c @@ -29,6 +29,9 @@ #include "long-options.h" #include "safe-read.h" +/* The official name of this program (e.g., no `g' prefix). */ +#define PROGRAM_NAME "sum" + /* The name this program was run with. */ char *program_name; diff --git a/src/tac.c b/src/tac.c index 0a52917412..ca640b81e7 100644 --- a/src/tac.c +++ b/src/tac.c @@ -48,6 +48,9 @@ tac -r -s '.\| #include "long-options.h" #include "safe-read.h" +/* The official name of this program (e.g., no `g' prefix). */ +#define PROGRAM_NAME "tac" + #if defined __MSDOS__ || defined _WIN32 /* Define this to non-zero on systems for which the regular mechanism (of unlinking an open file and expecting to be able to write, seek diff --git a/src/tail.c b/src/tail.c index c549105dc0..09ef59edaf 100644 --- a/src/tail.c +++ b/src/tail.c @@ -37,6 +37,9 @@ #include "safe-read.h" #include "xstrtoul.h" +/* The official name of this program (e.g., no `g' prefix). */ +#define PROGRAM_NAME "tail" + #ifndef OFF_T_MIN # define OFF_T_MIN TYPE_MINIMUM (off_t) #endif diff --git a/src/tr.c b/src/tr.c index ae0055ac60..75c763a10b 100644 --- a/src/tr.c +++ b/src/tr.c @@ -30,6 +30,9 @@ #include "long-options.h" #include "safe-read.h" +/* The official name of this program (e.g., no `g' prefix). */ +#define PROGRAM_NAME "tr" + #define N_CHARS (UCHAR_MAX + 1) /* A pointer to a function that returns an int. */ diff --git a/src/tsort.c b/src/tsort.c index b863cfce6a..3cf94799e2 100644 --- a/src/tsort.c +++ b/src/tsort.c @@ -34,6 +34,9 @@ #include "error.h" #include "readtokens.h" +/* The official name of this program (e.g., no `g' prefix). */ +#define PROGRAM_NAME "tsort" + /* Token delimiters when reading from a file. */ #define DELIM " \t\n" diff --git a/src/unexpand.c b/src/unexpand.c index 9d508f995b..e9ed348eab 100644 --- a/src/unexpand.c +++ b/src/unexpand.c @@ -45,6 +45,9 @@ #include "long-options.h" #include "error.h" +/* The official name of this program (e.g., no `g' prefix). */ +#define PROGRAM_NAME "unexpand" + /* The number of bytes added at a time to the amount of memory allocated for the output line. */ #define OUTPUT_BLOCK 256 diff --git a/src/uniq.c b/src/uniq.c index 5f664178bd..b08f190f86 100644 --- a/src/uniq.c +++ b/src/uniq.c @@ -30,6 +30,9 @@ #include "xstrtol.h" #include "memcasecmp.h" +/* The official name of this program (e.g., no `g' prefix). */ +#define PROGRAM_NAME "uniq" + /* Undefine, to avoid warning about redefinition on some systems. */ #undef min #define min(x, y) ((x) < (y) ? (x) : (y)) diff --git a/src/wc.c b/src/wc.c index 97dc02520d..9750a774b2 100644 --- a/src/wc.c +++ b/src/wc.c @@ -32,6 +32,9 @@ #include "long-options.h" #include "safe-read.h" +/* The official name of this program (e.g., no `g' prefix). */ +#define PROGRAM_NAME "wc" + /* Size of atomic reads. */ #define BUFFER_SIZE (16 * 1024) -- 2.47.3