aboutsummaryrefslogtreecommitdiff
path: root/dmenu.c
diff options
context:
space:
mode:
Diffstat (limited to 'dmenu.c')
-rw-r--r--dmenu.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/dmenu.c b/dmenu.c
index b6f1ef2..40b220c 100644
--- a/dmenu.c
+++ b/dmenu.c
@@ -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
384void 383void
385match(void) { 384match(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
425size_t 423size_t
426nextrune(int incr) { 424nextrune(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}