1
0
Fork 0

fixed a bug when dmenu is run with -v

This commit is contained in:
Anselm R. Garbe 2007-02-23 14:39:54 +01:00
parent d8b48d64e1
commit 6b5b580aff
2 changed files with 4 additions and 4 deletions

View file

@ -1,5 +1,5 @@
# dmenu version # dmenu version
VERSION = 2.4.2 VERSION = 2.5
# Customize below to fit your system # Customize below to fit your system

6
main.c
View file

@ -418,7 +418,9 @@ main(int argc, char *argv[]) {
XModifierKeymap *modmap; XModifierKeymap *modmap;
XSetWindowAttributes wa; 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); fputs("error: dmenu can't run in an interactive shell\n", stdout);
usage(); usage();
} }
@ -445,8 +447,6 @@ main(int argc, char *argv[]) {
else if(!strncmp(argv[i], "-sf", 4)) { else if(!strncmp(argv[i], "-sf", 4)) {
if(++i < argc) selfg = argv[i]; 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 else
usage(); usage();
setlocale(LC_CTYPE, ""); setlocale(LC_CTYPE, "");