mirror of
https://github.com/ZDoom/Raze.git
synced 2025-01-31 04:20:42 +00:00
Minor OSD_Exec() tweaks that got lost when chopping up a larger set of changes
git-svn-id: https://svn.eduke32.com/eduke32@4678 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
1e2fdef0e2
commit
de1d236366
1 changed files with 4 additions and 2 deletions
|
@ -198,15 +198,17 @@ int32_t OSD_Exec(const char *szScript)
|
|||
int32_t i, len, err = 0;
|
||||
char *buf = NULL, *cp;
|
||||
|
||||
OSD_Printf("Executing \"%s\"\n", szScript);
|
||||
|
||||
if ((i = kopen4load(szScript, 0)) == -1) err = 1;
|
||||
if (!err && (len = kfilelength(i)) <= 0) err = 2; // blank file
|
||||
if (!err && (buf = (char *)Xmalloc(len + 1)) == NULL) err = 3;
|
||||
|
||||
if (!err || err == 3)
|
||||
OSD_Printf("Executing \"%s\"\n", szScript);
|
||||
|
||||
if (err || kread(i, buf, len) != len)
|
||||
{
|
||||
if (err < 3) // no error message for blank file
|
||||
if (!err || err == 3) // no error message for blank file
|
||||
OSD_Printf("Error executing \"%s\"!\n", szScript);
|
||||
if (i != -1) kclose(i);
|
||||
if (buf != NULL) Bfree(buf);
|
||||
|
|
Loading…
Reference in a new issue