diff options
Diffstat (limited to 'Src/prompt.c')
-rw-r--r-- | Src/prompt.c | 8 |
1 files changed, 5 insertions, 3 deletions
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) { |