diff -ur chkconfig-1.2.24~/chkconfig.c chkconfig-1.2.24/chkconfig.c --- chkconfig-1.2.24~/chkconfig.c Sat Jan 26 20:55:06 2002 +++ chkconfig-1.2.24/chkconfig.c Sat Jan 26 20:55:18 2002 @@ -11,21 +11,21 @@ #include #include -static char *progname; +extern const char *__progname; #define _(String) gettext((String)) #include "leveldb.h" static void usage(void) { - fprintf(stderr, _("%s version %s - Copyright (C) 1997-2000 Red Hat, Inc.\n"), progname, VERSION); + fprintf(stderr, _("%s version %s - Copyright (C) 1997-2000 Red Hat, Inc.\n"), __progname, VERSION); fprintf(stderr, _("This may be freely redistributed under the terms of " "the GNU Public License.\n")); fprintf(stderr, "\n"); - fprintf(stderr, _("usage: %s --list [name]\n"), progname); - fprintf(stderr, _(" %s --add \n"), progname); - fprintf(stderr, _(" %s --del \n"), progname); - fprintf(stderr, _(" %s [--level ] %s)\n"), progname, ""); + fprintf(stderr, _("usage: %s --list [name]\n"), __progname); + fprintf(stderr, _(" %s --add \n"), __progname); + fprintf(stderr, _(" %s --del \n"), __progname); + fprintf(stderr, _(" %s [--level ] %s)\n"), __progname, ""); exit(1); } @@ -271,11 +271,6 @@ { 0, 0, 0, 0, 0 } }; - if ((progname = strrchr(argv[0], '/')) != NULL) - progname++; - else - progname = argv[0]; - setlocale(LC_ALL, ""); bindtextdomain("chkconfig","/usr/share/locale"); textdomain("chkconfig"); @@ -291,7 +286,7 @@ } if (version) { - fprintf(stdout, _("%s version %s\n"), progname, VERSION); + fprintf(stdout, _("%s version %s\n"), __progname, VERSION); exit(0); } diff -ur chkconfig-1.2.24~/ntsysv.c chkconfig-1.2.24/ntsysv.c --- chkconfig-1.2.24~/ntsysv.c Mon Mar 5 08:51:54 2001 +++ chkconfig-1.2.24/ntsysv.c Sat Jan 26 20:56:27 2002 @@ -16,6 +16,8 @@ #include "leveldb.h" +extern const char *__progname; + /* return 1 on cancel, 2 on error, 0 on success */ static int servicesWindow(struct service * services, int numServices, int levels, int backButton) { @@ -243,7 +245,6 @@ int numServices; int levels = -1; char * levelsStr = NULL; - char *progName; poptContext optCon; int rc, backButton = 0, hide = 0; struct poptOption optionsTable[] = { @@ -257,14 +258,12 @@ bindtextdomain("chkconfig", "/usr/share/locale"); textdomain("chkconfig"); - progName = argv[0]; - if (getuid() != 0) { - fprintf(stderr, _("You must be root to run %s.\n"),progName); + fprintf(stderr, _("You must be root to run %s.\n"), __progname); exit(1); } - optCon = poptGetContext(progName, argc, argv, optionsTable, 0); + optCon = poptGetContext(__progname, argc, argv, optionsTable, 0); poptReadDefaultConfig(optCon, 1); if ((rc = poptGetNextOpt(optCon)) < -1) {