correct error code when dos create file is called with directory bit set (fixes some pkunzip oddity)
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@3103
This commit is contained in:
parent
5bb96c2dba
commit
482d2ab349
1 changed files with 7 additions and 2 deletions
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2002-2007 The DOSBox Team
|
||||
* Copyright (C) 2002-2008 The DOSBox Team
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -16,7 +16,7 @@
|
|||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
/* $Id: dos_files.cpp,v 1.94 2008-01-21 21:26:49 qbix79 Exp $ */
|
||||
/* $Id: dos_files.cpp,v 1.95 2008-02-18 17:45:55 c2woody Exp $ */
|
||||
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
|
@ -426,6 +426,11 @@ bool DOS_CreateFile(char const * name,Bit16u attributes,Bit16u * entry) {
|
|||
DOS_SetError(DOSERR_TOO_MANY_OPEN_FILES);
|
||||
return false;
|
||||
}
|
||||
/* Don't allow directories to be created */
|
||||
if (attributes&0x10) {
|
||||
DOS_SetError(DOSERR_ACCESS_DENIED);
|
||||
return false;
|
||||
}
|
||||
bool foundit=Drives[drive]->FileCreate(&Files[handle],fullname,attributes);
|
||||
if (foundit) {
|
||||
Files[handle]->SetDrive(drive);
|
||||
|
|
Loading…
Add table
Reference in a new issue