diff --git a/src/dos/dos_programs.cpp b/src/dos/dos_programs.cpp index 668069c7..fc3fdd9c 100644 --- a/src/dos/dos_programs.cpp +++ b/src/dos/dos_programs.cpp @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* $Id: dos_programs.cpp,v 1.39 2005-08-08 13:33:45 c2woody Exp $ */ +/* $Id: dos_programs.cpp,v 1.40 2005-08-11 18:57:48 qbix79 Exp $ */ #include #include @@ -191,6 +191,16 @@ public: WriteOut(MSG_Get("PROGRAM_MOUNT_STATUS_2"),drive,newdrive->GetInfo()); /* check if volume label is given and don't allow it to updated in the future */ if (cmd->FindString("-label",label,true)) newdrive->dirCache.SetLabel(label.c_str(),false); + /* For hard drives set the label to DRIVELETTER_Drive. + * For floppy drives set the label to DRIVELETTER_Floppy. + * This way every drive except cdroms should get a label.*/ + else if(type == "dir") { + label = drive; label += "_DRIVE"; + newdrive->dirCache.SetLabel(label.c_str(),true); + } else if(type == "floppy") { + label = drive; label += "_FLOPPY"; + newdrive->dirCache.SetLabel(label.c_str(),true); + } return; showusage: WriteOut(MSG_Get("PROGRAM_MOUNT_USAGE")); diff --git a/src/dos/drive_iso.cpp b/src/dos/drive_iso.cpp index abeda36a..95ea51d9 100644 --- a/src/dos/drive_iso.cpp +++ b/src/dos/drive_iso.cpp @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* $Id: drive_iso.cpp,v 1.8 2005-07-19 19:45:31 qbix79 Exp $ */ +/* $Id: drive_iso.cpp,v 1.9 2005-08-11 18:57:48 qbix79 Exp $ */ #include #include @@ -265,11 +265,23 @@ bool isoDrive::FindFirst(char *dir, DOS_DTA &dta, bool fcb_findfirst) Bit8u attr; char pattern[ISO_MAXPATHNAME]; dta.GetSearchParams(attr, pattern); - if ((attr & DOS_ATTR_VOLUME) && ((*dir == 0) || fcb_findfirst)) { - // Get Volume Label (DOS_ATTR_VOLUME) and only in basedir - dta.SetResult(discLabel, 0, 0, 0, DOS_ATTR_VOLUME); - return true; + + if (attr == DOS_ATTR_VOLUME) { + if (strlen(discLabel) != 0) { + dta.SetResult(discLabel, 0, 0, 0, DOS_ATTR_VOLUME); + return true; + } else { + DOS_SetError(DOSERR_NO_MORE_FILES); + return false; + } + } else if ((attr & DOS_ATTR_VOLUME) && (*dir == 0) && !fcb_findfirst) { + if (WildFileCmp(discLabel,pattern)) { + // Get Volume Label (DOS_ATTR_VOLUME) and only in basedir and if it matches the searchstring + dta.SetResult(discLabel, 0, 0, 0, DOS_ATTR_VOLUME); + return true; + } } + return FindNext(dta); } diff --git a/src/dos/drive_local.cpp b/src/dos/drive_local.cpp index abe736c0..8e6d144b 100644 --- a/src/dos/drive_local.cpp +++ b/src/dos/drive_local.cpp @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* $Id: drive_local.cpp,v 1.59 2005-07-15 15:23:22 qbix79 Exp $ */ +/* $Id: drive_local.cpp,v 1.60 2005-08-11 18:57:48 qbix79 Exp $ */ #include #include @@ -175,20 +175,17 @@ bool localDrive::FindFirst(char * _dir,DOS_DTA & dta,bool fcb_findfirst) { if (sAttr == DOS_ATTR_VOLUME) { if ( strcmp(dirCache.GetLabel(), "") == 0 ) { - LOG(LOG_DOSMISC,LOG_ERROR)("DRIVELABEL REQUESTED: none present, returned NOLABEL"); - dta.SetResult("NO_LABEL",0,0,0,DOS_ATTR_VOLUME); - return true; +// LOG(LOG_DOSMISC,LOG_ERROR)("DRIVELABEL REQUESTED: none present, returned NOLABEL"); +// dta.SetResult("NO_LABEL",0,0,0,DOS_ATTR_VOLUME); +// return true; + DOS_SetError(DOSERR_NO_MORE_FILES); + return false; } dta.SetResult(dirCache.GetLabel(),0,0,0,DOS_ATTR_VOLUME); return true; } else if ((sAttr & DOS_ATTR_VOLUME) && (*_dir == 0) && !fcb_findfirst) { //should check for a valid leading directory instead of 0 //exists==true if the volume label matches the searchmask and the path is valid - if ( strcmp(dirCache.GetLabel(), "") == 0 ) { - LOG(LOG_DOSMISC,LOG_ERROR)("DRIVELABEL REQUESTED: none present, returned NOLABEL"); - dta.SetResult("NO_LABEL",0,0,0,DOS_ATTR_VOLUME); - return true; - } if (WildFileCmp(dirCache.GetLabel(),tempDir)) { dta.SetResult(dirCache.GetLabel(),0,0,0,DOS_ATTR_VOLUME); return true;