From 8b24c3a47e7efd086258cc47bd1ddce304543ce0 Mon Sep 17 00:00:00 2001 From: rocky Date: Sun, 26 Mar 2006 20:47:55 +0000 Subject: [PATCH] Bug in get_drive_types_with_cap: Had wrong boolean logic. --- include/cdio/cd_types.h | 4 ++-- lib/driver/device.c | 10 +++------- test/testisocd.c | 11 ++++++++--- 3 files changed, 13 insertions(+), 12 deletions(-) diff --git a/include/cdio/cd_types.h b/include/cdio/cd_types.h index 8d763b11..6e12bd92 100644 --- a/include/cdio/cd_types.h +++ b/include/cdio/cd_types.h @@ -1,5 +1,5 @@ /* - $Id: cd_types.h,v 1.14 2006/02/13 08:44:17 rocky Exp $ + $Id: cd_types.h,v 1.15 2006/03/26 20:47:55 rocky Exp $ Copyright (C) 2003, 2006 Rocky Bernstein Copyright (C) 1996,1997,1998 Gerd Knorr @@ -52,7 +52,7 @@ extern "C" { /**< * EXT2 was the GNU/Linux native filesystem for early kernels. Newer - * GNU/Linux OS's may use EXT3 which EXT2 with a journal. + * GNU/Linux OS's may use EXT3 which is EXT2 with a journal. */ CDIO_FS_EXT2 = 7, diff --git a/lib/driver/device.c b/lib/driver/device.c index 27d32fef..02796c3c 100644 --- a/lib/driver/device.c +++ b/lib/driver/device.c @@ -1,5 +1,5 @@ /* - $Id: device.c,v 1.35 2006/02/27 10:29:20 flameeyes Exp $ + $Id: device.c,v 1.36 2006/03/26 20:47:55 rocky Exp $ Copyright (C) 2005, 2006 Rocky Bernstein @@ -606,9 +606,7 @@ cdio_get_devices_with_cap_ret (/*in*/ char* search_devices[], } else { cdio_fs_anal_t got_fs=0; cdio_fs_anal_t need_fs = CDIO_FSTYPE(capabilities); - cdio_fs_anal_t need_fs_ext; char **d = ppsz_drives; - need_fs_ext = capabilities & ~CDIO_FS_MASK; for( ; *d != NULL; d++ ) { CdIo_t *p_cdio = cdio_open(*d, *p_driver_id); @@ -621,11 +619,9 @@ cdio_get_devices_with_cap_ret (/*in*/ char* search_devices[], got_fs = cdio_guess_cd_type(p_cdio, 0, i_first_track, &cdio_iso_analysis); /* Match on fs and add */ - if ( (CDIO_FS_UNKNOWN == need_fs || CDIO_FSTYPE(got_fs) == need_fs) ) + if ( (CDIO_FS_UNKNOWN == need_fs || CDIO_FSTYPE(got_fs & need_fs)) ) { - bool doit = any - ? (got_fs & need_fs_ext) != 0 - : (got_fs | ~need_fs_ext) == -1; + bool doit = any ? true : (got_fs & need_fs) == need_fs; if (doit) cdio_add_device_list(&ppsz_drives_ret, *d, &i_drives); } diff --git a/test/testisocd.c b/test/testisocd.c index e363f23d..422c093d 100644 --- a/test/testisocd.c +++ b/test/testisocd.c @@ -1,4 +1,4 @@ -/* $Id: testisocd.c,v 1.1 2006/03/26 15:05:21 rocky Exp $ +/* $Id: testisocd.c,v 1.2 2006/03/26 20:47:55 rocky Exp $ Copyright (C) 2003, 2004, 2005, 2006 Rocky Bernstein @@ -64,8 +64,13 @@ main(int argc, const char *argv[]) /* See if we can find a device with a loaded CD-DA in it. If successful drive_id will be set. */ - ppsz_cd_drives = cdio_get_devices_with_cap_ret(NULL, CDIO_FS_ISO_9660, false, - &driver_id); + ppsz_cd_drives = + cdio_get_devices_with_cap_ret(NULL, + (CDIO_FS_ISO_9660 + |CDIO_FS_ISO_HFS + |CDIO_FS_ISO_9660_INTERACTIVE), + true, + &driver_id); if (ppsz_cd_drives && ppsz_cd_drives[0]) { /* Found such a CD-ROM with an ISO 9660 filesystem. Use the first drive in