mirror of
https://github.com/facebook/zstd.git
synced 2025-10-05 00:07:15 -04:00
Add Fallback When realpath Doesn't Support --relative-to
This commit is contained in:
parent
c7cba8e87c
commit
6381b7ee3f
@ -72,7 +72,11 @@ resolve_include() {
|
||||
local inc=$2
|
||||
for root in $srcdir $ROOTS; do
|
||||
if [ -f "$root/$inc" ]; then
|
||||
echo "$(realpath --relative-to . "$root/$inc")"
|
||||
local relpath="$(realpath --relative-to . "$root/$inc")"
|
||||
if [ "$?" -eq "0" ]; then # not all realpaths support --relative-to
|
||||
relpath="$(realpath "$root/$inc")"
|
||||
fi
|
||||
echo "$relpath"
|
||||
return 0
|
||||
fi
|
||||
done
|
||||
|
Loading…
x
Reference in New Issue
Block a user