File: y2k20.patch

package info (click to toggle)
libparse-win32registry-perl 1.0-2%2Bdeb10u1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 928 kB
  • sloc: perl: 8,646; makefile: 8
file content (30 lines) | stat: -rw-r--r-- 1,146 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
Description: fix Y2K20 problem with Time::Local's 50 year window
Origin: vendor
Bug: https://rt.cpan.org/Public/Bug/Display.html?id=124514
Bug-Debian: https://bugs.debian.org/948682
Forwarded: https://rt.cpan.org/Public/Bug/Display.html?id=124514
Author: gregor herrmann <gregoa@debian.org>
Last-Update: 2020-01-12

--- a/lib/Parse/Win32Registry/Base.pm
+++ b/lib/Parse/Win32Registry/Base.pm
@@ -167,7 +167,7 @@
 
     # adjust the UNIX epoch time to the local OS's epoch time
     # (see perlport's Time and Date section)
-    my $epoch_offset = timegm(0, 0, 0, 1, 0, 70);
+    my $epoch_offset = timegm(0, 0, 0, 1, 0, 1970);
     $epoch_time += $epoch_offset;
 
     if ($epoch_time < 0 || $epoch_time > 0x7fffffff) {
--- a/t/misc.t
+++ b/t/misc.t
@@ -502,7 +502,7 @@
     if (defined($time)) {
         # The test data time is a Unix epoch time
         # so is adjusted to the local OS's epoch time
-        my $epoch_offset = timegm(0, 0, 0, 1, 0, 70);
+        my $epoch_offset = timegm(0, 0, 0, 1, 0, 1970);
         $time += $epoch_offset;
         cmp_ok($unpacked_time1, '==', $time,
             "$desc (scalar) unpack_windows_time");