diff options
Diffstat (limited to 'dmenu.c')
-rw-r--r-- | dmenu.c | 7 |
1 files changed, 2 insertions, 5 deletions
@@ -66,7 +66,6 @@ main(int argc, char *argv[]) { | |||
66 | Bool fast = False; | 66 | Bool fast = False; |
67 | int i; | 67 | int i; |
68 | 68 | ||
69 | progname = "dmenu"; | ||
70 | for(i = 1; i < argc; i++) | 69 | for(i = 1; i < argc; i++) |
71 | /* single flags */ | 70 | /* single flags */ |
72 | if(!strcmp(argv[i], "-v")) { | 71 | if(!strcmp(argv[i], "-v")) { |
@@ -383,10 +382,9 @@ keypress(XKeyEvent *ev) { | |||
383 | 382 | ||
384 | void | 383 | void |
385 | match(void) { | 384 | match(void) { |
386 | size_t len; | 385 | size_t len = strlen(text); |
387 | Item *item, *lexact, *lprefix, *lsubstr, *exactend, *prefixend, *substrend; | 386 | Item *item, *lexact, *lprefix, *lsubstr, *exactend, *prefixend, *substrend; |
388 | 387 | ||
389 | len = strlen(text); | ||
390 | matches = lexact = lprefix = lsubstr = matchend = exactend = prefixend = substrend = NULL; | 388 | matches = lexact = lprefix = lsubstr = matchend = exactend = prefixend = substrend = NULL; |
391 | for(item = items; item && item->text; item++) | 389 | for(item = items; item && item->text; item++) |
392 | if(!fstrncmp(text, item->text, len + 1)) | 390 | if(!fstrncmp(text, item->text, len + 1)) |
@@ -424,9 +422,8 @@ match(void) { | |||
424 | 422 | ||
425 | size_t | 423 | size_t |
426 | nextrune(int incr) { | 424 | nextrune(int incr) { |
427 | size_t n, len; | 425 | size_t n, len = strlen(text); |
428 | 426 | ||
429 | len = strlen(text); | ||
430 | for(n = cursor + incr; n >= 0 && n < len && (text[n] & 0xc0) == 0x80; n += incr); | 427 | for(n = cursor + incr; n >= 0 && n < len && (text[n] & 0xc0) == 0x80; n += incr); |
431 | return n; | 428 | return n; |
432 | } | 429 | } |