New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[PATCH 5.5.650] fix 0 mday in POSIX::strftime #1183
Comments
From jtobey@epsilondev.comThis is a bug report for perl from jtobey@einstein.isay-secure.com, POSIX::strftime produces "0 Feb" for 31 Jan, "0 Apr" for 31 May, and use POSIX 'strftime'; => Should be: 01 31 Inline Patch--- perl5.5.650/ext/POSIX/POSIX.xs~ Sun Feb 6 14:25:22 2000
+++ perl5.5.650/ext/POSIX/POSIX.xs Tue Feb 15 15:03:36 2000
@@ -510,8 +510,14 @@
}
}
ptm->tm_year = year - 1900;
- ptm->tm_mon = month;
- ptm->tm_mday = yearday;
+ if (yearday) {
+ ptm->tm_mday = yearday;
+ ptm->tm_mon = month;
+ }
+ else {
+ ptm->tm_mday = 31;
+ ptm->tm_mon = month - 1;
+ }
/* re-build yearday based on Jan 1 to get tm_yday */
year--;
yearday = year*DAYS_PER_YEAR + year/4 - year/100 + year/400;
--- perl5.5.650/t/lib/posix.t~ Tue Jan 18 15:34:59 2000
+++ perl5.5.650/t/lib/posix.t Tue Feb 15 15:13:14 2000
@@ -14,7 +14,7 @@
use strict subs;
$| = 1;
-print "1..26\n";
+print "1..27\n";
$Is_W32 = $^O eq 'MSWin32';
@@ -121,6 +121,7 @@
try_strftime(24, "Mon Feb 28 00:00:00 2000 059", 0,0,0, 28,1,100);
try_strftime(25, "Tue Feb 29 00:00:00 2000 060", 0,0,0, 0,2,100);
try_strftime(26, "Wed Mar 01 00:00:00 2000 061", 0,0,0, 1,2,100);
+try_strftime(27, "Fri Mar 31 00:00:00 2000 091", 0,0,0, 31,2,100);
&POSIX::setlocale(&POSIX::LC_TIME, $lc) if $Config{d_setlocale};
$| = 0;
-----------------------------------------------------------------
---
Site configuration information for perl 5.00563: Configured by jtobey at Tue Feb 1 17:54:28 EST 2000. Summary of my perl5 (revision 5.0 version 5 subversion 63) configuration: Locally applied patches: @INC for perl 5.00563: Environment for perl 5.00563: |
Migrated from rt.perl.org#2153 (status was 'resolved')
Searchable as RT2153$
The text was updated successfully, but these errors were encountered: