From 6ef13ed762670291fb83915c1fbd83e76090e678 Mon Sep 17 00:00:00 2001 From: Kyle Neideck Date: Thu, 31 Mar 2022 15:33:43 +1100 Subject: [PATCH] Fix an infinite loop in safe_install_dir.sh. `pwd -P` was returning `//some/path` and the condition `[[ "${PWD}" == / ]]` would end up as `[[ // == / ]]` and get stuck. --- BGMApp/BGMXPCHelper/safe_install_dir.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BGMApp/BGMXPCHelper/safe_install_dir.sh b/BGMApp/BGMXPCHelper/safe_install_dir.sh index 3daff80a..35479a77 100755 --- a/BGMApp/BGMXPCHelper/safe_install_dir.sh +++ b/BGMApp/BGMXPCHelper/safe_install_dir.sh @@ -84,7 +84,7 @@ check_dir() { [[ $((0$(stat -f '%Lp' .) & 0022)) -eq 0 ]]; do # ...go upwards until we reach the root directory. cd .. - if [[ "${PWD}" == / ]]; then + if [[ "${PWD}" -ef / ]]; then DIR_IS_SAFE=1 break fi