From 533021f2ad7c7d136adbf216c8c95aaab8ee7098 Mon Sep 17 00:00:00 2001 From: Bart Schaefer Date: Sun, 23 Oct 2005 19:28:20 +0000 Subject: Fix --disable-multibyte compile error. --- ChangeLog | 7 ++++++- Src/prompt.c | 8 +++++--- 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 + + * unposted: Src/prompt.c: fix --disable-multibyte compile error + introduced by 21906. + 2005-10-23 Peter Stephenson * 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 +2005-10-17 Bart Schaefer * 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) { -- cgit 1.4.1