Commit b0b109a0 authored by Natanael Copa's avatar Natanael Copa

setup-apkcache: fix infinite loop when non-existing dir specified

to reproduce: setup-apkcache /ponies

ref #3976
parent 34d5c6cd
......@@ -47,10 +47,10 @@ find_mount_point() {
fi
local dir="$1"
while ! [ -d "$dir" ]; do
while [ -n "$dir" ] && ! [ -d "$dir" ]; do
dir=${dir%/*}
done
local fs_id=$(stat -f -c %i "$dir")
local fs_id=$(stat -f -c %i "${dir:-/}")
local parent="${dir%/*}"
while [ -n "$dir" ] && [ "$(stat -f -c %i $parent/)" = "$fs_id" ]; do
dir=$parent
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment