]> git.armaanb.net Git - dmenu.git/commitdiff
fixed a bug when dmenu is run with -v
authorAnselm R. Garbe <arg@suckless.org>
Fri, 23 Feb 2007 13:39:54 +0000 (14:39 +0100)
committerAnselm R. Garbe <arg@suckless.org>
Fri, 23 Feb 2007 13:39:54 +0000 (14:39 +0100)
config.mk
main.c

index a0ef56a71092800f63965dcef25aa180d86e94e3..7ae7dde2b456948d28a7640b8f0aa4679ebb74b1 100644 (file)
--- a/config.mk
+++ b/config.mk
@@ -1,5 +1,5 @@
 # dmenu version
-VERSION = 2.4.2
+VERSION = 2.5
 
 # Customize below to fit your system
 
diff --git a/main.c b/main.c
index c1d48ddcad51685a4f62fe224e4abdc349f85b3d..cd0e2b5df0472c654b2282b16d2a75a3cf08f4b4 100644 (file)
--- a/main.c
+++ b/main.c
@@ -418,7 +418,9 @@ main(int argc, char *argv[]) {
        XModifierKeymap *modmap;
        XSetWindowAttributes wa;
 
-       if(isatty(STDIN_FILENO)) {
+       if(argc == 2 && !strncmp("-v", argv[1], 3))
+               eprint("dmenu-"VERSION", (C)opyright MMVI-MMVII Anselm R. Garbe\n");
+       else if(isatty(STDIN_FILENO)) {
                fputs("error: dmenu can't run in an interactive shell\n", stdout);
                usage();
        }
@@ -445,8 +447,6 @@ main(int argc, char *argv[]) {
                else if(!strncmp(argv[i], "-sf", 4)) {
                        if(++i < argc) selfg = argv[i];
                }
-               else if(!strncmp(argv[i], "-v", 3))
-                       eprint("dmenu-"VERSION", (C)opyright MMVI-MMVII Anselm R. Garbe\n");
                else
                        usage();
        setlocale(LC_CTYPE, "");