From: Gurusamy Sarathy Date: Fri, 21 May 1999 23:36:49 +0000 (+0000) Subject: s/isspace/isSPACE/g and make sure the CRT version is always X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=de030af3419d6a4e465a5bde7cc2bada20a15fe8;p=p5sagit%2Fp5-mst-13.2.git s/isspace/isSPACE/g and make sure the CRT version is always passed an unsigned char (fixes random occurrence of spaces in arguments containing high-bit chars passed to spawned children, on win32) p4raw-id: //depot/perl@3445 --- diff --git a/ext/SDBM_File/sdbm/dbe.c b/ext/SDBM_File/sdbm/dbe.c index b6bc8de..9f44180 100644 --- a/ext/SDBM_File/sdbm/dbe.c +++ b/ext/SDBM_File/sdbm/dbe.c @@ -138,7 +138,7 @@ datum db; putchar('"'); for (i = 0; i < db.dsize; i++) { - if (isprint(db.dptr[i])) + if (isprint((unsigned char)db.dptr[i])) putchar(db.dptr[i]); else { putchar('\\'); @@ -174,7 +174,10 @@ char *s; *p = '\f'; else if (*s == 't') *p = '\t'; - else if (isdigit(*s) && isdigit(*(s + 1)) && isdigit(*(s + 2))) { + else if (isdigit((unsigned char)*s) + && isdigit((unsigned char)*(s + 1)) + && isdigit((unsigned char)*(s + 2))) + { i = (*s++ - '0') << 6; i |= (*s++ - '0') << 3; i |= *s - '0'; diff --git a/win32/perlhost.h b/win32/perlhost.h index e52ba6d..a645328 100644 --- a/win32/perlhost.h +++ b/win32/perlhost.h @@ -585,7 +585,7 @@ public: |FORMAT_MESSAGE_FROM_SYSTEM, NULL, dwErr, 0, (char *)&sMsg, 1, NULL); if (0 < dwLen) { - while (0 < dwLen && isspace(sMsg[--dwLen])) + while (0 < dwLen && isSPACE(sMsg[--dwLen])) ; if ('.' != sMsg[dwLen]) dwLen++; diff --git a/win32/win32.c b/win32/win32.c index 53048cb..f4c7006 100644 --- a/win32/win32.c +++ b/win32/win32.c @@ -568,11 +568,11 @@ do_spawn2(char *cmd, int exectype) strcpy(cmd2, cmd); a = argv; for (s = cmd2; *s;) { - while (*s && isspace(*s)) + while (*s && isSPACE(*s)) s++; if (*s) *(a++) = s; - while (*s && !isspace(*s)) + while (*s && !isSPACE(*s)) s++; if (*s) *s++ = '\0'; @@ -1708,7 +1708,7 @@ win32_str_os_error(void *sv, DWORD dwErr) |FORMAT_MESSAGE_FROM_SYSTEM, NULL, dwErr, 0, (char *)&sMsg, 1, NULL); if (0 < dwLen) { - while (0 < dwLen && isspace(sMsg[--dwLen])) + while (0 < dwLen && isSPACE(sMsg[--dwLen])) ; if ('.' != sMsg[dwLen]) dwLen++;