diff options
author | Wolfram Schneider <wosch@FreeBSD.org> | 2024-05-20 16:02:21 +0000 |
---|---|---|
committer | Wolfram Schneider <wosch@FreeBSD.org> | 2024-05-20 16:02:21 +0000 |
commit | 37be4197f72ae3a61bd5e93d2ebdc9bd6d09ed21 (patch) | |
tree | 3c8119bd64029369c0215b4f04c4215cd762a03b | |
parent | 6edb14c006f6eafe1f31f54ce7fe2158321fa18d (diff) |
man: the exists function needs to validate the first parameter
This fixes an issue with the ".so " macro for FreeBSD
ports manual pages.
PR: 275978
Reported by: Jamie Landeg-Jones <jamie@catflap.org>
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D45231 (discussion)
-rwxr-xr-x | usr.bin/man/man.sh | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/usr.bin/man/man.sh b/usr.bin/man/man.sh index 03803b777463..af638527f497 100755 --- a/usr.bin/man/man.sh +++ b/usr.bin/man/man.sh @@ -201,6 +201,10 @@ decho() { # Returns true if glob resolves to a real file and store the first # found filename in the variable $found exists() { + if [ -z "$1" ]; then + return 1 + fi + local IFS # Don't accidentally inherit callers IFS (breaks perl manpages) |