[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug-patch] [PATCH 12/15] maint: use gnulib's progname module
From: |
Jim Meyering |
Subject: |
[bug-patch] [PATCH 12/15] maint: use gnulib's progname module |
Date: |
Sat, 26 Mar 2011 14:32:07 +0100 |
From: Jim Meyering <address@hidden>
* 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 96e098d..853f763 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-defined_macros \
sc_prohibit_always_true_header_tests \
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);
--
1.7.1.354.ge64bd
- [bug-patch] [PATCH 04/15] maint: remove trailing blanks, (continued)
- [bug-patch] [PATCH 04/15] maint: remove trailing blanks, Jim Meyering, 2011/03/26
- [bug-patch] [PATCH 09/15] build: avoid three gcc warnings, Jim Meyering, 2011/03/26
- [bug-patch] [PATCH 15/15] build: don't turn off -Wmissing-declarations, Jim Meyering, 2011/03/26
- [bug-patch] [PATCH 13/15] maint: remove now-unneeded macro definitions, Jim Meyering, 2011/03/26
- [bug-patch] [PATCH 14/15] build: don't turn off -Wmissing-prototypes, Jim Meyering, 2011/03/26
- [bug-patch] [PATCH 05/15] maint: allow the sc_prohibit_empty_lines_at_EOF test to pass, Jim Meyering, 2011/03/26
- [bug-patch] [PATCH 07/15] build: accept new configure-time option --enable-gcc-warnings, Jim Meyering, 2011/03/26
- [bug-patch] [PATCH 06/15] maint: avoid non-portable use of test -a, Jim Meyering, 2011/03/26
- [bug-patch] [PATCH 11/15] maint: update bootstrap and gnulib submodule, Jim Meyering, 2011/03/26
- [bug-patch] [PATCH 12/15] maint: use gnulib's progname module,
Jim Meyering <=
- [bug-patch] [PATCH 10/15] maint: update copyright date year ranges to include 2011, Jim Meyering, 2011/03/26
- Re: [bug-patch] [PATCH 00/15] *** SUBJECT HERE ***, Andreas Gruenbacher, 2011/03/26