diff --git a/src/dos/dos_programs.cpp b/src/dos/dos_programs.cpp index 75ab857e..5c93428d 100644 --- a/src/dos/dos_programs.cpp +++ b/src/dos/dos_programs.cpp @@ -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(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(Drives[drive-'A']); cdromDrive* cdp = dynamic_cast(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 */