shithub: riscv

Download patch

ref: 002384634cb0ca367eebda0b4f9dc9a11a29b3f5
parent: 82435c350a1d3530c87ea88ada68e984fc6b9b80
author: Michael Forney <mforney@mforney.org>
date: Sat Oct 29 20:02:43 EDT 2022

upas/fs: support date format used in RFC 4155 mbox files

The RFC says that the message separator line consists of

> a timestamp indicating the UTC date and time when the message
> was originally received, conformant with the syntax of the
> traditional UNIX 'ctime' output sans timezone (note that the
> use of UTC precludes the need for a timezone indicator);

It also references http://qmail.org/man/man5/mbox.html as an
authoritative source, which says the date "always contains exactly 24
characters in asctime format".

Add this date format for compatibility with tools using the standard
mbox format, in particular git format-patch.

--- a/sys/src/cmd/upas/fs/strtotm.c
+++ b/sys/src/cmd/upas/fs/strtotm.c
@@ -6,6 +6,7 @@
 {
 	char **f, *fmt[] = {
 		"WW MMM DD hh:mm:ss ?Z YYYY",
+		"WW MMM DD hh:mm:ss YYYY",
 		"?WW ?DD ?MMM ?YYYY hh:mm:ss ?Z",
 		"?WW ?DD ?MMM ?YYYY hh:mm:ss",
 		"?WW, DD-?MM-YY",