From 4263c9a9df8b712ab2c4e7a7abf454bbc8e2eb2b Mon Sep 17 00:00:00 2001 From: Sjoerd van der Berg Date: Sun, 26 Apr 2009 19:13:32 +0000 Subject: [PATCH] Fix renaming of directories not detecting existence directory Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@3363 --- src/dos/dos_files.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/dos/dos_files.cpp b/src/dos/dos_files.cpp index 2dccf4c7..425ca921 100644 --- a/src/dos/dos_files.cpp +++ b/src/dos/dos_files.cpp @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* $Id: dos_files.cpp,v 1.109 2009-04-17 11:33:51 qbix79 Exp $ */ +/* $Id: dos_files.cpp,v 1.110 2009-04-26 19:13:32 harekiet Exp $ */ #include #include @@ -272,12 +272,13 @@ bool DOS_Rename(char const * const oldname,char const * const newname) { return false; } /*Test if target exists => no access */ - if(Drives[drivenew]->FileExists(fullnew)) { + Bit16u attr; + if(Drives[drivenew]->GetFileAttr(fullnew,&attr)) { DOS_SetError(DOSERR_ACCESS_DENIED); return false; } /* Source must exist, check for path ? */ - if(!Drives[driveold]->FileExists(fullold)) { + if (!Drives[driveold]->GetFileAttr( fullold, &attr ) ) { DOS_SetError(DOSERR_FILE_NOT_FOUND); return false; }