Remove do_pvd variable

This commit is contained in:
King_DuckZ 2020-03-03 15:24:59 +01:00
parent de159615a3
commit bd10160088

View file

@ -141,7 +141,6 @@ LOCAL int find_pac = 0; /* ac for first find primary */
LOCAL char *const *find_pav = NULL; /* av for first find primary */
LOCAL int do_sectors = 0;
LOCAL int do_pathtab = 0;
LOCAL int do_pvd = 0;
LOCAL BOOL debug = FALSE;
LOCAL char *xtract = 0;
LOCAL BOOL Xtract = FALSE;
@ -1615,20 +1614,6 @@ setcharset:
if (!debug)
use_rock = FALSE;
}
if (do_pvd) {
/*
* High sierra:
*
* DESC TYPE == 1 (VD_SFS) offset 8 len 1
* STR ID == "CDROM" offset 9 len 5
* STD_VER == 1 offset 14 len 1
*/
if ((((char *)&ipd)[8] == 1) &&
(strncmp(&((char *)&ipd)[9], "CDROM", 5) == 0) &&
(((char *)&ipd)[14] == 1)) {
printf(_("CD-ROM is in High Sierra format\n"));
exit(0);
}
/*
* ISO 9660:
*
@ -1643,78 +1628,7 @@ setcharset:
exit(1);
}
printf(_("CD-ROM is in ISO 9660 format\n"));
if (!use_joliet)
list_vd(&ipd, FALSE);
{
int block = 16;
movebytes(&ipd, &jpd, sizeof (ipd));
while ((Uchar)jpd.type[0] != ISO_VD_END) {
if (debug && (Uchar) jpd.type[0] == ISO_VD_SUPPLEMENTARY)
error(_("Joliet escape sequence 0: '%c' 1: '%c' 2: '%c' 3: '%c'\n"),
jpd.escape_sequences[0],
jpd.escape_sequences[1],
jpd.escape_sequences[2],
jpd.escape_sequences[3]);
/*
* If Joliet UCS escape sequence found, we may be wrong
*/
if (jpd.escape_sequences[0] == '%' &&
jpd.escape_sequences[1] == '/' &&
(jpd.escape_sequences[3] == '\0' ||
jpd.escape_sequences[3] == ' ') &&
(jpd.escape_sequences[2] == '@' ||
jpd.escape_sequences[2] == 'C' ||
jpd.escape_sequences[2] == 'E')) {
if (jpd.version[0] == 1)
goto nextblock;
}
if (jpd.type[0] == 0) {
movebytes(&jpd, &bpd, sizeof (bpd));
if (strncmp(bpd.system_id, EL_TORITO_ID, sizeof (EL_TORITO_ID)) == 0) {
bootcat_offset = (Uchar)bpd.bootcat_ptr[0] +
(Uchar)bpd.bootcat_ptr[1] * 256 +
(Uchar)bpd.bootcat_ptr[2] * 65536 +
(Uchar)bpd.bootcat_ptr[3] * 16777216;
found_eltorito = TRUE;
printf(_("El Torito VD version %d found, boot catalog is in sector %d\n"),
bpd.version[0],
bootcat_offset);
}
}
if (jpd.version[0] == 2) {
printf(_("CD-ROM uses ISO 9660:1999 relaxed format\n"));
break;
}
nextblock:
block++;
#ifdef USE_SCG
readsecs(block + toc_offset, &jpd, ISO_BLOCKS(sizeof (jpd)));
#else
lseek(fileno(infile), ((off_t)(block + toc_offset)) <<11, SEEK_SET);
read(fileno(infile), &jpd, sizeof (jpd));
#endif
}
}
}
/*
* ISO 9660:
*
* DESC TYPE == 1 (VD_PVD) offset 0 len 1
* STR ID == "CD001" offset 1 len 5
* STD_VER == 1 offset 6 len 1
*/
if ((ipd.type[0] != ISO_VD_PRIMARY) ||
(strncmp(ipd.id, ISO_STANDARD_ID, sizeof (ipd.id)) != 0) ||
(ipd.version[0] != 1)) {
printf(_("CD-ROM is NOT in ISO 9660 format\n"));
exit(1);
}
if (use_joliet || do_pvd) {
if (use_joliet) {
int block = 16;
movebytes(&ipd, &jpd, sizeof (ipd));
while ((unsigned char) jpd.type[0] != ISO_VD_END) {
@ -1775,61 +1689,6 @@ setcharset:
_("Warning: Joliet escape sequence uses illegal space at offset 3\n"));
}
if (do_pvd) {
if (ucs_level > 0) {
if (use_joliet) {
printf(_("\nJoliet with UCS level %d found,"), ucs_level);
printf(_(" Joliet volume descriptor:\n"));
list_vd(&jpd, TRUE);
} else {
printf(_("\nJoliet with UCS level %d found."), ucs_level);
}
} else {
printf(_("NO Joliet present\n"));
}
if (c != 0) {
#ifdef RR_DEBUG
printf("RR %X %d\n", c, c);
#endif
if (c & RR_FLAG_SP) {
printf(
_("\nSUSP signatures version %d found\n"),
su_version);
if (c & RR_FLAG_ER) {
if (rr_version < 1) {
printf(
_("No valid Rock Ridge signature found\n"));
} else {
printf(
_("Rock Ridge signatures version %d found\n"),
rr_version);
printf(
_("Rock Ridge id '%s'\n"),
er_id);
}
}
} else {
printf(
_("\nBad Rock Ridge signatures found (SU record missing)\n"));
}
/*
* This is currently a no op!
* We need to check the first plain file instead of
* the '.' entry in the root directory.
*/
if (c & RR_FLAG_AA) {
printf(_("\nApple signatures version %d found\n"),
aa_version);
}
} else {
printf(_("\nNo SUSP/Rock Ridge present\n"));
}
if (found_eltorito)
printf_bootinfo(infile, bootcat_offset);
exit(0);
}
if (use_joliet)
idr = (struct iso_directory_record *)jpd.root_directory_record;