From de1d2363664cb19abf689a2af4538613b8c81e6e Mon Sep 17 00:00:00 2001 From: terminx Date: Sat, 25 Oct 2014 03:35:05 +0000 Subject: [PATCH] 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 --- polymer/eduke32/build/src/osd.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/polymer/eduke32/build/src/osd.c b/polymer/eduke32/build/src/osd.c index 974ae9576..81fa6fd11 100644 --- a/polymer/eduke32/build/src/osd.c +++ b/polymer/eduke32/build/src/osd.c @@ -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);