From 30b04daa8a0d430034c37d009286add6e8745cc9 Mon Sep 17 00:00:00 2001 From: Dan Kessler Date: Fri, 12 Jun 2020 15:04:22 -0400 Subject: [PATCH] append colon (:) to end of brew's part of INFOPATH in brew shellenv The behavior of some programs (e.g., emacs) differs depending on whether INFOPATH is terminated in a colon or not. For example, the info viewer built into emacs has a default list of places from which it will draw info files, and it will only check this if either (a) INFOPATH is unset, or (b) INFOPATH ends in a colon. Currently brew shellenv prepends to the existing $INFOPATH and will separate with a colon if $INFOPATH already exists, but if it does not it will not terminate in a colon. As a result, info pages (like emacs and elisp) are missing from the info viewer. The existing brew shellenv logic used a parameter expansion trick to include a colon only if it was prepending to an extant INFOPATH, but because we want brew's contribution to the INFOPATH to always end in a colon (whether there's an existing INFOPATH or not), we don't have to use the parameter expansion trick This commit only changes behavior for "other" shells (i.e., not fish, csh, or tcsh) since I don't know how to append a colon to variables in these shells. --- Library/Homebrew/cmd/shellenv.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Library/Homebrew/cmd/shellenv.sh b/Library/Homebrew/cmd/shellenv.sh index 4355ce52ea..04d8121daf 100644 --- a/Library/Homebrew/cmd/shellenv.sh +++ b/Library/Homebrew/cmd/shellenv.sh @@ -29,7 +29,7 @@ homebrew-shellenv() { echo "export HOMEBREW_REPOSITORY=\"$HOMEBREW_REPOSITORY\";" echo "export PATH=\"$HOMEBREW_PREFIX/bin:$HOMEBREW_PREFIX/sbin\${PATH+:\$PATH}\";" echo "export MANPATH=\"$HOMEBREW_PREFIX/share/man\${MANPATH+:\$MANPATH}:\";" - echo "export INFOPATH=\"$HOMEBREW_PREFIX/share/info\${INFOPATH+:\$INFOPATH}\";" + echo "export INFOPATH=\"$HOMEBREW_PREFIX/share/info:\${INFOPATH}\";" ;; esac }