From aedd26b3895f80a440abdd0951eae627808ae8ed Mon Sep 17 00:00:00 2001 From: Simon Ruderich Date: Tue, 20 May 2014 16:34:58 +0200 Subject: [PATCH] fix compilation with --disable-x11 --- src/wall-notify.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/wall-notify.c b/src/wall-notify.c index 57ec37f..b06740b 100644 --- a/src/wall-notify.c +++ b/src/wall-notify.c @@ -391,6 +391,7 @@ static void usage(const char *argv0) { int main(int argc, char **argv) { int option, enable_x11, mesg_yes; + const char *argv0; int ptm, pts; char *name; @@ -400,6 +401,8 @@ int main(int argc, char **argv) { enable_x11 = 0; mesg_yes = 0; + argv0 = argv[0]; + /* * Glibc violates POSIX by default and skips over non-option arguments and * parses later arguments which look like options as well. But we want to @@ -416,7 +419,7 @@ int main(int argc, char **argv) { mesg_yes = 1; break; case 'h': - usage(argv[0]); + usage(argv0); break; case 'v': printf("%s%s\n", @@ -426,15 +429,15 @@ int main(int argc, char **argv) { break; default: fprintf(stderr, "%s: unknown option '%s'!\n\n", - argv[0], argv[optind - 1]); - usage(argv[0]); + argv0, argv[optind - 1]); + usage(argv0); break; } } /* No arguments remaining, abort. */ if (!argv[optind]) { - usage(argv[0]); + usage(argv0); } /* Arguments for notification program. */ argv += optind; -- 2.45.2