mirror of
https://forge.sourceware.org/marek/gcc.git
synced 2026-02-22 03:47:02 -05:00
contrib: relpath.sh /lib /include [PR119081]
Previously, if the common ancestor of the two paths is / we would print the absolute second argument, but this PR asks for a relative path in that case as well, which makes sense for the libstdc++.modules.json use case. PR libstdc++/119081 contrib/ChangeLog: * relpath.sh: Give relative path even at /.
This commit is contained in:
@@ -59,9 +59,9 @@ while [ "${to#$from}" = "$to" ]; do
|
||||
from=$(dirname $from);
|
||||
back=../$back
|
||||
|
||||
if [ "$from" = "/" ]; then
|
||||
echo $to
|
||||
exit 0
|
||||
if [ "$from" = / ] && [ "${to#/}" = "$to" ]; then
|
||||
echo no common ancestor between $1 and $2 >&2
|
||||
exit 1
|
||||
elif [ "$from" = . ]; then
|
||||
echo no common ancestor between $1 and $2 >&2
|
||||
exit 1
|
||||
|
||||
Reference in New Issue
Block a user