about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--parse.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/parse.c b/parse.c
index 33acd5b..6f1a56b 100644
--- a/parse.c
+++ b/parse.c
@@ -14,6 +14,7 @@
  * along with this program.  If not, see <https://www.gnu.org/licenses/>.
  */
 
+#include <ctype.h>
 #include <err.h>
 #include <stdio.h>
 #include <stdlib.h>
@@ -66,7 +67,16 @@ void parseEnvelope(struct Envelope *envelope, struct List list) {
 	}
 
 	const char *date = dataCheck(list.ptr[Date], String).string;
-	date = strptime(date, "%a, %e %b %Y %H:%M:%S %z", &envelope->date);
+	if (isalpha(date[0])) {
+		date = strptime(date, "%a, %e %b %Y %H:%M:%S ", &envelope->date);
+	} else {
+		date = strptime(date, "%e %b %Y %H:%M:%S ", &envelope->date);
+	}
+	if (date && (date[0] == '+' || date[0] == '-')) {
+		date = strptime(date, "%z", &envelope->date);
+	} else if (date) {
+		date = strptime(date, "%Z", &envelope->date);
+	}
 	if (!date) errx(EX_PROTOCOL, "invalid envelope date format");
 
 	envelope->date.tm_isdst = -1;
subject'>Fix comparison warning in ttpreJune McEnroe 2019-05-20Add AuthorityJune McEnroe 2019-05-19Specify precedence of unary versions of operatorsJune McEnroe 2019-05-18Add compound assignment operators to orderJune McEnroe 2019-05-15Support simple assignment in orderJune McEnroe 2019-05-15Implement sizeof in orderJune McEnroe 2019-05-15Add orderJune McEnroe 2019-05-12Add T suffix in bitJune McEnroe 2019-05-10Highlight yacc and lex files as CJune McEnroe Their %-prefixed directives should probably be highlighted Macro. 2019-05-10Use val instead of suboptargJune McEnroe suboptarg doesn't exist in GNU. Hopefully BSD getsubopt also sets val on failure? 2019-05-09Add Parable of the SowerJune McEnroe 2019-05-07Add bit without buildJune McEnroe Need to do some stuff in the Makefile for lex and yacc and generating HTML pages for it. 2019-05-04Fix MANDIR typoJune McEnroe 2019-05-04Move relay to binJune McEnroe