diff options
author | arg@wmii.de <unknown> | 2006-09-26 08:43:41 +0200 |
---|---|---|
committer | arg@wmii.de <unknown> | 2006-09-26 08:43:41 +0200 |
commit | c9465859a6eac7763d0b9049dca6bd34c163d8f6 (patch) | |
tree | 28e6dcd735abeb5d0585da1530d3a250f00a7dcc | |
parent | 1716159e05e712962c3a4c60091f6cd6b573461f (diff) |
applied a change made by Uriel to dmenu (though I didn't applied everything)
-rw-r--r-- | main.c | 21 |
1 files changed, 4 insertions, 17 deletions
@@ -120,19 +120,8 @@ match(char *pattern) { | |||
120 | nitem = 0; | 120 | nitem = 0; |
121 | 121 | ||
122 | for(i = allitems; i; i=i->next) | 122 | for(i = allitems; i; i=i->next) |
123 | if(!plen || !strncmp(pattern, i->text, plen)) { | 123 | if(plen ? !strncmp(pattern, i->text, plen) : |
124 | if(!j) | 124 | strncmp(pattern, i->text, plen) && strstr(i->text, pattern)) { |
125 | item = i; | ||
126 | else | ||
127 | j->right = i; | ||
128 | i->left = j; | ||
129 | i->right = NULL; | ||
130 | j = i; | ||
131 | nitem++; | ||
132 | } | ||
133 | for(i = allitems; i; i=i->next) | ||
134 | if(plen && strncmp(pattern, i->text, plen) | ||
135 | && strstr(i->text, pattern)) { | ||
136 | if(!j) | 125 | if(!j) |
137 | item = i; | 126 | item = i; |
138 | else | 127 | else |
@@ -208,10 +197,8 @@ kpress(XKeyEvent * e) { | |||
208 | } | 197 | } |
209 | break; | 198 | break; |
210 | case XK_Return: | 199 | case XK_Return: |
211 | if(e->state & ShiftMask) { | 200 | if((e->state & ShiftMask) && text) |
212 | if(text) | 201 | fprintf(stdout, "%s", text); |
213 | fprintf(stdout, "%s", text); | ||
214 | } | ||
215 | else if(sel) | 202 | else if(sel) |
216 | fprintf(stdout, "%s", sel->text); | 203 | fprintf(stdout, "%s", sel->text); |
217 | else if(text) | 204 | else if(text) |