[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Quilt-dev] [PATCH] setup: Fix a corner case in create_symlink
From: |
Jean Delvare |
Subject: |
[Quilt-dev] [PATCH] setup: Fix a corner case in create_symlink |
Date: |
Tue, 03 Feb 2015 21:02:20 +0100 |
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
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Quilt-dev] [PATCH] setup: Fix a corner case in create_symlink,
Jean Delvare <=