From 54bc217bd921560321f4b805bdbc18b72fb811f9 Mon Sep 17 00:00:00 2001 From: "Anselm R. Garbe" Date: Fri, 23 Feb 2007 14:39:54 +0100 Subject: [PATCH] fixed a bug when dmenu is run with -v --- dmenubar/config.mk | 2 +- dmenubar/main.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dmenubar/config.mk b/dmenubar/config.mk index a0ef56a..7ae7dde 100644 --- a/dmenubar/config.mk +++ b/dmenubar/config.mk @@ -1,5 +1,5 @@ # dmenu version -VERSION = 2.4.2 +VERSION = 2.5 # Customize below to fit your system diff --git a/dmenubar/main.c b/dmenubar/main.c index c1d48dd..cd0e2b5 100644 --- a/dmenubar/main.c +++ b/dmenubar/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, "");