Mercurial > hg > openttd
changeset 14915:924ff198af05 draft
(svn r19512) -Fix (r19511): using the 'alias' console command it's possible to create a duplicate alias name
author | yexo <yexo@openttd.org> |
---|---|
date | Wed, 24 Mar 2010 11:20:30 +0000 |
parents | 4a82d6b2d48a |
children | 3fe6183f468a |
files | src/console.cpp |
diffstat | 1 files changed, 5 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/src/console.cpp +++ b/src/console.cpp @@ -261,6 +261,11 @@ */ void IConsoleAliasRegister(const char *name, const char *cmd) { + if (IConsoleAliasGet(name) != NULL) { + IConsoleError("an alias with this name already exists; insertion aborted"); + return; + } + char *new_alias = strdup(name); char *cmd_aliased = strdup(cmd); IConsoleAlias *item_new = MallocT<IConsoleAlias>(1);