summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--Src/Zle/zle_refresh.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Src/Zle/zle_refresh.c b/Src/Zle/zle_refresh.c
index a1a2ebb8d..fb2e1240d 100644
--- a/Src/Zle/zle_refresh.c
+++ b/Src/Zle/zle_refresh.c
@@ -1493,7 +1493,7 @@ singlerefresh(ZLE_STRING_T tmpline, int tmpll, int tmpcs)
     /* Reset shift state, maybe. */
     memset(&mbs, '\0', sizeof mbs);
     for (lpptr = lpromptbuf; lpptr < lpend; ) {
-	size_t cnt = mbrtowc(lpwp, lpptr, lpend - lpptr, &mbs);
+	size_t cnt = eol ? MB_INVALID : mbrtowc(lpwp, lpptr, lpend-lpptr, &mbs);
 	switch (cnt) {
 	case MB_INCOMPLETE:
 	    eol = 1;