about summary refs log tree commit diff
path: root/Src
diff options
context:
space:
mode:
Diffstat (limited to 'Src')
-rw-r--r--Src/prompt.c4
-rw-r--r--Src/utils.c3
2 files changed, 5 insertions, 2 deletions
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);
diff --git a/Src/utils.c b/Src/utils.c
index 2e061e591..c0a96a5b4 100644
--- a/Src/utils.c
+++ b/Src/utils.c
@@ -1831,7 +1831,8 @@ ztrftime(char *buf, int bufsize, char *fmt, struct tm *tm)
 		 */
 		*buf = '\0';
 		tmp[1] = fmt[-1];
-		if (!strftime(buf, bufsize + 2, tmp, tm))
+		if (!strftime(buf, bufsize + 2, tmp, tm) &&
+		    tmp[1]!='p' && tmp[1]!='P')
 		    return 0;
 		decr = strlen(buf);
 		buf += decr;