summaryrefslogtreecommitdiff
path: root/src/util.c
diff options
context:
space:
mode:
authorportix <portix@gmx.net>2011-09-02 16:05:42 +0200
committerportix <portix@gmx.net>2011-09-02 16:05:42 +0200
commiteae3f17167c9b934882fac86fc4889b67bb41be7 (patch)
tree21955ee8e5106325a2f83e2ca277f12e925c06a5 /src/util.c
parent139402ebac6de3227439be4525b58fa396224ef5 (diff)
downloaddwb-eae3f17167c9b934882fac86fc4889b67bb41be7.zip
Return whole string if needle is empty in dwb_util_strcasestr
Diffstat (limited to 'src/util.c')
-rw-r--r--src/util.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/util.c b/src/util.c
index ecadd19d..a89d54ae 100644
--- a/src/util.c
+++ b/src/util.c
@@ -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;