Commit 695f2c70 695f2c707ba10fd67f2170c55112874ca5ad48c0 by Sergey Poznyakoff

fixed install part of alias_lookup_or_install()

1 parent f4a0c376
......@@ -120,6 +120,7 @@ alias_t *
alias_lookup_or_install(char *name, int install)
{
unsigned i, pos;
alias_t *slot = NULL;
if (!aliases)
{
......@@ -138,8 +139,8 @@ alias_lookup_or_install(char *name, int install)
{
if (aliases[i].name == NULL)
{
if (install)
return &aliases[i];
if (!slot && install)
slot = &aliases[i];
}
else if (strcmp(aliases[i].name, name) == 0)
return &aliases[i];
......@@ -152,6 +153,9 @@ alias_lookup_or_install(char *name, int install)
if (!install)
return NULL;
if (slot)
return slot;
if (alias_rehash())
return NULL;
......