fix missing stripostfix, and add stricmp (although one should use strcasecmp).

This commit is contained in:
Vítor Manuel de Morais Santos Costa
2009-11-23 13:41:07 +00:00
parent 56d9666197
commit 86715801bf
9 changed files with 2381 additions and 11045 deletions

View File

@@ -0,0 +1,25 @@
#include "pl-incl.h"
#include "pl-ctype.h"
#ifndef HAVE_STRICMP
int
stricmp(const char *s1, const char *s2)
{ while(*s1 && makeLower(*s1) == makeLower(*s2))
s1++, s2++;
return makeLower(*s1) - makeLower(*s2);
}
#endif
bool
stripostfix(char *s, char *e)
{ int ls = strlen(s);
int le = strlen(e);
if ( ls >= le )
return stricmp(&s[ls-le], e) == 0;
return FALSE;
}