all repos — fluxbox @ 2f82ecd85d70d022bedab2d0844198a14cb40f2d

custom fork of the fluxbox windowmanager

Added strcasestr
fluxgen fluxgen
commit

2f82ecd85d70d022bedab2d0844198a14cb40f2d

parent

e215fc40c9216a6a320b55a78d94854289bc7a72

2 files changed, 14 insertions(+), 0 deletions(-)

jump to
M src/StringUtil.ccsrc/StringUtil.cc

@@ -35,6 +35,19 @@ strncpy(n, s, l);

return n; } +//------- strcasestr -------------- +// TODO: comment this +//--------------------------------- +const char * StringUtil::strcasestr(const char *str, const char *ptn) { + const char *s2, *p2; + for( ; *str; str++) { + for(s2=str,p2=ptn; ; s2++,p2++) { + if (!*p2) return str; + if (toupper(*s2) != toupper(*p2)) break; + } + } + return 0; +} //------------- expandFilename ---------------------- // if ~ then expand it to home of user
M src/StringUtil.hhsrc/StringUtil.hh

@@ -24,6 +24,7 @@

struct StringUtil { static char *strdup(const char *); + static const char *strcasestr(const char *str, const char *ptn); static char *expandFilename(const char *filename); };