From 515746d584d7006fb3e3c62142f7872692e2b6e6 Mon Sep 17 00:00:00 2001 From: atmaxinger Date: Thu, 22 Feb 2018 11:32:57 +0100 Subject: [PATCH] Only remove item at index --- SheepShaver/src/MacOSX/Launcher/VMSettingsController.mm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/SheepShaver/src/MacOSX/Launcher/VMSettingsController.mm b/SheepShaver/src/MacOSX/Launcher/VMSettingsController.mm index f72ec39a..c1eafa13 100755 --- a/SheepShaver/src/MacOSX/Launcher/VMSettingsController.mm +++ b/SheepShaver/src/MacOSX/Launcher/VMSettingsController.mm @@ -409,11 +409,13 @@ static NSString *makeRelativeIfNecessary(NSString *path) // Remove all cdroms (but keep the ones in /dev/) const char *path; int index=0; - while ((path = PrefsFindString("cdrom", index++)) != NULL) { + while ((path = PrefsFindString("cdrom", index)) != NULL) { NSString *p = [NSString stringWithUTF8String: path]; if(![p hasPrefix:@"/dev/"]) { - PrefsRemoveItem("cdrom"); + PrefsRemoveItem("cdrom", index); } + + index++; } // Write all disks