summary refs log tree commit diff
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2020-04-12 19:33:54 -0400
committerJune McEnroe <june@causal.agency>2020-04-12 19:33:54 -0400
commit0cffffbb9453d8026b2dbdb6a342bdf641cfa687 (patch)
tree0f0f9be31184efe6e650a19ca04534ac9936a816
parentMangle message IDs in paths (diff)
downloadbubger-0cffffbb9453d8026b2dbdb6a342bdf641cfa687.tar.gz
bubger-0cffffbb9453d8026b2dbdb6a342bdf641cfa687.zip
Allow missing DOW and obsolete zone in date
-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;
ighlight'> 2018-08-06Fix allocation size in vaswprintfJune McEnroe This is so embarrassing. It only started crashing once it had strings that were long enough, and then it took me so long to notice this mistake. I was worried I was still doing va_list wrong somehow. 2018-08-06Implement word wrappingJune McEnroe 2018-08-06Use wchar_t strings for all of UIJune McEnroe vaswprintf is a nightmare. 2018-08-06Rename line editing functionsJune McEnroe 2018-08-05Initialize all possible color pairsJune McEnroe This is actually possible with use_default_colors! 2018-08-05Refactor color initializationJune McEnroe 2018-08-05Add ^L redrawJune McEnroe 2018-08-05Use 16 colors if availableJune McEnroe Fall back to using bold if there are only 8 colors. This also allowed bright background colors in 16-color terminals. I must port this system to torus. I'll be able to remove the awful termcap patch hack. 2018-08-05Limit parsed colors to number of mIRC colorsJune McEnroe Oh boy that's embarrassing. 2018-08-04Show source link on exitJune McEnroe 2018-08-04Implement line editing, scrollingJune McEnroe Don't really have a way to implement the M-* keys, and currently missing C-w. 2018-08-04Handle /topicJune McEnroe