Skip to content

Commit

Permalink
fun/man: suppress spurious error msg
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
McDutchie committed Sep 15, 2023
1 parent f69bc30 commit c0fa69c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/cmd/ksh93/fun/man
Original file line number Diff line number Diff line change
Expand Up @@ -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'* ]]
}
Expand Down

0 comments on commit c0fa69c

Please sign in to comment.