Added stricmp as replacement for compilers that didn't have it.
This commit is contained in:
@@ -35,8 +35,21 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include "indtext.h"
|
#include "indtext.h"
|
||||||
|
|
||||||
#if defined(__BORLANDC__) || defined(_MSC_VER)
|
#if !defined(__BORLANDC__) && !defined(_MSC_VER)
|
||||||
#define strcasecmp stricmp
|
#include <ctype.h>
|
||||||
|
int stricmp(const char *s1, const char *s2)
|
||||||
|
{
|
||||||
|
unsigned char c1,c2;
|
||||||
|
|
||||||
|
do {
|
||||||
|
c1 = *s1++;
|
||||||
|
c2 = *s2++;
|
||||||
|
c1 = (unsigned char) tolower( (unsigned char) c1);
|
||||||
|
c2 = (unsigned char) tolower( (unsigned char) c2);
|
||||||
|
} while((c1 == c2) && (c1 != '\0'));
|
||||||
|
|
||||||
|
return (int) c1-c2;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
bool indtext_by_string(
|
bool indtext_by_string(
|
||||||
@@ -75,7 +88,7 @@ bool indtext_by_istring(
|
|||||||
|
|
||||||
if (data_list && search_name) {
|
if (data_list && search_name) {
|
||||||
while (data_list->pString) {
|
while (data_list->pString) {
|
||||||
if (strcasecmp(data_list->pString, search_name) == 0) {
|
if (stricmp(data_list->pString, search_name) == 0) {
|
||||||
index = data_list->index;
|
index = data_list->index;
|
||||||
found = true;
|
found = true;
|
||||||
break;
|
break;
|
||||||
|
|||||||
Reference in New Issue
Block a user