[Git][ghc/ghc][master] mk/relpath: Fix quoting

Marge Bot (@marge-bot) gitlab at gitlab.haskell.org
Tue Mar 19 18:52:47 UTC 2024



Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC


Commits:
cf55a54b by Ben Gamari at 2024-03-19T14:51:12-04:00
mk/relpath: Fix quoting

Previously there were two instances in this script which lacked proper
quoting. This resulted in `relpath` invocations in the binary
distribution Makefile producing incorrect results on Windows, leading to
confusing failures from `sed` and the production of empty package
registrations.

Fixes #24538.

- - - - -


1 changed file:

- mk/relpath.sh


Changes:

=====================================
mk/relpath.sh
=====================================
@@ -15,7 +15,7 @@ target="$2"
 common_part="$src"
 result=""
 
-while test "${target#$common_part}" = "${target}" ; do
+while test "${target#"$common_part"}" = "${target}" ; do
     #echo "common_part is now : \"$common_part\""
     #echo "result is now      : \"$result\""
     #echo "target#common_part : \"${target#$common_part}\""
@@ -39,7 +39,7 @@ fi
 
 # since we now have identified the common part,
 # compute the non-common part
-forward_part="${target#$common_part}"
+forward_part="${target#"$common_part"}"
 #echo "forward_part = \"$forward_part\""
 
 if test -n "$result" && test -n "$forward_part" ; then



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/cf55a54b1aec7a533a4e409b01d08f4923348fa8

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/cf55a54b1aec7a533a4e409b01d08f4923348fa8
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20240319/a2c07e16/attachment-0001.html>


More information about the ghc-commits mailing list