summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog7
-rw-r--r--Src/prompt.c8
2 files changed, 11 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 61250d727..39e733613 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2005-10-23  Bart Schaefer  <schaefer@zsh.org>
+
+	* unposted: Src/prompt.c: fix --disable-multibyte compile error
+	introduced by 21906.
+
 2005-10-23  Peter Stephenson  <p.w.stephenson@ntlworld.com>
 
 	* unposted, yet, owing to email outage, but c.f. 21907:
@@ -57,7 +62,7 @@
 	* 21882: Src/prompt.c, Src/utils.c, Test/D01prompt.ztst: extend
 	prompt truncation to handle multibyte characters.
 
-2005-10-17  Bart Schaefer  <schaefer@brasslantern.com>
+2005-10-17  Bart Schaefer  <schaefer@zsh.org>
 
 	* 21880: Completion/compinit: explicitly set IFS to the usual
 	default string, plus carriage return, in case the surrounding
diff --git a/Src/prompt.c b/Src/prompt.c
index fd04cc2d7..008d3a39d 100644
--- a/Src/prompt.c
+++ b/Src/prompt.c
@@ -1076,7 +1076,10 @@ prompttrunc(int arg, int truncchar, int doprint, int endchar)
 		     */
 		    char *fulltextptr, *fulltext;
 		    int remw;
+#ifdef ZLE_UNICODE_SUPPORT
 		    mbstate_t mbs;
+		    memset(&mbs, 0, sizeof(mbstate_t));
+#endif
 
 		    fulltextptr = fulltext = ptr + ntrunc;
 		    memmove(fulltext, ptr, fullen);
@@ -1086,8 +1089,6 @@ prompttrunc(int arg, int truncchar, int doprint, int endchar)
 		    while (*t)
 			*ptr++ = *t++;
 
-		    memset(&mbs, 0, sizeof(mbstate_t));
-
 		    /*
 		     * Find the point in the text at which we should
 		     * start copying, i.e. when the remaining width
@@ -1169,9 +1170,10 @@ prompttrunc(int arg, int truncchar, int doprint, int endchar)
 		     * maximum width.
 		     */
 		    char *skiptext = ptr;
+#ifdef ZLE_UNICODE_SUPPORT
 		    mbstate_t mbs;
-
 		    memset(&mbs, 0, sizeof(mbstate_t));
+#endif
 
 		    while (maxwidth > 0 && *skiptext) {
 			if (*skiptext == Inpar) {