summaryrefslogtreecommitdiffstats
path: root/src/util.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/util.c')
-rw-r--r--src/util.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/util.c b/src/util.c
index 653b5f3..7231ed2 100644
--- a/src/util.c
+++ b/src/util.c
@@ -1,4 +1,5 @@
#define _XOPEN_SOURCE 600
+#define _GNU_SOURCE
#include "util.h"
#include "tui.h"
@@ -40,6 +41,21 @@ done:
return width;
}
+const wchar_t *
+wcscasestr(const wchar_t *haystack, const wchar_t *needle)
+{
+ int hslen, nlen, i;
+
+ nlen = wcslen(needle);
+ hslen = wcslen(haystack) - nlen;
+ for (i = 0; i < hslen; i++) {
+ if (!wcsncasecmp(haystack + i, needle, nlen))
+ return haystack + i;
+ }
+
+ return NULL;
+}
+
void
panic(const char *file, int line, const char *msg, ...)
{