summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean Delvare <jdelvare@suse.de>2015-02-04 17:28:47 +0100
committerJean Delvare <jdelvare@suse.de>2015-02-04 17:28:47 +0100
commitfbaa5d8128e3267dc220f9bed47bbbb953e4ea0e (patch)
tree8dc9f48437e28c67322904cdcef5a9bba9771033
parent0eb66211dbc203cd3c9e706ac43c11b0daa972ec (diff)
downloadquilt-fbaa5d8128e3267dc220f9bed47bbbb953e4ea0e.tar.gz
setup: Fix removal of "." components in normalize_path
The code was broken in 3 ways: * I forgot to escape the "." so it would match any character. * The g flag is not enough to catch consecutive "." components, because pattern matches can't overlap. * A trailing "." component would not be removed. This fixes commit 3fd706a50b7dbb4f8db6e5db014729db51e6beb0 ("setup: Let normalize_path deal with "."".)
-rw-r--r--quilt/setup.in2
1 files changed, 1 insertions, 1 deletions
diff --git a/quilt/setup.in b/quilt/setup.in
index b87c967..4fed444 100644
--- a/quilt/setup.in
+++ b/quilt/setup.in
@@ -75,7 +75,7 @@ check_for_existing_files()
normalize_path()
{
echo "$1" | sed -r -e 's://:/:g' \
- -e 's:/./:/:g' \
+ -e 's:/\.(/\.)*(/|$):\2:g' \
-e ':again' \
-e 's:/[^/]+/\.\.(/|$):\1:g' \
-e 'tagain'