diff options
author | Jim Meyering <meyering@redhat.com> | 2011-03-03 09:48:13 +0100 |
---|---|---|
committer | Jim Meyering <meyering@redhat.com> | 2011-03-27 09:16:46 +0200 |
commit | 8b78759a8b4cb4e3e04c79547642423e904514d6 (patch) | |
tree | 89745af4a5f4732f62046cf30e6529d194192f35 | |
parent | 4a7efc37919f5ee582faa479fc8420abef39f34e (diff) | |
download | patch-8b78759a8b4cb4e3e04c79547642423e904514d6.tar.gz |
maint: use gnulib's progname module
* src/patch.c (main): Call set_program_name rather than
initializing program_name explicitly.
* src/common.h: Include progname.h rather than declaring the extern,
program_name.
* bootstrap.conf (gnulib_modules): Add progname.
* cfg.mk (local-checks-to-skip): Remove sc_program_name,
thus enabling this test.
-rw-r--r-- | bootstrap.conf | 1 | ||||
-rw-r--r-- | cfg.mk | 1 | ||||
-rw-r--r-- | src/common.h | 3 | ||||
-rw-r--r-- | src/patch.c | 2 |
4 files changed, 3 insertions, 4 deletions
diff --git a/bootstrap.conf b/bootstrap.conf index 6962b25..a42d485 100644 --- a/bootstrap.conf +++ b/bootstrap.conf @@ -42,6 +42,7 @@ manywarnings memchr minmax mkdir +progname quotearg readlink realloc @@ -26,7 +26,6 @@ local-checks-to-skip = \ sc_file_system \ sc_immutable_NEWS \ sc_obsolete_symbols \ - sc_program_name \ sc_prohibit_always-defined_macros \ sc_prohibit_always_true_header_tests \ sc_prohibit_magic_number_exit \ diff --git a/src/common.h b/src/common.h index b9422d2..5597540 100644 --- a/src/common.h +++ b/src/common.h @@ -59,6 +59,7 @@ #define ISDIGIT(c) ((unsigned) (c) - '0' <= 9) #endif +#include <progname.h> /* handy definitions */ @@ -71,8 +72,6 @@ typedef off_t lin; /* must be signed */ /* globals */ -XTERN char *program_name; /* The name this program was run with. */ - XTERN char *buf; /* general purpose buffer */ XTERN size_t bufsize; /* allocated size of buf */ diff --git a/src/patch.c b/src/patch.c index 5a5758b..44b6571 100644 --- a/src/patch.c +++ b/src/patch.c @@ -106,7 +106,7 @@ main (int argc, char **argv) int outfd = -1; exit_failure = 2; - program_name = argv[0]; + set_program_name (argv[0]); init_time (); setbuf(stderr, serrbuf); |