applied a change made by Uriel to dmenu (though I didn't applied everything) c9465859
arg@wmii.de · 2006-09-26 08:43 1 file(s) · +4 −17
main.c +4 −17
120 120
	nitem = 0;
121 121
122 122
	for(i = allitems; i; i=i->next)
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)) {
123 +
		if(plen ? !strncmp(pattern, i->text, plen) :
124 +
				strncmp(pattern, i->text, plen) && strstr(i->text, pattern)) {
136 125
			if(!j)
137 126
				item = i;
138 127
			else
208 197
		}
209 198
		break;
210 199
	case XK_Return:
211 -
		if(e->state & ShiftMask) {
212 -
			if(text)
213 -
				fprintf(stdout, "%s", text);
214 -
		}
200 +
		if((e->state & ShiftMask) && text)
201 +
			fprintf(stdout, "%s", text);
215 202
		else if(sel)
216 203
			fprintf(stdout, "%s", sel->text);
217 204
		else if(text)