git-svn-id: https://svn.eduke32.com/eduke32@819 1a8010ca-5511-0410-912e-c29ae57300e0

This commit is contained in:
terminx 2008-06-30 00:32:05 +00:00
parent f6999157f7
commit 2b6f413f9c
2 changed files with 11 additions and 11 deletions

View file

@ -24,7 +24,7 @@ typedef struct _symbol
extern symbol_t *symbols; extern symbol_t *symbols;
#define OSD_ALIAS 0x1337 #define OSD_ALIAS 1337
#define OSDCMD_OK 0 #define OSDCMD_OK 0
#define OSDCMD_SHOWHELP 1 #define OSDCMD_SHOWHELP 1

View file

@ -218,23 +218,23 @@ static int _internal_osdfunc_alias(const osdfuncparm_t *parm)
} }
for (i=symbols; i!=NULL; i=i->next) 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) if (i->func == (void *)OSD_ALIAS)
OSD_Printf("alias %s \"%s\"\n", i->name, i->help); OSD_Printf("alias %s \"%s\"\n", i->name, i->help);
else OSD_Printf("%s is a function, not an alias\n",i->name); else OSD_Printf("%s is a function, not an alias\n",i->name);
}
return OSDCMD_OK; return OSDCMD_OK;
} }
if (i != NULL && !Bstrcasecmp(parm->parms[0],i->name) && i->func != (void *)OSD_ALIAS) if (i->func != (void *)OSD_ALIAS)
{ {
OSD_Printf("Cannot override function \"%s\" with alias\n",i->name); OSD_Printf("Cannot override function \"%s\" with alias\n",i->name);
return OSDCMD_OK; return OSDCMD_OK;
} }
} }
}
OSD_RegisterFunction(Bstrdup(parm->parms[0]),Bstrdup(parm->parms[1]),(void *)OSD_ALIAS); OSD_RegisterFunction(Bstrdup(parm->parms[0]),Bstrdup(parm->parms[1]),(void *)OSD_ALIAS);
OSD_Printf("%s\n",parm->raw); OSD_Printf("%s\n",parm->raw);
@ -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); OSD_Printf("OSD_RegisterFunction(): \"%s\" is already defined\n", name);
return -1; return -1;
} }
// Bfree(symb->help); Bfree((char *)symb->help);
symb->help = help; symb->help = help;
symb->func = func; return 0;
} }
symb = addnewsymbol(name); symb = addnewsymbol(name);