diff --git a/bootstrap.conf b/bootstrap.conf index 6033b6f..c3ccc12 100644 --- a/bootstrap.conf +++ b/bootstrap.conf @@ -47,6 +47,7 @@ inttypes maintainer-makefile mbrtowc mkstemp +progname regex sh-quote stat-macros diff --git a/cfg.mk b/cfg.mk index feaedd5..66fcfb6 100644 --- a/cfg.mk +++ b/cfg.mk @@ -34,8 +34,7 @@ gpg_key_ID = B9AB9A16 local-checks-to-skip = \ sc_error_message_period \ sc_error_message_uppercase \ - sc_m4_quote_check \ - sc_program_name + sc_m4_quote_check # Tools used to bootstrap this package, used for "announcement". bootstrap-tools = autoconf,automake,gnulib diff --git a/src/cmp.c b/src/cmp.c index 5fc9338..2a34e15 100644 --- a/src/cmp.c +++ b/src/cmp.c @@ -29,6 +29,7 @@ #include #include #include +#include #include #include #include @@ -46,9 +47,6 @@ static size_t block_compare (word const *, word const *); static size_t block_compare_and_count (word const *, word const *, off_t *); static void sprintc (char *, unsigned char); -/* Name under which this program was invoked. */ -char *program_name; - /* Filenames of the compared files. */ static char const *file[2]; @@ -192,7 +190,7 @@ main (int argc, char **argv) exit_failure = EXIT_TROUBLE; initialize_main (&argc, &argv); - program_name = argv[0]; + set_program_name (argv[0]); setlocale (LC_ALL, ""); bindtextdomain (PACKAGE, LOCALEDIR); textdomain (PACKAGE); diff --git a/src/diff.c b/src/diff.c index dded58a..95dbb45 100644 --- a/src/diff.c +++ b/src/diff.c @@ -31,6 +31,7 @@ #include #include #include +#include #include #include #include @@ -202,11 +203,6 @@ static struct option const longopts[] = {0, 0, 0, 0} }; -/* Program name. */ -char *program_name; - - - /* Return a string containing the command options with which diff was invoked. Spaces appear between what were separate ARGV-elements. There is a space at the beginning but none at the end. @@ -266,7 +262,7 @@ main (int argc, char **argv) /* Do our initializations. */ exit_failure = 2; initialize_main (&argc, &argv); - program_name = argv[0]; + set_program_name (argv[0]); setlocale (LC_ALL, ""); bindtextdomain (PACKAGE, LOCALEDIR); textdomain (PACKAGE); diff --git a/src/diff.h b/src/diff.h index 1af7bc4..2a18dbb 100644 --- a/src/diff.h +++ b/src/diff.h @@ -199,9 +199,6 @@ XTERN struct exclude *excluded; slower) but will find a guaranteed minimal set of changes. */ XTERN bool minimal; -/* Name of program the user invoked (for error messages). */ -XTERN char *program_name; - /* The strftime format to use for time strings. */ XTERN char const *time_format; diff --git a/src/diff3.c b/src/diff3.c index 5734f5d..ccdff0b 100644 --- a/src/diff3.c +++ b/src/diff3.c @@ -29,6 +29,7 @@ #include #include #include +#include #include #include #include @@ -158,8 +159,6 @@ static bool finalwrite; /* If nonzero, output a merged file. */ static bool merge; -char *program_name; - static char *read_diff (char const *, char const *, char **); static char *scan_diff_line (char *, char **, size_t *, char *, char); static enum diff_type process_diff_control (char **, struct diff_block *); @@ -226,7 +225,7 @@ main (int argc, char **argv) exit_failure = 2; initialize_main (&argc, &argv); - program_name = argv[0]; + set_program_name (argv[0]); setlocale (LC_ALL, ""); bindtextdomain (PACKAGE, LOCALEDIR); textdomain (PACKAGE); diff --git a/src/sdiff.c b/src/sdiff.c index fbf9bd4..538fca9 100644 --- a/src/sdiff.c +++ b/src/sdiff.c @@ -30,6 +30,7 @@ #include #include #include +#include #include #include #include @@ -37,8 +38,6 @@ /* Size of chunks read from files which must be parsed into lines. */ #define SDIFF_BUFSIZE ((size_t) 65536) -char *program_name; - static char const *editor_program = DEFAULT_EDITOR_PROGRAM; static char const **diffargv; @@ -459,7 +458,7 @@ main (int argc, char *argv[]) exit_failure = EXIT_TROUBLE; initialize_main (&argc, &argv); - program_name = argv[0]; + set_program_name (argv[0]); setlocale (LC_ALL, ""); bindtextdomain (PACKAGE, LOCALEDIR); textdomain (PACKAGE);