From c0fa69c9cb7baa5ab07fd5d830fa5be33ed717d4 Mon Sep 17 00:00:00 2001 From: Martijn Dekker Date: Fri, 15 Sep 2023 03:05:16 +0100 Subject: [PATCH] fun/man: suppress spurious error msg When doing something like 'man src/cmd/ksh93/sh.1', the 'unset -f' in builtin_has_selfdoc() complained of an invalid function name. Just suppress that so it is silently ignored. --- src/cmd/ksh93/fun/man | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cmd/ksh93/fun/man b/src/cmd/ksh93/fun/man index e626b6e2e0b4..538b484a907f 100755 --- a/src/cmd/ksh93/fun/man +++ b/src/cmd/ksh93/fun/man @@ -59,7 +59,7 @@ namespace man builtin_has_selfdoc() { - [[ $(unset -f -- "$1"; whence -t -- "$1") == builtin ]] \ + [[ $(unset -f -- "$1" 2>/dev/null; whence -t -- "$1") == builtin ]] \ && [[ ! $1 =~ ^(:|true|false|echo)$ \ && $'\n'$(builtin)$'\n' == *$'\n'"$(unset -f -- "$1"; whence -- "$1")"$'\n'* ]] }