From c98b9dc800171365eee34a3adbf5a741dbef69ca Mon Sep 17 00:00:00 2001 From: Clint Adams Date: Tue, 4 May 2004 04:17:26 +0000 Subject: * 19869: Src/prompt.c, Src/utils.c: avoid segfault when prompt-expanding '%D{%p}' or '%D{%P}' under locales with null strings for am_pm. --- Src/prompt.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'Src/prompt.c') diff --git a/Src/prompt.c b/Src/prompt.c index 5e80da172..e0304f298 100644 --- a/Src/prompt.c +++ b/Src/prompt.c @@ -528,7 +528,9 @@ putpromptchar(int doprint, int endchar) tm = localtime(&timet); for(t0=80; ; t0*=2) { addbufspc(t0); - if (ztrftime(bp, t0, tmfmt, tm)) + if (ztrftime(bp, t0, tmfmt, tm) || + !strcmp("%P", tmfmt) || + !strcmp("%p", tmfmt)) break; } bp += strlen(bp); -- cgit v1.2.3