diff options
author | portix <portix@gmx.net> | 2011-09-02 16:05:42 +0200 |
---|---|---|
committer | portix <portix@gmx.net> | 2011-09-02 16:05:42 +0200 |
commit | eae3f17167c9b934882fac86fc4889b67bb41be7 (patch) | |
tree | 21955ee8e5106325a2f83e2ca277f12e925c06a5 /src/util.c | |
parent | 139402ebac6de3227439be4525b58fa396224ef5 (diff) | |
download | dwb-eae3f17167c9b934882fac86fc4889b67bb41be7.zip |
Return whole string if needle is empty in dwb_util_strcasestr
Diffstat (limited to 'src/util.c')
-rw-r--r-- | src/util.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -517,6 +517,8 @@ gtk_box_insert(GtkBox *box, GtkWidget *child, gboolean expand, gboolean fill, gi } char * dwb_util_strcasestr(const char *haystack, const char *needle) { + if (! *needle ) + return (char *) haystack; for (; *haystack; haystack++) { if (tolower(*haystack) == tolower(*needle)) { const char *h = haystack, *n = needle; |