mirror of
https://github.com/coreutils/coreutils.git
synced 2025-01-21 15:43:30 +08:00
(my_strftime): Parse the colons of %:::z *after* the
optional field width, not before, so we accept %9:z, not %:9z.
This commit is contained in:
parent
4da7283547
commit
ad98202690
@ -596,11 +596,6 @@ my_strftime (CHAR_T *s, size_t maxsize, const CHAR_T *format,
|
||||
pad = *f;
|
||||
continue;
|
||||
|
||||
/* This influences the %z format. */
|
||||
case L_(':'):
|
||||
colons++;
|
||||
continue;
|
||||
|
||||
/* This changes textual output. */
|
||||
case L_('^'):
|
||||
to_uppcase = true;
|
||||
@ -648,6 +643,19 @@ my_strftime (CHAR_T *s, size_t maxsize, const CHAR_T *format,
|
||||
break;
|
||||
}
|
||||
|
||||
/* Parse the colons of %:::z *after* the optional field width,
|
||||
not before, so we accept %9:z, not %:9z. */
|
||||
{
|
||||
const CHAR_T *q;
|
||||
for (q = f; *q == ':' && q - f < 3; q++)
|
||||
; /* empty */
|
||||
if (*q == 'z')
|
||||
{
|
||||
colons = q - f;
|
||||
f = q;
|
||||
}
|
||||
}
|
||||
|
||||
/* Now do the specified format. */
|
||||
format_char = *f;
|
||||
switch (format_char)
|
||||
|
Loading…
Reference in New Issue
Block a user