In cdrom_prepare() do not overwrite media list by DISK medias. Instead,

make get_medias() report DISK too when asked for CDROM.
This commit is contained in:
Mykola Grechukh 2012-02-10 14:18:48 +00:00
parent 75416657d2
commit 6d837a25c6
2 changed files with 2 additions and 6 deletions

View File

@ -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 */

View File

@ -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);
}