diff options
author | Roy Marples <roy@marples.name> | 2007-12-19 12:46:08 +0000 |
---|---|---|
committer | Roy Marples <roy@marples.name> | 2007-12-19 12:46:08 +0000 |
commit | cd45e5435762d8c6cd13287df7df16b97755176e (patch) | |
tree | ef0c7fb0a96e103e2a0dd79ee8c0f47f62ae7174 /src/checkown.c | |
parent | 2f7218c9849e667ba20d76e4dfe46b4bb195063a (diff) |
Introduce cbasename so we don't have to strdup(basename) and free all the time.
Diffstat (limited to 'src/checkown.c')
-rw-r--r-- | src/checkown.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/checkown.c b/src/checkown.c index ecec917c..f7dd9e6e 100644 --- a/src/checkown.c +++ b/src/checkown.c @@ -30,8 +30,6 @@ * SUCH DAMAGE. */ -#define APPLET "checkown" - #include <sys/types.h> #include <sys/stat.h> #include <errno.h> @@ -48,7 +46,7 @@ #include "einfo.h" #include "rc-misc.h" -static char *applet = NULL; +static const char *applet; static int do_check (char *path, uid_t uid, gid_t gid, mode_t mode, int file) { @@ -189,10 +187,9 @@ int checkown (int argc, char **argv) struct group *gr = NULL; bool file = 0; + applet = cbasename (argv[0]); int retval = EXIT_SUCCESS; - applet = argv[0]; - while ((opt = getopt_long (argc, argv, getoptstring, longopts, (int *) 0)) != -1) { |