From 2b6f413f9c1b890be95e268b0d599b0f03ebe2ec Mon Sep 17 00:00:00 2001 From: terminx Date: Mon, 30 Jun 2008 00:32:05 +0000 Subject: [PATCH] git-svn-id: https://svn.eduke32.com/eduke32@819 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/build/include/osd.h | 2 +- polymer/build/src/osd.c | 20 ++++++++++---------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/polymer/build/include/osd.h b/polymer/build/include/osd.h index 9b8b3457c..1361e2b29 100644 --- a/polymer/build/include/osd.h +++ b/polymer/build/include/osd.h @@ -24,7 +24,7 @@ typedef struct _symbol extern symbol_t *symbols; -#define OSD_ALIAS 0x1337 +#define OSD_ALIAS 1337 #define OSDCMD_OK 0 #define OSDCMD_SHOWHELP 1 diff --git a/polymer/build/src/osd.c b/polymer/build/src/osd.c index 9d1dbf59b..d7918b55e 100644 --- a/polymer/build/src/osd.c +++ b/polymer/build/src/osd.c @@ -219,20 +219,20 @@ static int _internal_osdfunc_alias(const osdfuncparm_t *parm) for (i=symbols; i!=NULL; i=i->next) { - if (parm->numparms < 2) + if (!Bstrcasecmp(parm->parms[0],i->name)) { - if (!Bstrcasecmp(parm->parms[0],i->name)) + if (parm->numparms < 2) { if (i->func == (void *)OSD_ALIAS) OSD_Printf("alias %s \"%s\"\n", i->name, i->help); else OSD_Printf("%s is a function, not an alias\n",i->name); + return OSDCMD_OK; + } + if (i->func != (void *)OSD_ALIAS) + { + OSD_Printf("Cannot override function \"%s\" with alias\n",i->name); + return OSDCMD_OK; } - return OSDCMD_OK; - } - if (i != NULL && !Bstrcasecmp(parm->parms[0],i->name) && i->func != (void *)OSD_ALIAS) - { - OSD_Printf("Cannot override function \"%s\" with alias\n",i->name); - return OSDCMD_OK; } } @@ -1270,9 +1270,9 @@ int OSD_RegisterFunction(const char *name, const char *help, int (*func)(const o OSD_Printf("OSD_RegisterFunction(): \"%s\" is already defined\n", name); return -1; } -// Bfree(symb->help); + Bfree((char *)symb->help); symb->help = help; - symb->func = func; + return 0; } symb = addnewsymbol(name);