about summary refs log tree commit diff
path: root/Src/Zle/zle_misc.c
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2005-08-10 10:56:40 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2005-08-10 10:56:40 +0000
commit2a888b3d5ae1f485649b811ea433f286238fd308 (patch)
tree11f21c9ee2e716c8ab247c6d4ca834c6586ba101 /Src/Zle/zle_misc.c
parentef913283407fdc8166e5b937dcb08d1b4abde10d (diff)
downloadzsh-2a888b3d5ae1f485649b811ea433f286238fd308.tar.gz
zsh-2a888b3d5ae1f485649b811ea433f286238fd308.tar.xz
zsh-2a888b3d5ae1f485649b811ea433f286238fd308.zip
c.f. 21590: metafy_line()/unmetafy_line() now support wide characters
Diffstat (limited to 'Src/Zle/zle_misc.c')
-rw-r--r--Src/Zle/zle_misc.c23
1 files changed, 15 insertions, 8 deletions
diff --git a/Src/Zle/zle_misc.c b/Src/Zle/zle_misc.c
index 44bc611d5..9ade372b1 100644
--- a/Src/Zle/zle_misc.c
+++ b/Src/Zle/zle_misc.c
@@ -69,7 +69,7 @@ selfinsert(UNUSED(char **args))
     tmp = lastchar_wide;
     doinsert(&tmp, 1);
 #else
-    char s = lastchar;
+    unsigned char s = lastchar;
     doinsert(&s, 1);
 #endif
     return 0;
@@ -480,7 +480,8 @@ whatcursorposition(UNUSED(char **args))
 	     * convert a single character, remembering it may
 	     * turn into a multibyte string or be metafied.
 	     */
-	    mbstr = zlelineasstring(zleline+zlecs, 1, 0, &len, NULL, 1);
+	    mbstr = (char *)zlelineasstring(zleline+zlecs, 1, 0,
+					    &len, NULL, 1);
 	    strcpy(s, mbstr);
 	    s += len;
 	}
@@ -654,7 +655,7 @@ copyprevshellword(UNUSED(char **args))
 
     if (p) {
 	int len;
-	ZLE_STRING_T lineadd = stringaszleline(p, &len, NULL);
+	ZLE_STRING_T lineadd = stringaszleline(p, 0, &len, NULL, NULL);
 
 	spaceinline(len);
 	ZS_memcpy(zleline + zlecs, lineadd, len);
@@ -777,7 +778,7 @@ executenamedcommand(char *prmt)
     clearlist = 1;
     /* prmt may be constant */
     prmt = ztrdup(prmt);
-    zprmt = stringaszleline((unsigned char *)prmt, &l, NULL);
+    zprmt = stringaszleline((unsigned char *)prmt, 0, &l, NULL, NULL);
     cmdbuf = zhalloc((l + NAMLEN + 2) * ZLE_CHAR_SIZE);
     ZS_memcpy(cmdbuf, zprmt, l);
     free(zprmt);
@@ -860,7 +861,8 @@ executenamedcommand(char *prmt)
 		Thingy r;
 		unambiguous:
 		*ptr = 0;
-		namedcmdstr = zlelineasstring(cmdbuf, len, 0, NULL, NULL, 0);
+		namedcmdstr = (char *)zlelineasstring(cmdbuf, len, 0,
+						      NULL, NULL, 0);
 		r = rthingy(namedcmdstr);
 		free(namedcmdstr);
 		namedcmdstr = NULL;
@@ -890,7 +892,8 @@ executenamedcommand(char *prmt)
 
 		namedcmdll = newlinklist();
 
-		namedcmdstr = zlelineasstring(cmdbuf, len, 0, NULL, NULL, 0);
+		namedcmdstr = (char *)zlelineasstring(cmdbuf, len, 0,
+						      NULL, NULL, 0);
 		scanhashtable(thingytab, 1, 0, DISABLED, scancompcmd, 0);
 		free(namedcmdstr);
 		namedcmdstr = NULL;
@@ -912,7 +915,9 @@ executenamedcommand(char *prmt)
 		    zmult = zmultsav;
 		} else if (!nextnode(firstnode(namedcmdll))) {
 		    char *peekstr = ztrdup(peekfirst(namedcmdll));
-		    ZLE_STRING_T ztmp = stringaszleline(peekstr, &len, NULL);
+		    ZLE_STRING_T ztmp = 
+			stringaszleline((unsigned char *)peekstr, 0, &len,
+					NULL, NULL);
 		    zsfree(peekstr);
 		    ZS_memcpy(ptr = cmdbuf, ztmp, len);
 		    ptr += len;
@@ -922,7 +927,9 @@ executenamedcommand(char *prmt)
 		} else {
 		    int ltmp;
 		    char *peekstr = ztrdup(peekfirst(namedcmdll));
-		    ZLE_STRING_T ztmp = stringaszleline(peekstr, &ltmp, NULL);
+		    ZLE_STRING_T ztmp =
+			stringaszleline((unsigned char *)peekstr, 0, &ltmp,
+					NULL, NULL);
 		    zsfree(peekstr);
 		    ZS_memcpy(cmdbuf, ztmp, ltmp);
 		    free(ztmp);