[Po4a-devel] Fix Po.pm on Solaris

Francois Gouget fgouget at codeweavers.com
Wed Jul 2 16:05:01 UTC 2008


Hi,

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.

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


Changelog:

  * lib/Locale/Po4a/Po.pm

    Francois Gouget <fgouget at codeweavers.com>
    Fix timezone() so it works on Solaris (replace strftime("%s", at t) 
with Time::Local::timelocal(@t)).


-- 
Francois Gouget
fgouget at codeweavers.com

-------------- next part --------------
A non-text attachment was scrubbed...
Name: po4a-20080702-timezone.diff
Type: text/x-diff
Size: 1289 bytes
Desc: not available
Url : http://lists.alioth.debian.org/pipermail/po4a-devel/attachments/20080702/3879ba7e/attachment.diff 


More information about the Po4a-devel mailing list