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
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=295868

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);