mirror of https://github.com/FDOS/kernel.git
Misc small cleanups.
git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@824 6ac86273-5f31-0410-b378-82cca8765d1b
This commit is contained in:
parent
416e1014cf
commit
9c14e2f86d
|
@ -1526,9 +1526,14 @@ STATIC void FAR * AlignParagraph(VOID FAR * lpPtr)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
STATIC int iswh(unsigned char c)
|
||||||
|
{
|
||||||
|
return (c == '\r' || c == '\n' || c == '\t' || c == ' ');
|
||||||
|
}
|
||||||
|
|
||||||
STATIC BYTE * skipwh(BYTE * s)
|
STATIC BYTE * skipwh(BYTE * s)
|
||||||
{
|
{
|
||||||
while (*s && (*s == 0x0d || *s == 0x0a || *s == ' ' || *s == '\t'))
|
while (iswh(*s))
|
||||||
++s;
|
++s;
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
@ -1572,33 +1577,18 @@ STATIC BYTE * scan(BYTE * s, BYTE * d)
|
||||||
*d++ = *s++;
|
*d++ = *s++;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
while (*s &&
|
while (*s && !iswh(*s) && *s != '=')
|
||||||
!(*s == 0x0d
|
|
||||||
|| *s == 0x0a || *s == ' ' || *s == '\t' || *s == '='))
|
|
||||||
{
|
{
|
||||||
if (*s == '?')
|
if (*s == '?')
|
||||||
{
|
|
||||||
askThisSingleCommand = TRUE;
|
askThisSingleCommand = TRUE;
|
||||||
s++;
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
*d++ = *s++;
|
*d++ = *s;
|
||||||
|
s++;
|
||||||
}
|
}
|
||||||
*d = '\0';
|
*d = '\0';
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if 0
|
|
||||||
BYTE *scan_seperator(BYTE * s, BYTE * d)
|
|
||||||
{
|
|
||||||
s = skipwh(s);
|
|
||||||
if (*s)
|
|
||||||
*d++ = *s++;
|
|
||||||
*d = '\0';
|
|
||||||
return s;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
STATIC BOOL isnum(char ch)
|
STATIC BOOL isnum(char ch)
|
||||||
{
|
{
|
||||||
return (ch >= '0' && ch <= '9');
|
return (ch >= '0' && ch <= '9');
|
||||||
|
@ -1643,17 +1633,6 @@ STATIC char * GetNumber(REG const char *p, int *num)
|
||||||
return (char *)p;
|
return (char *)p;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Yet another change for true portability (WDL) */
|
|
||||||
#if 0
|
|
||||||
STATIC COUNT tolower(COUNT c)
|
|
||||||
{
|
|
||||||
if (c >= 'A' && c <= 'Z')
|
|
||||||
return (c + ('a' - 'A'));
|
|
||||||
else
|
|
||||||
return c;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Yet another change for true portability (PJV) */
|
/* Yet another change for true portability (PJV) */
|
||||||
STATIC COUNT toupper(COUNT c)
|
STATIC COUNT toupper(COUNT c)
|
||||||
{
|
{
|
||||||
|
@ -1706,27 +1685,6 @@ char *strcat(register char * d, register const char * s)
|
||||||
return d;
|
return d;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if 0
|
|
||||||
/* see if the second string is contained in the first one, ignoring case */
|
|
||||||
STATIC char * stristr(char *s1, char *s2)
|
|
||||||
{
|
|
||||||
int loop;
|
|
||||||
|
|
||||||
for (; *s1; s1++)
|
|
||||||
for (loop = 0;; loop++)
|
|
||||||
{
|
|
||||||
if (s2[loop] == 0) /* found end of string 2 -> success */
|
|
||||||
{
|
|
||||||
return s1; /* position where s2 was found */
|
|
||||||
}
|
|
||||||
if (toupper(s1[loop]) != toupper(s2[loop]))
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* compare two ASCII strings ignoring case */
|
/* compare two ASCII strings ignoring case */
|
||||||
STATIC COUNT strcasecmp(REG BYTE * d, REG BYTE * s)
|
STATIC COUNT strcasecmp(REG BYTE * d, REG BYTE * s)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue