The following commit has been merged in the master branch:
commit 4bd64209c0b3fc8ce7a4bd47122219b97a96b5d0
Author: James McCoy <[email protected]>
Date:   Sat Feb 25 19:52:46 2012 -0500

    dcmd: Escape directory name so it doesn't interfere with sed command.
    
    Closes: #649227
    Signed-off-by: James McCoy <[email protected]>

diff --git a/debian/changelog b/debian/changelog
index 43b809e..3e2ff3a 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -15,6 +15,8 @@ devscripts (2.11.5) UNRELEASED; urgency=low
   [ James McCoy ]
   * dd-list: Fix correlation of given package name when it does not match the
     source package name.  (Closes: #655854)
+  * dcmd: Escape directory name so it doesn't interfere with sed command.
+    (Closes: #649227)
 
  -- Adam D. Barratt <[email protected]>  Wed, 15 Feb 2012 19:40:58 +0000
 
diff --git a/scripts/dcmd.sh b/scripts/dcmd.sh
index 5577013..72289e2 100755
--- a/scripts/dcmd.sh
+++ b/scripts/dcmd.sh
@@ -64,7 +64,9 @@ maybe_expand()
     local dir
     local sedre
     if [ -e "$1" ] && (endswith "$1" .changes || endswith "$1" .dsc); then
-       dir=$(dirname "$1")
+       # Need to escape whatever separator is being used in sed expression so
+       # it doesn't prematurely end the s command
+       dir=$(dirname "$1" | sed 's/,/\\,/g')
        if [ "$(echo "$1" | cut -b1-2)" != "./" ]; then
            sedre="\."
        fi

-- 
Git repository for devscripts


-- 
To unsubscribe, send mail to [email protected].

Reply via email to