From 8b78759a8b4cb4e3e04c79547642423e904514d6 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Thu, 3 Mar 2011 09:48:13 +0100 Subject: 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. --- bootstrap.conf | 1 + cfg.mk | 1 - src/common.h | 3 +-- 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 diff --git a/cfg.mk b/cfg.mk index 3aa865c..3d0f355 100644 --- a/cfg.mk +++ b/cfg.mk @@ -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 /* 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); -- cgit v1.2.1