Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

PATCH: pws-24: unsigned character problems



(This is also in another mail queue so could in theory arrive twice.)

The first of these hunks fixes the problem I was having on SunOS 4.1.3_U1
with gcc 2.7.0: itok(c) wasn't working where c was a char, even though itok
is defined with a STOUC() in it.  Changing c to be an int worked.

Coincidentally, I'd already fixed an error message about unsigned chars
from the test I added for spaces in option strings, which is the second
hunk.

--- Src/exec.c.uc	Fri Jun 25 14:30:20 1999
+++ Src/exec.c	Sat Jun 26 17:17:22 1999
@@ -1131,7 +1131,8 @@
 untokenize(char *s)
 {
     if (*s) {
-	char *p = s, c;
+	char *p = s;
+	int c;
 
 	while ((c = *s++))
 	    if (itok(c)) {
--- Src/init.c.uc	Fri Jun 25 14:29:52 1999
+++ Src/init.c	Sat Jun 26 15:58:22 1999
@@ -235,10 +235,10 @@
 		else
 		    dosetopt(optno, action, 1);
               break;
-	    } else if (isspace(**argv)) {
+	    } else if (isspace(STOUC(**argv))) {
 		/* zsh's typtab not yet set, have to use ctype */
 		while (*++*argv)
-		    if (!isspace(**argv)) {
+		    if (!isspace(STOUC(**argv))) {
 			zerr("bad option string: `%s'", args, 0);
 			exit(1);
 		    }

-- 
Peter Stephenson <pws@xxxxxxxxxxxxxxxxx>       Tel: +39 050 844536
WWW:  http://www.ifh.de/~pws/
Dipartimento di Fisica, Via Buonarroti 2, 56127 Pisa, Italy



Messages sorted by: Reverse Date, Date, Thread, Author