diff options
| author | Bryce Kwon <bryce@brycekwon.com> | |
|---|---|---|
| committer | Bryce Kwon <bryce@brycekwon.com> | |
| commit | ||
| parent | ||
| tree | ||
| download | ||
Keep date-format=local-local from failing pages
The guard took local as a name that may carry the -local suffix, but
git reads local only as a whole alias of default-local and dies on
anything after it, so that one value turned every page into a 500.
Diffstat (limited to 'source/shared.c')
| -rw-r--r-- | source/shared.c | 9 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
1 file changed, 8 insertions, 1 deletion
diff --git a/source/shared.c b/source/shared.c index 6e69666..84ee4c8 100644 --- a/source/shared.c +++ b/source/shared.c @@ -507,7 +507,7 @@ void cgit_parse_date_format(const char *format, struct date_mode *mode) { static const char * const names[] = { "default", "human", "iso", "iso-strict", "iso8601", - "iso8601-strict", "local", "raw", "relative", "rfc", + "iso8601-strict", "raw", "relative", "rfc", "rfc2822", "short", "unix", }; const char *rest; @@ -520,6 +520,13 @@ void cgit_parse_date_format(const char *format, struct date_mode *mode) return; } + // git reads local only as a whole alias of default-local, and dies on + // it with a suffix of its own. + if (!strcmp(format, "local")) { + parse_date_format(format, mode); + return; + } + for (i = 0; i < ARRAY_SIZE(names); i++) { if (!skip_prefix(format, names[i], &rest)) continue; |
