1
0
Fork 0

Fix renaming of directories not detecting existence directory

Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@3363
This commit is contained in:
Sjoerd van der Berg 2009-04-26 19:13:32 +00:00
parent 3ac8b9963b
commit 4263c9a9df

View file

@ -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 <string.h>
#include <stdlib.h>
@ -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;
}