Only throw a recursion error if the command matches the alias name exactly

This commit is contained in:
James Vega 2003-11-04 17:39:32 +00:00
parent 8b6783ea55
commit 863aeb3b4f

View File

@ -98,7 +98,7 @@ class RecursiveAlias(AliasError):
def findAliasCommand(s, alias): def findAliasCommand(s, alias):
s = re.escape(s) s = re.escape(s)
r = re.compile(r'(?:(^|\[)\s*%s|\|\s*%s)' % (s, s)) r = re.compile(r'(?:(^|\[)\s*\b%s\b|\|\s*\b%s\b)' % (s, s))
return bool(r.search(alias)) return bool(r.search(alias))
dollarRe = re.compile(r'\$(\d+)') dollarRe = re.compile(r'\$(\d+)')