MIT/X Consortium License
© 2006-2008 Anselm R. Garbe <garbeam at gmail dot com>
-© 2006-2007 Sander van Dijk <a dot h dot vandijk at gmail dot com>
+© 2006-2008 Sander van Dijk <a dot h dot vandijk at gmail dot com>
© 2006-2007 Michał Janeczek <janeczek at gmail dot com>
Permission is hereby granted, free of charge, to any person obtaining a
Item *next; /* traverses all items */
Item *left, *right; /* traverses items matching current search pattern */
char *text;
- Bool matched;
};
/* forward declarations */
Item *prev = NULL;
Item *curr = NULL;
Window root, win;
+int (*fstrncmp)(const char *, const char *, size_t n) = strncmp;
char *(*fstrstr)(const char *, const char *) = strstr;
Item *
item = i;
else
last->right = i;
- i->matched = True;
i->left = last;
i->right = NULL;
last = i;
plen = strlen(pattern);
item = j = NULL;
nitem = 0;
- for(i = allitems; i; i=i->next)
- i->matched = False;
for(i = allitems; i; i = i->next)
- if(!i->matched && !strncasecmp(pattern, i->text, plen))
+ if(!fstrncmp(pattern, i->text, plen))
j = appenditem(i, j);
- for(i = allitems; i; i = i->next)
- if(!i->matched && fstrstr(i->text, pattern))
+ else if(fstrstr(i->text, pattern))
j = appenditem(i, j);
curr = prev = next = sel = item;
calcoffsets();
/* command line args */
for(i = 1; i < argc; i++)
- if(!strcmp(argv[i], "-i"))
+ if(!strcmp(argv[i], "-i")) {
+ fstrncmp = strncasecmp;
fstrstr = cistrstr;
+ }
else if(!strcmp(argv[i], "-fn")) {
if(++i < argc) font = argv[i];
}