From 6d837a25c63823272b472bcea6bb2e8e5d9d2a9a Mon Sep 17 00:00:00 2001 From: Mykola Grechukh Date: Fri, 10 Feb 2012 14:18:48 +0000 Subject: [PATCH] In cdrom_prepare() do not overwrite media list by DISK medias. Instead, make get_medias() report DISK too when asked for CDROM. --- cdrom.c | 5 ----- probing.c | 3 ++- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/cdrom.c b/cdrom.c index 46cfb38..d9afb81 100644 --- a/cdrom.c +++ b/cdrom.c @@ -178,11 +178,6 @@ enum return_type cdrom_prepare(void) } if ((i = try_automatic(medias, medias_models)) != -1) return do_with_device(medias[i], medias_models[i]); - /* detect hybrid iso images (those dumped to a USB stick) */ - get_medias(DISK, &medias, &medias_models); - if ((i = try_automatic(medias, medias_models)) != -1) { - return do_with_device(medias[i], medias_models[i]); - } if (count == 0) { /* too bad, let's recount one more time */ diff --git a/probing.c b/probing.c index 33f1f82..598b028 100644 --- a/probing.c +++ b/probing.c @@ -246,7 +246,8 @@ void get_medias(enum media_type media, char *** names, char *** models) count = 0; while (m && m->name) { - if (m->type == media) { + /* detect hybrid iso images (those dumped to a USB stick) */ + if ((m->type == media) || ((media == CDROM) && (m->type == DISK))) { tmp_names[count] = strdup(m->name); tmp_models[count++] = strdup(m->model); }