diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/bigfloat.pl | 2 | ||||
-rw-r--r-- | lib/bigint.pl | 4 | ||||
-rw-r--r-- | lib/getcwd.pl | 4 | ||||
-rw-r--r-- | lib/timelocal.pl | 2 |
4 files changed, 7 insertions, 5 deletions
diff --git a/lib/bigfloat.pl b/lib/bigfloat.pl index 52fb7e3880..278f11d815 100644 --- a/lib/bigfloat.pl +++ b/lib/bigfloat.pl @@ -67,7 +67,7 @@ sub norm { #(mantissa, exponent) return fnum_str # negation sub main'fneg { #(fnum_str) return fnum_str local($_) = &'fnorm($_[0]); - vec($_,0,8) =^ ord('+') ^ ord('-') unless $_ eq '+0E+0'; # flip sign + vec($_,0,8) ^= ord('+') ^ ord('-') unless $_ eq '+0E+0'; # flip sign s/^H/N/; $_; } diff --git a/lib/bigint.pl b/lib/bigint.pl index 9a52fb76fd..5c79da9898 100644 --- a/lib/bigint.pl +++ b/lib/bigint.pl @@ -154,7 +154,7 @@ sub add { #(int_num_array, int_num_array) return int_num_array $car = 0; for $x (@x) { last unless @y || $car; - $x -= 1e5 if $car = (($x += shift @y + $car) >= 1e5); + $x -= 1e5 if $car = (($x += shift(@y) + $car) >= 1e5); } for $y (@y) { last unless $car; @@ -169,7 +169,7 @@ sub sub { #(int_num_array, int_num_array) return int_num_array $bar = 0; for $sx (@sx) { last unless @y || $bar; - $sx += 1e5 if $bar = (($sx -= shift @sy + $bar) < 0); + $sx += 1e5 if $bar = (($sx -= shift(@sy) + $bar) < 0); } @sx; } diff --git a/lib/getcwd.pl b/lib/getcwd.pl index 114e8905c6..a3214ba715 100644 --- a/lib/getcwd.pl +++ b/lib/getcwd.pl @@ -42,9 +42,9 @@ sub getcwd closedir(getcwd'PARENT); #'); return ''; } - unless (@tst = stat("$dotdots/$dir")) + unless (@tst = lstat("$dotdots/$dir")) { - warn "stat($dotdots/$dir): $!"; + warn "lstat($dotdots/$dir): $!"; closedir(getcwd'PARENT); #'); return ''; } diff --git a/lib/timelocal.pl b/lib/timelocal.pl index 5be3840035..95b47e1ef9 100644 --- a/lib/timelocal.pl +++ b/lib/timelocal.pl @@ -36,6 +36,7 @@ CONFIG: { $MIN = 60 * $SEC; $HR = 60 * $MIN; $DAYS = 24 * $HR; + $YearFix = ((gmtime(946684800))[5] == 100) ? 100 : 0; } sub timegm { @@ -65,6 +66,7 @@ sub cheat { die "Month out of range 0..11 in ctime.pl\n" if $month > 11; $guess = $^T; @g = gmtime($guess); + $year += $YearFix if $year < $epoch[5]; while ($diff = $year - $g[5]) { $guess += $diff * (363 * $DAYS); @g = gmtime($guess); |