Skip to content

Commit

Permalink
kshrc.sh: better macOS workaround for env(1)
Browse files Browse the repository at this point in the history
  • Loading branch information
McDutchie committed Mar 24, 2024
1 parent 05e0ee3 commit f4f25eb
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/cmd/ksh93/kshrc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,17 @@ then
darwin.*,s)
function env
{
command -p env "DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH" "$@"
typeset -a opts
typeset -si i=0
while [[ $1 == -* && $1 != -- ]]
do opts[i++]=$1
case $1 in
-u | -S | -P)
(($# > 1)) && opts[i++]=$2 && shift ;;
esac
shift
done
command -p env "${opts[@]}" "DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH" "$@"
}
;;
esac
Expand Down

0 comments on commit f4f25eb

Please sign in to comment.