about summary refs log tree commit diff
path: root/Src/Zle/complist.c
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2005-02-24 15:32:36 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2005-02-24 15:32:36 +0000
commit691dd7e5294d232a7ab8327e2038f9779732fa3c (patch)
tree9d73edabb8e0c4c26a7cf60ceceb3cc23e74d8dd /Src/Zle/complist.c
parentc4a4c1340abeaedda251b90e99e4c9ae77880848 (diff)
downloadzsh-691dd7e5294d232a7ab8327e2038f9779732fa3c.tar.gz
zsh-691dd7e5294d232a7ab8327e2038f9779732fa3c.tar.xz
zsh-691dd7e5294d232a7ab8327e2038f9779732fa3c.zip
20861: Fix statusline in Unicode, apart from isearch
Diffstat (limited to 'Src/Zle/complist.c')
-rw-r--r--Src/Zle/complist.c49
1 files changed, 33 insertions, 16 deletions
diff --git a/Src/Zle/complist.c b/Src/Zle/complist.c
index a4e9dcbd9..51b160919 100644
--- a/Src/Zle/complist.c
+++ b/Src/Zle/complist.c
@@ -2115,8 +2115,8 @@ domenuselect(Hookdef dummy, Chdata dat)
         }
         first = 0;
         if (mode == MM_INTER) {
-            statusline = status;
-            statusll = strlen(status);
+	    statusline = stringaszleline((unsigned char *)status,
+					 &statusll, NULL);
         } else if (mode) {
             int l = sprintf(status, "%s%sisearch%s: ",
                             ((msearchstate & MS_FAILED) ? "failed " : ""),
@@ -2125,15 +2125,18 @@ domenuselect(Hookdef dummy, Chdata dat)
 
             strncat(status, msearchstr, MAX_STATUS - l - 1);
 
-            statusline = status;
-            statusll = strlen(status);
+            statusline = stringaszleline((unsigned char *)status,
+					 &statusll, NULL);
         } else {
             statusline = NULL;
             statusll = 0;
         }
         zrefresh();
-        statusline = NULL;
-        statusll = 0;
+	if (statusline) {
+	    free(statusline);
+	    statusline = NULL;
+	    statusll = 0;
+	}
         inselect = 1;
         if (noselect) {
             broken = 1;
@@ -2291,9 +2294,13 @@ domenuselect(Hookdef dummy, Chdata dat)
 	    if (nmatches < 1 || !minfo.cur || !*(minfo.cur)) {
 		nolist = 1;
                 if (mode == MM_INTER) {
-                    statusline = status;
-                    statusll = strlen(status);
-                }
+                    statusline = stringaszleline((unsigned char *)status,
+						 &statusll, NULL);
+                } else {
+		    /* paranoia */
+		    statusline = NULL;
+		    statusll = 0;
+		}
 		if (nmessages) {
 		    showinglist = -2;
 		    zrefresh();
@@ -2310,8 +2317,11 @@ domenuselect(Hookdef dummy, Chdata dat)
 		    zrefresh();
 		    showinglist = clearlist = 0;
 		}
-                statusline = NULL;
-                statusll = 0;
+		if (statusline) {
+		    free(statusline);
+		    statusline = NULL;
+		    statusll = 0;
+		}
 
 		goto getk;
 	    }
@@ -2425,12 +2435,19 @@ domenuselect(Hookdef dummy, Chdata dat)
 
             if (nolist) {
                 if (mode == MM_INTER) {
-                    statusline = status;
-                    statusll = strlen(status);
-                }
+                    statusline = stringaszleline((unsigned char *)status,
+						 &statusll, NULL);
+                } else {
+		    /* paranoia */
+		    statusline = NULL;
+		    statusll = 0;
+		}
                 zrefresh();
-                statusline = NULL;
-                statusll = 0;
+		if (statusline) {
+		    free(statusline);
+		    statusline = NULL;
+		    statusll = 0;
+		}
                 goto getk;
             }
             if (mode)