From 1ba2fac03d611ca2955e1c019c9cc9189fd2920b Mon Sep 17 00:00:00 2001 From: Daniel Shahaf Date: Wed, 2 Sep 2015 15:33:22 +0000 Subject: 36403: type -w += suffix alias This makes 'type -w' distinguish suffix aliases from regular aliases, like bare 'type' already does. Use-case: detecting programmatically whether the command word is indeed a valid command word (see ) --- Src/hashtable.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'Src/hashtable.c') diff --git a/Src/hashtable.c b/Src/hashtable.c index 90739a882..2d1ff87cb 100644 --- a/Src/hashtable.c +++ b/Src/hashtable.c @@ -1234,7 +1234,10 @@ printaliasnode(HashNode hn, int printflags) } if (printflags & PRINT_WHENCE_WORD) { - printf("%s: alias\n", a->node.nam); + if (a->node.flags & ALIAS_SUFFIX) + printf("%s: suffix alias\n", a->node.nam); + else + printf("%s: alias\n", a->node.nam); return; } -- cgit 1.4.1