* safe-ctype.c: New file.

* Makefile.in (CFILES): Add safe-ctype.c.
(REQUIRED_OFILES): Add safe-ctype.o.

* argv.c: Define ISBLANK and use it, not isspace.
* basename.c, cplus-dem.c, fnmatch.c, pexecute.c, strtod.c,
strtol.c, strtoul.c: Include safe-ctype.h, not ctype.h.  Use
uppercase ctype macros.  Don't test ISUPPER(c)/ISLOWER(c)
before calling TOLOWER(c)/TOUPPER(c).
This commit is contained in:
DJ Delorie
2000-12-08 16:37:01 +00:00
parent 39cd252546
commit ac424eb32c
11 changed files with 243 additions and 77 deletions

View File

@@ -25,10 +25,7 @@ Boston, MA 02111-1307, USA. */
#include "ansidecl.h"
#include "libiberty.h"
#ifdef isspace
#undef isspace
#endif
#define isspace(ch) ((ch) == ' ' || (ch) == '\t')
#define ISBLANK(ch) ((ch) == ' ' || (ch) == '\t')
/* Routines imported from standard C runtime libraries. */
@@ -227,7 +224,7 @@ char *input;
do
{
/* Pick off argv[argc] */
while (isspace (*input))
while (ISBLANK (*input))
{
input++;
}
@@ -260,7 +257,7 @@ char *input;
arg = copybuf;
while (*input != EOS)
{
if (isspace (*input) && !squote && !dquote && !bsquote)
if (ISBLANK (*input) && !squote && !dquote && !bsquote)
{
break;
}
@@ -326,7 +323,7 @@ char *input;
argc++;
argv[argc] = NULL;
while (isspace (*input))
while (ISBLANK (*input))
{
input++;
}