Skip to content

Commit 7e80461

Browse files
authored
[thisroot] fix infinite loop
1 parent 8783ada commit 7e80461

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

config/thisroot.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,8 @@ getTrueShellExeName() { # mklement0 https://stackoverflow.com/a/23011530/7471760
194194
# on MacOS, sh is NOT a symlink but an executable, so trueExe is 'sh' but it will
195195
# re-exec according to symlink at /private/var/select/sh, so resolve it
196196
if [ -L "/private/var/select/sh" ] && [ -e "/private/var/select/sh" ] ; then
197-
while nextTarget=$(readlink "/private/var/select/sh"); do trueExe=$nextTarget; done
197+
trueExe="/private/var/select/sh";
198+
while nextTarget=$(readlink "$trueExe"); do trueExe=$nextTarget; done
198199
else
199200
# otherwise default to bash
200201
trueExe="/bin/bash"

0 commit comments

Comments
 (0)