uriel didn't understood dmenu code, he broke nearly everything
e0fe9f2f
1 file(s) · +13 −2
| 120 | 120 | nitem = 0; |
|
| 121 | 121 | ||
| 122 | 122 | for(i = allitems; i; i=i->next) |
|
| 123 | - | if(plen ? !strncmp(pattern, i->text, plen) : |
|
| 124 | - | strncmp(pattern, i->text, plen) && strstr(i->text, pattern)) { |
|
| 123 | + | if(!plen || !strncmp(pattern, i->text, plen)) { |
|
| 124 | + | if(!j) |
|
| 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)) { |
|
| 125 | 136 | if(!j) |
|
| 126 | 137 | item = i; |
|
| 127 | 138 | else |