This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
s/isspace/isSPACE/g and make sure the CRT version is always
authorGurusamy Sarathy <gsar@cpan.org>
Fri, 21 May 1999 23:36:49 +0000 (23:36 +0000)
committerGurusamy Sarathy <gsar@cpan.org>
Fri, 21 May 1999 23:36:49 +0000 (23:36 +0000)
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

ext/SDBM_File/sdbm/dbe.c
win32/perlhost.h
win32/win32.c

index b6bc8de..9f44180 100644 (file)
@@ -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';
index e52ba6d..a645328 100644 (file)
@@ -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++;
index 53048cb..f4c7006 100644 (file)
@@ -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++;