[PATCH]: Add %e format specifier to strftime(3)

J. Johnston jjohnstn@redhat.com
Fri Jun 21 10:44:00 GMT 2002


Corinna Vinschen wrote:
> 
> Hi,
> 
> the following patch adds the missing %e format specifier to strftime(3).
> 
> Ok to check in?
>

Yes, thanks.

-- Jeff J.

> 
> 2002-06-21  Corinna Vinschen  <corinna@vinschen.de>
> 
>         * libc/time/strftime.c (strftime): Add %e format specifier.
> 
> Index: libc/time/strftime.c
> ===================================================================
> RCS file: /cvs/src/src/newlib/libc/time/strftime.c,v
> retrieving revision 1.3
> diff -u -p -r1.3 strftime.c
> --- libc/time/strftime.c        17 Apr 2002 21:23:31 -0000      1.3
> +++ libc/time/strftime.c        21 Jun 2002 15:30:05 -0000
> @@ -64,6 +64,9 @@ A string representing the complete date
>  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.
> 
> @@ -251,6 +254,16 @@ _DEFUN (strftime, (s, maxsize, format, t
>           if (count < maxsize - 2)
>             {
>               sprintf (&s[count], "%.2d",
> +                      tim_p->tm_mday);
> +             count += 2;
> +           }
> +         else
> +           return 0;
> +         break;
> +       case 'e':
> +         if (count < maxsize - 2)
> +           {
> +             sprintf (&s[count], "%2d",
>                        tim_p->tm_mday);
>               count += 2;
>             }
> 
> --
> Corinna Vinschen
> Cygwin Developer
> Red Hat, Inc.
> mailto:vinschen@redhat.com



More information about the Newlib mailing list