Fix bug where some man pages would fail to open

Some man page sections contain alphabetical characters (e.g. 3bsd,
3perl, 3ssl.) This fixes a bug where selection of such pages would
not open any man page.
This commit is contained in:
Eoin Mcloughlin 2022-08-20 21:18:13 +01:00 committed by Ethan P
parent 3917100c6e
commit e9daffde45

View File

@ -60,7 +60,7 @@ if [[ "${#MAN_ARGS[@]}" -eq 0 ]] && [[ -z "$BATMAN_LEVEL" ]] && command -v "$EXE
# Convert the page(section) format to something that can be fed to the man command.
while read -r line; do
if [[ "$line" =~ ^(.*)\(([0-9]+)\)$ ]]; then
if [[ "$line" =~ ^(.*)\(([0-9a-zA-Z]+)\)$ ]]; then
MAN_ARGS+=("${BASH_REMATCH[2]}" "$(echo ${BASH_REMATCH[1]} | xargs)")
fi
done <<< "$selected_page"