summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Meyering <meyering@fb.com>2014-09-14 19:38:11 -0700
committerJim Meyering <meyering@fb.com>2014-11-30 18:59:34 -0800
commit8ad1b31305297df63a04919ad1bd9b94dec9aeb4 (patch)
treed093e27adaa52f48459ac6cea813c597dd4d73eb
parent72834d8d89a352f21a4ab4937a7439eadc55785b (diff)
downloadsed-8ad1b31305297df63a04919ad1bd9b94dec9aeb4.tar.gz
maint: enable sc_program_name syntax check
* cfg.mk (local-checks-to-skip): Remove its exemption. * sed/sed.c: Include progname.h". (program_name): Remove now-unnecessary declaration. (main): Call set_program_name. * bootstrap.conf (gnulib_modules): Add progname. * lib/.gitignore: Append the two new names.
-rw-r--r--bootstrap.conf1
-rw-r--r--cfg.mk3
-rw-r--r--lib/.gitignore2
-rw-r--r--sed/sed.c4
4 files changed, 7 insertions, 3 deletions
diff --git a/bootstrap.conf b/bootstrap.conf
index 2cc519e..a51fd5f 100644
--- a/bootstrap.conf
+++ b/bootstrap.conf
@@ -40,6 +40,7 @@ mbsinit
memchr
mkostemp
obstack
+progname
readme-release
regex
rename
diff --git a/cfg.mk b/cfg.mk
index 6f5e520..f381309 100644
--- a/cfg.mk
+++ b/cfg.mk
@@ -33,7 +33,6 @@ local-checks-to-skip = \
sc_m4_quote_check \
sc_makefile_at_at_check \
sc_po_check \
- sc_program_name \
sc_prohibit_always_true_header_tests \
sc_prohibit_atoi_atof \
sc_prohibit_empty_lines_at_EOF \
@@ -139,3 +138,5 @@ config_h_header ?= (<config\.h>|"sed\.h")
exclude_file_name_regexp--sc_long_lines = ^tests/.*$$
exclude_file_name_regexp--sc_prohibit_doubled_word = \
^testsuite/(mac-mf|uniq)\.(good|inp)$$
+
+exclude_file_name_regexp--sc_program_name = ^testsuite/.*\.c$$
diff --git a/lib/.gitignore b/lib/.gitignore
index 48d8e10..95015bc 100644
--- a/lib/.gitignore
+++ b/lib/.gitignore
@@ -206,3 +206,5 @@ xstriconv.c
xstriconv.h
xstrndup.c
xstrndup.h
+/progname.c
+/progname.h
diff --git a/sed/sed.c b/sed/sed.c
index 511f03a..71713ac 100644
--- a/sed/sed.c
+++ b/sed/sed.c
@@ -26,6 +26,7 @@
#include <stdlib.h>
#include <sys/types.h>
#include "getopt.h"
+#include "progname.h"
#include "version-etc.h"
@@ -35,8 +36,6 @@
_("Ken Pizzini"), \
_("Paolo Bonzini")
-char *program_name;
-
int extended_regexp_flags = 0;
/* one-byte buffer delimiter */
@@ -200,6 +199,7 @@ main(argc, argv)
/* Set locale according to user's wishes. */
setlocale (LC_ALL, "");
#endif
+ set_program_name (argv[0]);
initialize_mbcs ();
#if ENABLE_NLS