summaryrefslogtreecommitdiff
path: root/dmenu.c
diff options
context:
space:
mode:
authorConnor Lane Smith <cls@lubutu.com>2011-05-14 22:43:42 +0100
committerConnor Lane Smith <cls@lubutu.com>2011-05-14 22:43:42 +0100
commitd066975e78d98f368ab0e3106e00804a28697373 (patch)
tree087ba6c0282d7f7556c51fad8c0d3938fa0a6bd1 /dmenu.c
parent26236a4900657e8e6e9c5fcf277b51ca242fa3e8 (diff)
cleanup
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;
}