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

Re: Crash in latest CVS



On Saturday 26 February 2005 06:26, Vin Shelton wrote:
> In the latest CVS sources, the following sequence will crash the
> shell:
>
> ls /usr/local/bin/<TAB>
> zsh: do you wish to see all 522 possibilities (261 lines)? n
>
> Now it doesn't matter what I answer; zsh goes away.  Apparently, no
> core file is produced.  It also appears that yesterday's build did not
> crash.
>

fixed in attached patch. colour gcc really makes wonder :)

-andrey
Index: Src/Zle/zle_utils.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/Zle/zle_utils.c,v
retrieving revision 1.23
diff -u -p -r1.23 zle_utils.c
--- Src/Zle/zle_utils.c	25 Feb 2005 15:10:01 -0000	1.23
+++ Src/Zle/zle_utils.c	26 Feb 2005 07:32:40 -0000
@@ -578,10 +578,10 @@ getzlequery(int yesno)
     if (yesno) {
 	if (c == ZWC('\t'))
 	    c = ZWC('y');
-	else if (ZS_icntrl(c) || c == ZLEEOF)
+	else if (ZC_icntrl(c) || c == ZLEEOF)
 	    c = ZWC('n');
 	else
-	    c = ZS_tolower(c);
+	    c = ZC_tolower(c);
     }
     /* echo response and return */
     if (c != ZWC('\n'))
Index: Src/Zle/zle_vi.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/Zle/zle_vi.c,v
retrieving revision 1.8
diff -u -p -r1.8 zle_vi.c
--- Src/Zle/zle_vi.c	25 Feb 2005 15:10:01 -0000	1.8
+++ Src/Zle/zle_vi.c	26 Feb 2005 07:32:40 -0000
@@ -571,9 +571,9 @@ vioperswapcase(UNUSED(char **args))
 	/* swap the case of all letters within range */
 	while (zlecs < c2) {
 	    if (islower(zleline[zlecs]))
-		zleline[zlecs] = ZS_toupper(zleline[zlecs]);
+		zleline[zlecs] = ZC_toupper(zleline[zlecs]);
 	    else if (isupper(zleline[zlecs]))
-		zleline[zlecs] = ZS_tolower(zleline[zlecs]);
+		zleline[zlecs] = ZC_tolower(zleline[zlecs]);
 	    zlecs++;
 	}
 	/* go back to the first line of the range */
@@ -811,9 +811,9 @@ viswapcase(UNUSED(char **args))
     eol = findeol();
     while (zlecs < eol && n--) {
 	if (islower(zleline[zlecs]))
-	    zleline[zlecs] = ZS_toupper(zleline[zlecs]);
+	    zleline[zlecs] = ZC_toupper(zleline[zlecs]);
 	else if (isupper(zleline[zlecs]))
-	    zleline[zlecs] = ZS_tolower(zleline[zlecs]);
+	    zleline[zlecs] = ZC_tolower(zleline[zlecs]);
 	zlecs++;
     }
     if (zlecs && zlecs == eol)
@@ -858,7 +858,8 @@ visetbuffer(UNUSED(char **args))
 	zmod.flags |= MOD_VIAPP;
     else
 	zmod.flags &= ~MOD_VIAPP;
-    zmod.vibuf = ZS_tolower(ch);
+    /* FIXME how portable is it for multibyte encoding? */
+    zmod.vibuf = ZC_tolower(ch);
     if (ch >= ZWC('1') && ch <= ZWC('9'))
 	zmod.vibuf += - (int)ZWC('1') + 26;
     else
Index: Src/Zle/zle_word.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/Zle/zle_word.c,v
retrieving revision 1.4
diff -u -p -r1.4 zle_word.c
--- Src/Zle/zle_word.c	25 Feb 2005 15:10:01 -0000	1.4
+++ Src/Zle/zle_word.c	26 Feb 2005 07:32:40 -0000
@@ -359,7 +359,7 @@ upcaseword(UNUSED(char **args))
 	while (zlecs != zlell && !iword(zleline[zlecs]))
 	    zlecs++;
 	while (zlecs != zlell && iword(zleline[zlecs])) {
-	    zleline[zlecs] = ZS_toupper(zleline[zlecs]);
+	    zleline[zlecs] = ZC_toupper(zleline[zlecs]);
 	    zlecs++;
 	}
     }
@@ -381,7 +381,7 @@ downcaseword(UNUSED(char **args))
 	while (zlecs != zlell && !iword(zleline[zlecs]))
 	    zlecs++;
 	while (zlecs != zlell && iword(zleline[zlecs])) {
-	    zleline[zlecs] = ZS_tolower(zleline[zlecs]);
+	    zleline[zlecs] = ZC_tolower(zleline[zlecs]);
 	    zlecs++;
 	}
     }
@@ -406,8 +406,8 @@ capitalizeword(UNUSED(char **args))
 	while (zlecs != zlell && iword(zleline[zlecs]) && !isalpha(zleline[zlecs]))
 	    zlecs++;
 	while (zlecs != zlell && iword(zleline[zlecs])) {
-	    zleline[zlecs] = (first) ? ZS_toupper(zleline[zlecs]) :
-		ZS_tolower(zleline[zlecs]);
+	    zleline[zlecs] = (first) ? ZC_toupper(zleline[zlecs]) :
+		ZC_tolower(zleline[zlecs]);
 	    first = 0;
 	    zlecs++;
 	}


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