[Po4a-devel] Fix Po.pm on Solaris

Nicolas François nicolas.francois at centraliens.net
Mon Jul 14 19:45:25 UTC 2008


On Wed, Jul 02, 2008 at 06:05:01PM +0200, fgouget at codeweavers.com wrote:
>
> So I was running po4a on Solaris and I got Perl warnings saying that  
> '%s' is not a valid number. I traced it to the timezone() function in  
> lib/Locale/Po4a/Po.pm which calls:
>
>     $diff  = floor(strftime("%s", at l)/60 +0.5);
>
> Unfortunately on Solaris strftime() does not support '%s' as the format  
> so it returns it as is. So I propose the attached patch which replaces  
> the call to strftime() with a call to Time::Local::timelocal() which  
> works on both Solaris and Linux and returns the same result.

Thanks a lot for the patch. It's now applied in the po4a repository.

> I guess this should be tested on Windows too, but I'm not equipped for that.

Me neither. But as Time::Local is a standard module, I don't expect any
issues.

Best Regards,
-- 
Nekral



More information about the Po4a-devel mailing list