2013-09-26 17:14:40 +02:00

36 lines
886 B
Plaintext

$NetBSD: patch-ab,v 1.5 2004/08/27 10:10:22 tron Exp $
--- wmbiff/ShellClient.c.orig 2004-06-18 23:28:16.000000000 +0200
+++ wmbiff/ShellClient.c 2004-08-27 12:03:23.000000000 +0200
@@ -152,6 +152,21 @@
return (strdup_ordie(bigbuffer));
}
+static char *mystrcasestr(const char *big, const char *little)
+{
+ int blen, llen;
+
+ blen = strlen(big);
+ llen = strlen(little);
+ while (blen >= llen) {
+ if (strncasecmp(big, little, llen) == 0)
+ return (char *)big;
+ big++;
+ blen--;
+ }
+ return NULL;
+}
+
int shellCmdCheck(Pop3 pc)
{
int count_status = 0;
@@ -189,7 +204,7 @@
pc->UnreadMsgs = 0;
pc->TotalMsgs = count_status;
}
- } else if (strcasestr(commandOutput, "unable")) {
+ } else if (mystrcasestr(commandOutput, "unable") != NULL) {
return -1;
} else if (sscanf(commandOutput, "%9s\n", pc->TextStatus) == 1) {
/* validate the string input */