mirror of https://github.com/FDOS/kernel.git
Use strcaseequal instead of strcasecmp since we never care about order
anyway. git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@957 6ac86273-5f31-0410-b378-82cca8765d1b
This commit is contained in:
parent
195614981a
commit
c0f1c45d1f
|
@ -225,7 +225,7 @@ STATIC int SkipLine(char *pLine);
|
||||||
#if 0
|
#if 0
|
||||||
STATIC char * stristr(char *s1, char *s2);
|
STATIC char * stristr(char *s1, char *s2);
|
||||||
#endif
|
#endif
|
||||||
STATIC int strcasecmp(const char * d, const char * s);
|
STATIC char strcaseequal(const char * d, const char * s);
|
||||||
STATIC int LoadCountryInfoHardCoded(char *filename, COUNT ctryCode, COUNT codePage);
|
STATIC int LoadCountryInfoHardCoded(char *filename, COUNT ctryCode, COUNT codePage);
|
||||||
STATIC void umb_init(void);
|
STATIC void umb_init(void);
|
||||||
|
|
||||||
|
@ -665,9 +665,7 @@ VOID DoConfig(int nPass)
|
||||||
if (*pLine == '\n' || *pLine == EOF) /* end of line */
|
if (*pLine == '\n' || *pLine == EOF) /* end of line */
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (*pLine == '\r') /* ignore */
|
if (*pLine != '\r') /* ignore CR */
|
||||||
;
|
|
||||||
else
|
|
||||||
pLine++;
|
pLine++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -724,13 +722,8 @@ VOID DoConfig(int nPass)
|
||||||
|
|
||||||
STATIC struct table * LookUp(struct table *p, BYTE * token)
|
STATIC struct table * LookUp(struct table *p, BYTE * token)
|
||||||
{
|
{
|
||||||
while (*(p->entry) != '\0')
|
while (p->entry[0] != '\0' && !strcaseequal(p->entry, token))
|
||||||
{
|
++p;
|
||||||
if (strcasecmp(p->entry, token) == 0)
|
|
||||||
break;
|
|
||||||
else
|
|
||||||
++p;
|
|
||||||
}
|
|
||||||
return p;
|
return p;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1293,7 +1286,7 @@ STATIC VOID CfgBreak(BYTE * pLine)
|
||||||
{
|
{
|
||||||
/* Format: BREAK = (ON | OFF) */
|
/* Format: BREAK = (ON | OFF) */
|
||||||
GetStringArg(pLine, szBuf);
|
GetStringArg(pLine, szBuf);
|
||||||
break_ena = strcasecmp(szBuf, "OFF") ? 1 : 0;
|
break_ena = strcaseequal(szBuf, "OFF") ? 0 : 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
STATIC VOID Numlock(BYTE * pLine)
|
STATIC VOID Numlock(BYTE * pLine)
|
||||||
|
@ -1304,7 +1297,7 @@ STATIC VOID Numlock(BYTE * pLine)
|
||||||
GetStringArg(pLine, szBuf);
|
GetStringArg(pLine, szBuf);
|
||||||
|
|
||||||
*keyflags &= ~32;
|
*keyflags &= ~32;
|
||||||
*keyflags |= strcasecmp(szBuf, "OFF") ? 32 : 0;
|
if (!strcaseequal(szBuf, "OFF")) *keyflags |= 32;
|
||||||
keycheck();
|
keycheck();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1651,16 +1644,13 @@ char *strcat(register char * d, register const char * s)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* compare two ASCII strings ignoring case */
|
/* compare two ASCII strings ignoring case */
|
||||||
STATIC int strcasecmp(const char * d, const char * s)
|
STATIC char strcaseequal(const char * d, const char * s)
|
||||||
{
|
{
|
||||||
int ret;
|
char ch;
|
||||||
for (;; s++, d++)
|
while ((ch = toupper(*s++)) == toupper(*d++))
|
||||||
{
|
if (ch == '\0')
|
||||||
ret = toupper(*d) - toupper(*s);
|
return 1;
|
||||||
if (ret != 0 || *d == '\0')
|
return 0;
|
||||||
break;
|
|
||||||
}
|
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Reference in New Issue