From 325c9a1de59501ce8412cc8b32913cac30c2ed75 Mon Sep 17 00:00:00 2001 From: Wayne Davison Date: Fri, 13 Jan 2006 09:25:09 +0000 Subject: Metafy the output of the ztrftime() string since that's what the prompt expects and some date names might not be ASCII. --- Src/prompt.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/Src/prompt.c b/Src/prompt.c index cf0e75adb..81ed47a30 100644 --- a/Src/prompt.c +++ b/Src/prompt.c @@ -543,7 +543,18 @@ putpromptchar(int doprint, int endchar) if (ztrftime(bp, t0, tmfmt, tm) >= 0) break; } - bp += strlen(bp); + /* Check if there are any chars to metafy while + * advancing bp to the end of the string. */ + for (ss = bp, t0 = 0; *bp; bp++ ) { + if (imeta(*bp)) + t0++; /* count of Meta chars needed */ + } + if (t0) { + j = bp - ss; /* unmetafied string length */ + addbufspc(t0); + metafy(bp - j, j, META_NOALLOC); + bp += t0; + } free(tmbuf); tmbuf = NULL; break; -- cgit 1.4.1