all repos — dmenu @ f63327677421a07cca69b86c7dd5f01047fe14b1

my build of dmenu

fixing arg handling in dmenu (thanks to Sander for his report)
Anselm R. Garbe arg@suckless.org
Mon, 23 Oct 2006 10:12:09 +0200
commit

f63327677421a07cca69b86c7dd5f01047fe14b1

parent

bb480fb4b0fd06207b2ee1b88eb32b8588e698dc

2 files changed, 19 insertions(+), 13 deletions(-)

jump to
M config.mkconfig.mk

@@ -1,5 +1,5 @@

# dmenu version -VERSION = 1.3 +VERSION = 1.4 # Customize below to fit your system
M main.cmain.c

@@ -286,18 +286,24 @@ timeout.tv_usec = 0;

timeout.tv_sec = 3; /* command line args */ for(i = 1; i < argc; i++) - if(!strncmp(argv[i], "-font", 6)) - font = argv[++i]; - else if(!strncmp(argv[i], "-normbg", 8)) - normbg = argv[++i]; - else if(!strncmp(argv[i], "-normfg", 8)) - normfg = argv[++i]; - else if(!strncmp(argv[i], "-selbg", 7)) - selbg = argv[++i]; - else if(!strncmp(argv[i], "-selfg", 7)) - selfg = argv[++i]; - else if(!strncmp(argv[i], "-t", 3)) - timeout.tv_sec = atoi(argv[++i]); + if(!strncmp(argv[i], "-font", 6)) { + if(++i < argc) font = argv[i]; + } + else if(!strncmp(argv[i], "-normbg", 8)) { + if(++i < argc) normbg = argv[i]; + } + else if(!strncmp(argv[i], "-normfg", 8)) { + if(++i < argc) normfg = argv[i]; + } + else if(!strncmp(argv[i], "-selbg", 7)) { + if(++i < argc) selbg = argv[i]; + } + else if(!strncmp(argv[i], "-selfg", 7)) { + if(++i < argc) selfg = argv[i]; + } + else if(!strncmp(argv[i], "-t", 3)) { + if(++i < argc) timeout.tv_sec = atoi(argv[i]); + } else if(!strncmp(argv[i], "-v", 3)) { fputs("dmenu-"VERSION", (C)opyright MMVI Anselm R. Garbe\n", stdout); exit(EXIT_SUCCESS);