From: corinna Date: Fri, 21 Jun 2002 20:04:38 +0000 (+0000) Subject: * libc/time/strftime.c (strftime): Add %e format specifier. X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=c3b7d212d090c29bbae5cef144ff9c1a03d74900;p=pf3gnuchains%2Fsourceware.git * libc/time/strftime.c (strftime): Add %e format specifier. --- diff --git a/newlib/ChangeLog b/newlib/ChangeLog index a744d675b6..8ccbbe2278 100644 --- a/newlib/ChangeLog +++ b/newlib/ChangeLog @@ -1,3 +1,7 @@ +2002-06-21 Corinna Vinschen + + * libc/time/strftime.c (strftime): Add %e format specifier. + 2002-06-21 Thomas Fitzsimmons * libc/search/hash.h (LITTLE_ENDIAN, BIG_ENDIAN): Define if not diff --git a/newlib/libc/time/strftime.c b/newlib/libc/time/strftime.c index 57fe74eae0..9c115b62d9 100644 --- a/newlib/libc/time/strftime.c +++ b/newlib/libc/time/strftime.c @@ -64,6 +64,9 @@ A string representing the complete date and time, in the form o %d The day of the month, formatted with two digits. +o %e +The day of the month, formatted with leading space if single digit. + o %H The hour (on a 24-hour clock), formatted with two digits. @@ -257,6 +260,16 @@ _DEFUN (strftime, (s, maxsize, format, tim_p), else return 0; break; + case 'e': + if (count < maxsize - 2) + { + sprintf (&s[count], "%2d", + tim_p->tm_mday); + count += 2; + } + else + return 0; + break; case 'H': if (count < maxsize - 2) {