bug-patch
[Top][All Lists]
Advanced

[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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]