diff options
author | fluxgen <fluxgen> | 2002-01-06 13:35:28 (GMT) |
---|---|---|
committer | fluxgen <fluxgen> | 2002-01-06 13:35:28 (GMT) |
commit | 2f82ecd85d70d022bedab2d0844198a14cb40f2d (patch) | |
tree | 7261b346cb843969546b593b1fb80f9cf569cc85 /src/StringUtil.cc | |
parent | e215fc40c9216a6a320b55a78d94854289bc7a72 (diff) | |
download | fluxbox-2f82ecd85d70d022bedab2d0844198a14cb40f2d.zip fluxbox-2f82ecd85d70d022bedab2d0844198a14cb40f2d.tar.bz2 |
Added strcasestr
Diffstat (limited to 'src/StringUtil.cc')
-rw-r--r-- | src/StringUtil.cc | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/StringUtil.cc b/src/StringUtil.cc index dabc02e..6d4a582 100644 --- a/src/StringUtil.cc +++ b/src/StringUtil.cc | |||
@@ -35,6 +35,19 @@ char *StringUtil::strdup(const char *s) { | |||
35 | return n; | 35 | return n; |
36 | } | 36 | } |
37 | 37 | ||
38 | //------- strcasestr -------------- | ||
39 | // TODO: comment this | ||
40 | //--------------------------------- | ||
41 | const char * StringUtil::strcasestr(const char *str, const char *ptn) { | ||
42 | const char *s2, *p2; | ||
43 | for( ; *str; str++) { | ||
44 | for(s2=str,p2=ptn; ; s2++,p2++) { | ||
45 | if (!*p2) return str; | ||
46 | if (toupper(*s2) != toupper(*p2)) break; | ||
47 | } | ||
48 | } | ||
49 | return 0; | ||
50 | } | ||
38 | 51 | ||
39 | //------------- expandFilename ---------------------- | 52 | //------------- expandFilename ---------------------- |
40 | // if ~ then expand it to home of user | 53 | // if ~ then expand it to home of user |