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

Re: PATCH: minor zle_utils fix



And these:

> We probably also need to metafy the line.  The only call to zlegetline()
[...]
> Same here in the alternative branch: we need to duplicate the first
> zlell characters and metafy.  This is the same as the

M  Src/Zle/zle_utils.c

* modified files

--- orig/Src/Zle/zle_utils.c
+++ mod/Src/Zle/zle_utils.c
@@ -72,14 +72,11 @@
 
 /*
  * Insert a character, called from main shell.
- *
- * WCHAR: type is wrong, should be a genuine wide character,
- * when available in the caller.
  */
 
 /**/
 mod_export void
-zleaddtoline(int chr)
+zleaddtoline(ZLE_CHAR_T chr)
 {
     spaceinline(1);
     zleline[zlecs++] = chr;
@@ -109,15 +106,13 @@
     }
 
     *ll = mb_len;
-
-    return (unsigned char *)s;
 #else
     *ll = zlell;
     *cs = zlecs;
 
     s = ztrdup(zleline);
-    return (unsigned char *)s;
 #endif
+    return (unsigned char *) metafy((char *) s, zlell, META_REALLOC);
 }
 
 



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