1
0
Fork 0

Move already mounted checks upwards. (jmarsh)

Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@4308
This commit is contained in:
Peter Veenstra 2020-01-12 18:14:14 +00:00
parent 51aecb14c6
commit 8be4b7a850

View file

@ -278,6 +278,16 @@ public:
if (!isalpha(i_drive)) goto showusage;
if ((i_drive - 'A') >= DOS_DRIVES || (i_drive-'A') < 0 ) goto showusage;
drive = static_cast<char>(i_drive);
if (type == "overlay") {
//Ensure that the base drive exists:
if (!Drives[drive-'A']) {
WriteOut("No basedrive mounted yet!");
return;
}
} else if (Drives[drive-'A']) {
WriteOut(MSG_Get("PROGRAM_MOUNT_ALREADY_MOUNTED"),drive,Drives[drive-'A']->GetInfo());
return;
}
if (!cmd->FindCommand(2,temp_line)) goto showusage;
if (!temp_line.size()) goto showusage;
@ -409,11 +419,6 @@ public:
if(temp_line == "/") WriteOut(MSG_Get("PROGRAM_MOUNT_WARNING_OTHER"));
#endif
if(type == "overlay") {
//Ensure that the base drive exists:
if (!Drives[drive-'A']) {
WriteOut("No basedrive mounted yet!");
return;
}
localDrive* ldp = dynamic_cast<localDrive*>(Drives[drive-'A']);
cdromDrive* cdp = dynamic_cast<cdromDrive*>(Drives[drive-'A']);
if (!ldp || cdp) {
@ -446,11 +451,6 @@ public:
WriteOut(MSG_Get("PROGRAM_MOUNT_ILL_TYPE"),type.c_str());
return;
}
if (Drives[drive-'A']) {
WriteOut(MSG_Get("PROGRAM_MOUNT_ALREADY_MOUNTED"),drive,Drives[drive-'A']->GetInfo());
if (newdrive) delete newdrive;
return;
}
if (!newdrive) E_Exit("DOS:Can't create drive");
Drives[drive-'A']=newdrive;
/* Set the correct media byte in the table */