]> granicus.if.org Git - php/commitdiff
- Fixed an issue in date() where a : was printed for the O modifier after a P
authorDerick Rethans <derick@php.net>
Fri, 2 May 2008 21:36:00 +0000 (21:36 +0000)
committerDerick Rethans <derick@php.net>
Fri, 2 May 2008 21:36:00 +0000 (21:36 +0000)
  modifier was used.

ext/date/php_date.c

index a31983185967cbff92e9f3869f6d07a0a10eb835..1fd8d07c16a4ce232c5209fcb6da6a5c768ee1a3 100644 (file)
@@ -731,7 +731,7 @@ static char *date_format(char *format, int format_len, timelib_time *t, int loca
        char                 buffer[33];
        timelib_time_offset *offset = NULL;
        timelib_sll          isoweek, isoyear;
-       int                  rfc_colon = 0;
+       int                  rfc_colon;
 
        if (!format_len) {
                return estrdup("");
@@ -761,6 +761,7 @@ static char *date_format(char *format, int format_len, timelib_time *t, int loca
        timelib_isoweek_from_date(t->y, t->m, t->d, &isoweek, &isoyear);
 
        for (i = 0; i < format_len; i++) {
+               rfc_colon = 0;
                switch (format[i]) {
                        /* day */
                        case 'd': length = slprintf(buffer, 32, "%02d", (int) t->d); break;