2013-08-16 10:30:20 +02:00
|
|
|
$NetBSD: patch-ab,v 1.5 2013/08/16 08:30:20 hannken Exp $
|
2002-03-23 00:01:52 +01:00
|
|
|
|
2013-08-16 10:30:20 +02:00
|
|
|
The ctype functions work on integers.
|
|
|
|
|
|
|
|
--- cmdparse.c.orig 2013-08-08 13:58:07.000000000 +0000
|
|
|
|
+++ cmdparse.c
|
|
|
|
@@ -203,7 +203,7 @@ CPS_NormalizeLine(char *line)
|
|
|
|
|
|
|
|
/* Remove white-space at beginning and replace white-spaces with space char */
|
|
|
|
for (p = q = line; *p; p++) {
|
|
|
|
- if (isspace(*p)) {
|
|
|
|
+ if (isspace((unsigned char)(*p))) {
|
|
|
|
if (!space)
|
|
|
|
*q++ = ' ';
|
|
|
|
space = 1;
|
|
|
|
@@ -233,15 +233,15 @@ CPS_SplitWord(char *line)
|
|
|
|
char *p = line, *q = line;
|
2002-03-23 00:01:52 +01:00
|
|
|
|
2013-08-16 10:30:20 +02:00
|
|
|
/* Skip white-space before the word */
|
|
|
|
- while (*q && isspace(*q))
|
|
|
|
+ while (*q && isspace((unsigned char)(*q)))
|
|
|
|
q++;
|
2002-03-23 00:01:52 +01:00
|
|
|
|
2013-08-16 10:30:20 +02:00
|
|
|
/* Move the word to the beginning */
|
|
|
|
- while (*q && !isspace(*q))
|
|
|
|
+ while (*q && !isspace((unsigned char)(*q)))
|
|
|
|
*p++ = *q++;
|
2002-03-23 00:01:52 +01:00
|
|
|
|
2013-08-16 10:30:20 +02:00
|
|
|
/* Find the next word */
|
|
|
|
- while (*q && isspace(*q))
|
|
|
|
+ while (*q && isspace((unsigned char)(*q)))
|
|
|
|
q++;
|
2002-03-23 00:01:52 +01:00
|
|
|
|
2013-08-16 10:30:20 +02:00
|
|
|
*p = '\0';
|