quilt-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Quilt-dev] [PATCH] setup: Fix removal of "." components in normalize_pa


From: Jean Delvare
Subject: [Quilt-dev] [PATCH] setup: Fix removal of "." components in normalize_path
Date: Tue, 03 Feb 2015 20:59:42 +0100

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 "."".)
---
 quilt/setup.in |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- 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'

-- 
Jean Delvare
SUSE L3 Support




reply via email to

[Prev in Thread] Current Thread [Next in Thread]