From 896b672499d6a31a6caf85411bcbdde6edc57668 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Tue, 3 Jun 2008 08:34:09 +0200 Subject: use gnulib's progname module * bootstrap.conf (gnulib_modules): Add progname. * src/*.c (program_name): Remove declaration. * (main): Call set_program_name rather than setting program_name. * src/nice.c (main): Cast program_name to "(char *)". * src/prog-fprintf.c: Include "system.h" * src/system.h: Include "progname.h". * maint.mk (sc_program_name): Adjust rule. Suggestion from Eric Blake. --- src/ls.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'src/ls.c') diff --git a/src/ls.c b/src/ls.c index 9a8ad2def..600d7a507 100644 --- a/src/ls.c +++ b/src/ls.c @@ -244,9 +244,6 @@ static void sort_files (void); static void parse_ls_color (void); void usage (int status); -/* The name this program was run with. */ -char const *program_name; - /* Initial size of hash table. Most hierarchies are likely to be shallower than this. */ #define INITIAL_TABLE_SIZE 30 @@ -1150,7 +1147,7 @@ main (int argc, char **argv) #endif initialize_main (&argc, &argv); - program_name = argv[0]; + set_program_name (argv[0]); setlocale (LC_ALL, ""); bindtextdomain (PACKAGE, LOCALEDIR); textdomain (PACKAGE); -- cgit v1.2.3-54-g00ecf