Subversion Repositories eduke32

Rev

Rev 5542 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 5542 Rev 5558
Line 200... Line 200...
200
int32_t OSD_Exec(const char *szScript)
200
int32_t OSD_Exec(const char *szScript)
201
{
201
{
202
    int32_t i, len, err = 0;
202
    int32_t i, len, err = 0;
203
    char *buf = NULL;
203
    char *buf = NULL;
204
204
205
    if ((i = kopen4load(szScript, 0)) == -1) err = 1;
205
    if ((i = kopen4load(szScript, 0)) == -1)
-
 
206
        err = 1;
206
    if (!err && (len = kfilelength(i)) <= 0) err = 2; // blank file
207
    else if ((len = kfilelength(i)) <= 0)
-
 
208
        err = 2; // blank file
207
    if (!err && (buf = (char *)Xmalloc(len + 1)) == NULL) err = 3;
209
    else if ((buf = (char *)Xmalloc(len + 1)) == NULL)
-
 
210
        err = 3;
208
211
209
    if (!err || err == 3)
212
    if (!err || err == 3)
210
        OSD_Printf("Executing \"%s\"\n", szScript);
213
        OSD_Printf("Executing \"%s\"\n", szScript);
211
214
212
    if (err || kread(i, buf, len) != len)
215
    if (err || kread(i, buf, len) != len)