From 648eaeb2a2f1312b9f0ce59e4ae5b720245c1d61 Mon Sep 17 00:00:00 2001 From: Peter Veenstra Date: Fri, 27 Oct 2006 12:03:22 +0000 Subject: [PATCH] Add Beta1 patch: "Require devices to have valid leading directories." Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@2713 --- src/dos/dos_devices.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/dos/dos_devices.cpp b/src/dos/dos_devices.cpp index ed436f10..06fedc32 100644 --- a/src/dos/dos_devices.cpp +++ b/src/dos/dos_devices.cpp @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* $Id: dos_devices.cpp,v 1.13 2006-04-16 14:02:39 qbix79 Exp $ */ +/* $Id: dos_devices.cpp,v 1.14 2006-10-27 12:03:22 qbix79 Exp $ */ #include #include "dosbox.h" @@ -132,6 +132,15 @@ Bit8u DOS_FindDevice(char * name) { char* dot= strrchr(temp,'.'); if(dot && *dot) *dot=0; //no ext checking + char* leading = strrchr(temp,'\\'); + if(leading) { + *leading = 0; + Bit8u drive;char fulldir[DOS_PATHLENGTH]; + if (!DOS_MakeName(temp,fulldir,&drive)) return DOS_DEVICES; + if(!Drives[drive]->TestDir(fulldir)) return DOS_DEVICES; + *leading='\\'; + } + /* loop through devices */ for(Bit8u index = 0;index < DOS_DEVICES;index++) { if (Devices[index]) {