summary refs log tree commit diff
path: root/handle.c
diff options
context:
space:
mode:
authorpsykose <alice@ayaya.dev>2021-10-26 10:14:17 +0200
committerJune McEnroe <june@causal.agency>2021-10-26 12:27:54 -0400
commit27b5fd0251276fce156ef066f11086cfba941804 (patch)
treef02b79c7952d5ed0a196cef0597113077bb29554 /handle.c
parentIncrement replies for list modes with /mode (diff)
downloadcatgirl-27b5fd0251276fce156ef066f11086cfba941804.tar.gz
catgirl-27b5fd0251276fce156ef066f11086cfba941804.zip
Fix strptime decode for musl libc
POSIX does not define a %F for strptime[1], but does define %F for
strftime[2]. Afaik most libc's implement %F for both, but musl is very
standards-compliant and does not have %F on strptime, leading to
unparsed message tag times, which causes all backlog sent from bouncer
on startup to have a timestamp of the current time, instead of the
actual timestamp sent.

[1] https://pubs.opengroup.org/onlinepubs/9699919799/functions/strptime.html
[2] https://pubs.opengroup.org/onlinepubs/9699919799/functions/strftime.html
Diffstat (limited to '')
-rw-r--r--handle.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/handle.c b/handle.c
index 7b9835f..61b645d 100644
--- a/handle.c
+++ b/handle.c
@@ -91,7 +91,7 @@ static const time_t *tagTime(const struct Message *msg) {
 	static time_t time;
 	struct tm tm;
 	if (!msg->tags[TagTime]) return NULL;
-	if (!strptime(msg->tags[TagTime], "%FT%T", &tm)) return NULL;
+	if (!strptime(msg->tags[TagTime], "%Y-%m-%dT%T", &tm)) return NULL;
 	time = timegm(&tm);
 	return &time;
 }
logsubject'>Revert "Add first working version of imbox"June McEnroe Moved to <https://git.causal.agency/imbox>. This reverts commit 7ff5f3fd826e313ce8353a532bdfa4989dc946dc. 2019-12-21Add first working version of imboxJune McEnroe 2019-12-20Respect mailmap in gl pretty formatJune McEnroe 2019-12-20Set LANG in cgit filtersJune McEnroe ttpre needs to know about UTF-8 too so it can bold/italic non-ASCII chars. 2019-12-20Source .editrc before applying -v or -eJune McEnroe Otherwise a bind -v in .editrc will take precedence and overwrite the ^I binding for sh-complete. 2019-12-20Disable signing commitsJune McEnroe Why did I ever turn this on? This gets me nothing but inconvenience. RIP to all the wasted bytes in my git repos. 2019-12-19Ignore about-filterJune McEnroe 2019-12-19Fix matching make tags with no sourcesJune McEnroe 2019-12-19Avoid matching := assignments as tagsJune McEnroe 2019-12-18Hide line numbers when rendering mdocJune McEnroe Hack: output an extra <td> after rendering mdoc so that line numbers can be hidden based on there being three. This required splitting source-filter and about-filter since on about pages there is no table. 2019-12-18Customize cgit CSSJune McEnroe 2019-12-18Use :target rather than :focus pseudo-classJune McEnroe :target persists after you click on something else. 2019-12-18Copy cgit auxiliary binaries properlyJune McEnroe 2019-12-18Add git.causal.agency cgit configJune McEnroe 2019-12-18Bail from hi if input is binaryJune McEnroe NULs in the input cause an infinite loop in htmlEscape, not to mention regexes obviously not working, etc. 2019-12-16Post "cgit setup"June McEnroe