sh: Don't hash alias name when there are no aliases.

This commit is contained in:
Jilles Tjoelker 2016-02-21 20:58:24 +00:00
parent 8be85b352b
commit 2ece338651

View File

@ -144,9 +144,11 @@ rmaliases(void)
struct alias *
lookupalias(const char *name, int check)
{
struct alias *ap = *hashalias(name);
struct alias *ap;
for (; ap; ap = ap->next) {
if (aliases == 0)
return (NULL);
for (ap = *hashalias(name); ap; ap = ap->next) {
if (equal(name, ap->name)) {
if (check && (ap->flag & ALIASINUSE))
return (NULL);