summaryrefslogtreecommitdiff
path: root/strftime.c
diff options
context:
space:
mode:
Diffstat (limited to 'strftime.c')
-rw-r--r--strftime.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/strftime.c b/strftime.c
index ba65c87502..767a852727 100644
--- a/strftime.c
+++ b/strftime.c
@@ -758,8 +758,12 @@ rb_strftime_with_timespec(char *s, size_t maxsize, const char *format, rb_encodi
goto again;
case ':':
- FLAG_FOUND();
- colons++;
+ {
+ size_t l = strspn(format, ":");
+ if (l > 3 || format[l] != 'z') goto unknown;
+ colons = (int)l;
+ format += l - 1;
+ }
goto again;
case '0':