Re: str2time endless loop

Gisle Aas (aas@bergen.sn.no)
Fri, 17 May 1996 16:49:46 +0200


In message <199605162219.AA115665198@info-rz>, Markus Gyger writes:
> in libwww-perl-5b13, module HTTP::Date,
> 
>     str2time("Wednesday, 31-Dec-69 23:59:59 GMT")
> 
> loops forever in Perl 5.002 Time::Local::timegm. Fix:

Thanks.  Perhaps it is the Time::Local module that really need to be
fixed...

Regards,
Gisle.

> *** ,Date.pm	Thu May  9 11:19:10 1996
> --- Date.pm	Fri May 17 00:05:10 1996
> ***************
> *** 235,241 ****
>      # Then we check if the year is acceptable
>      return undef if $yr > 99 && $yr < 1970;  # Epoch started in 1970
>      # Epoch counter maxes out in year 2038, assuming "time_t" is 32 bit
> !    return undef if $yr > 2038;
>   
>      $yr += 100 if $yr < 70;
>      $yr -= 1900 if $yr >= 1900;
> --- 235,241 ----
>      # Then we check if the year is acceptable
>      return undef if $yr > 99 && $yr < 1970;  # Epoch started in 1970
>      # Epoch counter maxes out in year 2038, assuming "time_t" is 32 bit
> !    return undef if $yr > 2038 || $yr > 38 && $yr < 70;
>   
>      $yr += 100 if $yr < 70;
>      $yr -= 1900 if $yr >= 1900;