From 3ac3bb55a99f03831492829d8135e83f567d59b9 Mon Sep 17 00:00:00 2001 From: H.G.Muller Date: Sat, 31 Dec 2016 20:37:53 +0100 Subject: [PATCH] Fix strcasestr for Windows The strcasestr definition, which we have to supply ourselves to make the Windows version compilable, was not upto the task of having a string constant as first argument, and a string that needs decapitalization as the second argument. --- UCI2WB.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/UCI2WB.c b/UCI2WB.c index 4d3a4df..ebcd79c 100644 --- a/UCI2WB.c +++ b/UCI2WB.c @@ -55,7 +55,7 @@ FILE *toE, *fromE, *fromF; int pid; #ifdef WIN32 -char *strcasestr (char *p, char *q) { char *r = p; while(*r) *r = tolower(*r), r++; return strstr(p, q); } +char *strcasestr (char *p, char *q) { while(*p) { char *r=p++, *s=q; while(tolower(*r++) == tolower(*s) && *s) s++; if(!*s) return p-1; } return NULL; } WinPipe(HANDLE *hRd, HANDLE *hWr) { -- 1.7.0.4