fixed a bug when dmenu is run with -v 6b5b580a
Anselm R. Garbe · 2007-02-23 14:39 2 file(s) · +4 −4
config.mk +1 −1
1 1
# dmenu version
2 -
VERSION = 2.4.2
2 +
VERSION = 2.5
3 3
4 4
# Customize below to fit your system
5 5
main.c +3 −3
418 418
	XModifierKeymap *modmap;
419 419
	XSetWindowAttributes wa;
420 420
421 -
	if(isatty(STDIN_FILENO)) {
421 +
	if(argc == 2 && !strncmp("-v", argv[1], 3))
422 +
		eprint("dmenu-"VERSION", (C)opyright MMVI-MMVII Anselm R. Garbe\n");
423 +
	else if(isatty(STDIN_FILENO)) {
422 424
		fputs("error: dmenu can't run in an interactive shell\n", stdout);
423 425
		usage();
424 426
	}
445 447
		else if(!strncmp(argv[i], "-sf", 4)) {
446 448
			if(++i < argc) selfg = argv[i];
447 449
		}
448 -
		else if(!strncmp(argv[i], "-v", 3))
449 -
			eprint("dmenu-"VERSION", (C)opyright MMVI-MMVII Anselm R. Garbe\n");
450 450
		else
451 451
			usage();
452 452
	setlocale(LC_CTYPE, "");