Package: libcdio / 0.83-4.3

05_revert_iso9660_set_pvd Patch series | download
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
Description: Revert the old behavior of iso9660_set_pvd.
 The commit 66a3e4689efe80897648ca0e4b0faf36845a1fed changed the
 behavior of the iso9660_set_pvd function, to work around the fact
 that, since commit f996d202b8535c305bcf0a4ff7090b8de689eea7,
 iso9660_set_ltime does not accept NULL pointers for p_tm.
 After some exchange with upstream, change iso9660_set_ltime and
 iso9660_set_dtime to allow NULL pointers again, and revert commit
 66a3e4689efe80897648ca0e4b0faf36845a1fed.
Author: Nicolas Boullis <nboullis@debian.org>
Applied-Upstream: http://git.savannah.gnu.org/gitweb/?p=libcdio.git;a=commit;h=03643c862107e504e4477020119e0f3d000da41a
--- a/lib/iso9660/iso9660.c
+++ b/lib/iso9660/iso9660.c
@@ -337,13 +337,15 @@
 void
 iso9660_set_dtime (const struct tm *p_tm, /*out*/ iso9660_dtime_t *p_idr_date)
 {
-  int timezone;
+  int timezone = 0;
+  if (p_tm) {
 #ifdef HAVE_TM_GMTOFF
-  /* Convert seconds to minutes */
-  timezone = p_tm->tm_gmtoff / 60;
+    /* Convert seconds to minutes */
+    timezone = p_tm->tm_gmtoff / 60;
 #else 
-  timezone = (p_tm->tm_isdst > 0) ? -60 : 0;
+    timezone = (p_tm->tm_isdst > 0) ? -60 : 0;
 #endif
+  }
   iso9660_set_dtime_with_timezone (p_tm, timezone, p_idr_date);
 }
 
@@ -390,13 +392,15 @@
 void
 iso9660_set_ltime (const struct tm *p_tm, /*out*/ iso9660_ltime_t *pvd_date)
 {
-  int timezone;
+  int timezone = 0;
+  if (p_tm) {
 #ifdef HAVE_TM_GMTOFF
-  /* Set time zone in 15-minute interval encoding. */
-  timezone = p_tm->tm_gmtoff / 60;
+    /* Set time zone in 15-minute interval encoding. */
+    timezone = p_tm->tm_gmtoff / 60;
 #else
-  timezone = (p_tm->tm_isdst > 0) ? -60 : 0;
+    timezone = (p_tm->tm_isdst > 0) ? -60 : 0;
 #endif
+  }
   iso9660_set_ltime_with_timezone (p_tm, timezone, pvd_date);
 }
 
@@ -666,8 +670,8 @@
   iso9660_set_ltime (&temp_tm, &(ipd.creation_date));
   gmtime_r(pvd_time, &temp_tm);
   iso9660_set_ltime (&temp_tm, &(ipd.modification_date));
-  iso9660_set_ltime (&temp_tm,     &(ipd.expiration_date));
-  iso9660_set_ltime (&temp_tm,     &(ipd.effective_date));
+  iso9660_set_ltime (NULL,     &(ipd.expiration_date));
+  iso9660_set_ltime (NULL,     &(ipd.effective_date));
 
   ipd.file_structure_version = to_711(1);