summaryrefslogtreecommitdiff
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[]) {
Bool fast = False;
int i;
- progname = "dmenu";
for(i = 1; i < argc; i++)
/* single flags */
if(!strcmp(argv[i], "-v")) {
@@ -383,10 +382,9 @@ keypress(XKeyEvent *ev) {
void
match(void) {
- size_t len;
+ size_t len = strlen(text);
Item *item, *lexact, *lprefix, *lsubstr, *exactend, *prefixend, *substrend;
- len = strlen(text);
matches = lexact = lprefix = lsubstr = matchend = exactend = prefixend = substrend = NULL;
for(item = items; item && item->text; item++)
if(!fstrncmp(text, item->text, len + 1))
@@ -424,9 +422,8 @@ match(void) {
size_t
nextrune(int incr) {
- size_t n, len;
+ size_t n, len = strlen(text);
- len = strlen(text);
for(n = cursor + incr; n >= 0 && n < len && (text[n] & 0xc0) == 0x80; n += incr);
return n;
}