Author: jilles
Date: Sun Feb 21 20:58:24 2016
New Revision: 295868
URL: https://svnweb.freebsd.org/changeset/base/295868

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

Modified:
  head/bin/sh/alias.c

Modified: head/bin/sh/alias.c
==============================================================================
--- head/bin/sh/alias.c Sun Feb 21 18:58:05 2016        (r295867)
+++ head/bin/sh/alias.c Sun Feb 21 20:58:24 2016        (r295868)
@@ -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);
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to