When a link's target is the directory it lives in, create_symlink
would erroneously link to "..". Fix the code to properly link to "."
instead.

This fixes openSUSE bug #916007:
https://bugzilla.opensuse.org/show_bug.cgi?id=916007

Credits to Robert Milasan for spotting the bug.
---
 quilt/setup.in |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/quilt/setup.in
+++ b/quilt/setup.in
@@ -97,7 +97,7 @@ create_symlink()
        do
                set -- "${1#*/}" "${2#*/}"
        done
-       up=$(echo "${2%/*}" | sed -re 's:[^/]+:..:g')
+       up=$(echo "$2" | sed -r -e 's:(^|/)[^/]*$::' -e 's:[^/]+:..:g')
        set -- "${up:+$up/}$1"
        set -- "${1%/}"
        ln -s "${1:-.}" "$link"

-- 
Jean Delvare
SUSE L3 Support


_______________________________________________
Quilt-dev mailing list
Quilt-dev@nongnu.org
https://lists.nongnu.org/mailman/listinfo/quilt-dev

Reply via email to