iso9660_get_dtime hack: we've seen it happen that everything except

gmtoff is zero and the expected date is the beginning of the epoch. So
we accept 6 numbers being zero. I'm also not sure if using the of the
Epoch is also the right thing to do either.
This commit is contained in:
rocky
2005-02-22 09:55:47 +00:00
parent 1dcab83589
commit 7bbdbd4f7c
3 changed files with 45 additions and 21 deletions

View File

@@ -1,5 +1,5 @@
/* /*
$Id: iso9660.c,v 1.7 2005/02/22 04:32:52 rocky Exp $ $Id: iso9660.c,v 1.8 2005/02/22 09:55:47 rocky Exp $
Copyright (C) 2000 Herbert Valerio Riedel <hvr@gnu.org> Copyright (C) 2000 Herbert Valerio Riedel <hvr@gnu.org>
Copyright (C) 2003, 2004, 2005 Rocky Bernstein <rocky@panix.com> Copyright (C) 2003, 2004, 2005 Rocky Bernstein <rocky@panix.com>
@@ -48,7 +48,7 @@ const char ISO_STANDARD_ID[] = {'C', 'D', '0', '0', '1'};
#include <errno.h> #include <errno.h>
#endif #endif
static const char _rcsid[] = "$Id: iso9660.c,v 1.7 2005/02/22 04:32:52 rocky Exp $"; static const char _rcsid[] = "$Id: iso9660.c,v 1.8 2005/02/22 09:55:47 rocky Exp $";
/* Variables to hold debugger-helping enumerations */ /* Variables to hold debugger-helping enumerations */
enum iso_enums1 iso_enums1; enum iso_enums1 iso_enums1;
@@ -103,6 +103,30 @@ iso9660_get_dtime (const iso9660_dtime_t *idr_date, bool b_localtime,
{ {
if (!idr_date) return false; if (!idr_date) return false;
/*
Section 9.1.5 of ECMA 119 says:
If all seven numbers are zero, it shall mean that the date and
time are not specified.
HACK: However we've seen it happen that everything except gmtoff
is zero and the expected date is the beginning of the epoch. So
we accept 6 numbers being zero. I'm also not sure if using the
beginning of the Epoch is also the right thing to do either.
*/
if ( 0 == idr_date->dt_year && 0 == idr_date->dt_month &&
0 == idr_date->dt_day && 0 == idr_date->dt_hour &&
0 == idr_date->dt_minute && 0 == idr_date->dt_second ) {
time_t t = 0;
struct tm *p_temp_tm;
p_temp_tm = gmtime(&t);
memcpy(p_tm, p_temp_tm, sizeof(struct tm));
return true;
}
memset(p_tm, 0, sizeof(struct tm)); memset(p_tm, 0, sizeof(struct tm));
p_tm->tm_year = idr_date->dt_year; p_tm->tm_year = idr_date->dt_year;
p_tm->tm_mon = idr_date->dt_month - 1; p_tm->tm_mon = idr_date->dt_month - 1;

View File

@@ -20,13 +20,13 @@ Volume : CDROM
Volume Set : Volume Set :
ISO9660 filesystem ISO9660 filesystem
/: /:
drwxrwxr-x 3 715 715 [LSN 23] 2048 Apr 20 2003 07:26 . drwxrwxr-x 3 715 715 [LSN 23] 2048 Apr 20 2003 07:26 .
drwxrwxr-x 3 715 715 [LSN 23] 2048 Apr 20 2003 07:26 .. drwxrwxr-x 3 715 715 [LSN 23] 2048 Apr 20 2003 07:26 ..
-rw-r--r-- 1 715 715 [LSN 26] 17992 Jul 29 2002 08:39 COPYING -rw-r--r-- 1 715 715 [LSN 26] 17992 Apr 20 2003 07:26 COPYING
drwxrwxr-x 2 715 715 [LSN 24] 2048 Apr 20 2003 12:18 doc drwxrwxr-x 2 715 715 [LSN 24] 2048 Apr 20 2003 12:18 doc
/doc/: /doc/:
drwxrwxr-x 2 715 715 [LSN 24] 2048 Apr 20 2003 12:18 . drwxrwxr-x 2 715 715 [LSN 24] 2048 Apr 20 2003 12:18 .
drwxrwxr-x 3 715 715 [LSN 23] 2048 Apr 20 2003 07:26 .. drwxrwxr-x 3 715 715 [LSN 23] 2048 Apr 20 2003 07:26 ..
-rw-rw-r-- 1 715 715 [LSN 35] 648 Apr 20 2003 12:18 readme.txt -rw-rw-r-- 1 715 715 [LSN 35] 648 Apr 20 2003 12:18 readme.txt

View File

@@ -22,8 +22,8 @@ Volume : MONVOISIN
Volume Set : Volume Set :
ISO9660 filesystem ISO9660 filesystem
/: /:
d---1xrxrxr 0 0 [fn 00] [LSN 18] 2048 Dec 31 1969 23:59 . d---1xrxrxr 0 0 [fn 00] [LSN 18] 2048 Jan 01 1970 00:00 .
d---1xrxrxr 0 0 [fn 00] [LSN 18] 2048 Dec 31 1969 23:59 .. d---1xrxrxr 0 0 [fn 00] [LSN 18] 2048 Jan 01 1970 00:00 ..
d---1xrxrxr 0 0 [fn 00] [LSN 19] 2048 Feb 19 2001 16:37 cdi d---1xrxrxr 0 0 [fn 00] [LSN 19] 2048 Feb 19 2001 16:37 cdi
d---1xrxrxr 0 0 [fn 00] [LSN 20] 2048 Feb 19 2001 16:37 ext d---1xrxrxr 0 0 [fn 00] [LSN 20] 2048 Feb 19 2001 16:37 ext
d---1xrxrxr 0 0 [fn 00] [LSN 21] 2048 Feb 19 2001 16:37 mpegav d---1xrxrxr 0 0 [fn 00] [LSN 21] 2048 Feb 19 2001 16:37 mpegav
@@ -31,32 +31,32 @@ ISO9660 filesystem
d---1xrxrxr 0 0 [fn 00] [LSN 23] 2048 Feb 19 2001 16:37 vcd d---1xrxrxr 0 0 [fn 00] [LSN 23] 2048 Feb 19 2001 16:37 vcd
/CDI/: /CDI/:
d---1xrxrxr 0 0 [fn 00] [LSN 19] 2048 Dec 31 1969 23:59 . d---1xrxrxr 0 0 [fn 00] [LSN 19] 2048 Jan 01 1970 00:00 .
d---1xrxrxr 0 0 [fn 00] [LSN 18] 2048 Dec 31 1969 23:59 .. d---1xrxrxr 0 0 [fn 00] [LSN 18] 2048 Jan 01 1970 00:00 ..
---2-xrxrxr 0 0 [fn 01] [LSN 211] 1494332 ( 1315168) Feb 19 2001 16:37 cdi_imag.rtf ---2-xrxrxr 0 0 [fn 01] [LSN 211] 1494332 ( 1315168) Feb 19 2001 16:37 cdi_imag.rtf
----1xrxrxr 0 0 [fn 01] [LSN 854] 13616 Feb 19 2001 16:37 cdi_text.fnt ----1xrxrxr 0 0 [fn 01] [LSN 854] 13616 Feb 19 2001 16:37 cdi_text.fnt
----1xrxrxr 0 0 [fn 01] [LSN 861] 102400 Feb 19 2001 16:37 cdi_vcd.app ----1xrxrxr 0 0 [fn 01] [LSN 861] 102400 Feb 19 2001 16:37 cdi_vcd.app
----1xrxrxr 0 0 [fn 01] [LSN 911] 279 Feb 19 2001 16:37 cdi_vcd.cfg ----1xrxrxr 0 0 [fn 01] [LSN 911] 279 Feb 19 2001 16:37 cdi_vcd.cfg
/EXT/: /EXT/:
d---1xrxrxr 0 0 [fn 00] [LSN 20] 2048 Dec 31 1969 23:59 . d---1xrxrxr 0 0 [fn 00] [LSN 20] 2048 Jan 01 1970 00:00 .
d---1xrxrxr 0 0 [fn 00] [LSN 18] 2048 Dec 31 1969 23:59 .. d---1xrxrxr 0 0 [fn 00] [LSN 18] 2048 Jan 01 1970 00:00 ..
----1xrxrxr 0 0 [fn 01] [LSN 912] 65536 Feb 19 2001 16:37 lot_x.vcd ----1xrxrxr 0 0 [fn 01] [LSN 912] 65536 Feb 19 2001 16:37 lot_x.vcd
----1xrxrxr 0 0 [fn 01] [LSN 944] 24 Feb 19 2001 16:37 psd_x.vcd ----1xrxrxr 0 0 [fn 01] [LSN 944] 24 Feb 19 2001 16:37 psd_x.vcd
----1xrxrxr 0 0 [fn 01] [LSN 945] 114 Feb 19 2001 16:37 scandata.dat ----1xrxrxr 0 0 [fn 01] [LSN 945] 114 Feb 19 2001 16:37 scandata.dat
/MPEGAV/: /MPEGAV/:
d---1xrxrxr 0 0 [fn 00] [LSN 21] 2048 Dec 31 1969 23:59 . d---1xrxrxr 0 0 [fn 00] [LSN 21] 2048 Jan 01 1970 00:00 .
d---1xrxrxr 0 0 [fn 00] [LSN 18] 2048 Dec 31 1969 23:59 .. d---1xrxrxr 0 0 [fn 00] [LSN 18] 2048 Jan 01 1970 00:00 ..
---2-xrxrxr 0 0 [fn 01] [LSN 1251] 3655652 ( 3221504) Feb 19 2001 16:37 avseq01.dat ---2-xrxrxr 0 0 [fn 01] [LSN 1251] 3655652 ( 3221504) Feb 19 2001 16:37 avseq01.dat
/SEGMENT/: /SEGMENT/:
d---1xrxrxr 0 0 [fn 00] [LSN 22] 2048 Dec 31 1969 23:59 . d---1xrxrxr 0 0 [fn 00] [LSN 22] 2048 Jan 01 1970 00:00 .
d---1xrxrxr 0 0 [fn 00] [LSN 18] 2048 Dec 31 1969 23:59 .. d---1xrxrxr 0 0 [fn 00] [LSN 18] 2048 Jan 01 1970 00:00 ..
/VCD/: /VCD/:
d---1xrxrxr 0 0 [fn 00] [LSN 23] 2048 Dec 31 1969 23:59 . d---1xrxrxr 0 0 [fn 00] [LSN 23] 2048 Jan 01 1970 00:00 .
d---1xrxrxr 0 0 [fn 00] [LSN 18] 2048 Dec 31 1969 23:59 .. d---1xrxrxr 0 0 [fn 00] [LSN 18] 2048 Jan 01 1970 00:00 ..
----1xrxrxr 0 0 [fn 00] [LSN 151] 2048 Feb 19 2001 16:37 entries.vcd ----1xrxrxr 0 0 [fn 00] [LSN 151] 2048 Feb 19 2001 16:37 entries.vcd
----1xrxrxr 0 0 [fn 00] [LSN 150] 2048 Feb 19 2001 16:37 info.vcd ----1xrxrxr 0 0 [fn 00] [LSN 150] 2048 Feb 19 2001 16:37 info.vcd
----1xrxrxr 0 0 [fn 00] [LSN 152] 65536 Feb 19 2001 16:37 lot.vcd ----1xrxrxr 0 0 [fn 00] [LSN 152] 65536 Feb 19 2001 16:37 lot.vcd