]> code.citadel.org Git - citadel.git/blobdiff - citadel/support.c
Changed all of the proprietary strucmp() and struncmp() calls to the more
[citadel.git] / citadel / support.c
index 896797617c43b0f8c832621718d6d6cc627ea7f9..e9723bf00802e68684efbb6d5c313312737b583c 100644 (file)
@@ -7,25 +7,6 @@
 #include "server.h"
 #include "proto.h"
 
-/*
- * struncmp()  -  case-insensitive version of strncmp()
- *                citadel.h will #define a strucmp() based on this
- */
-int struncmp(char *lstr, char *rstr, int len)
-{
-       int pos = 0;
-       char lc,rc;
-       while (pos<len) {
-               lc=tolower(lstr[pos]);
-               rc=tolower(rstr[pos]);
-               if ((lc==0)&&(rc==0)) return(0);
-               if (lc<rc) return(-1);
-               if (lc>rc) return(1);
-               pos=pos+1;
-               }
-       return(0);
-       }
-
 
 /*
  * strproc()  -  make a string 'nice'
@@ -175,7 +156,7 @@ int pattern2(char *search, char *patn)
 {
        int a;
        for (a=0; a<strlen(search); ++a) {
-               if (!struncmp(&search[a],patn,strlen(patn))) return(a);
+               if (!strncasecmp(&search[a],patn,strlen(patn))) return(a);
                }
        return(-1);
        }
@@ -197,7 +178,7 @@ void mesg_locate(char *targ, char *searchfor, int numdirs, char **dirs)
                        while(fgets(buf,255,ls)!=NULL) {
                                while (isspace(buf[strlen(buf)-1]))
                                        buf[strlen(buf)-1] = 0;
-                               if (!strucmp(buf,searchfor)) {
+                               if (!strcasecmp(buf,searchfor)) {
                                        pclose(ls);
                                        sprintf(targ,"%s/%s",dirs[a],buf);
                                        return;