summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean Delvare <khali@linux-fr.org>2007-02-22 09:19:25 +0000
committerJean Delvare <khali@linux-fr.org>2007-02-22 09:19:25 +0000
commit25e2a6ed62f686d304f81f24ec0317eb1d273032 (patch)
tree30074df6122cae10770248e2fd8e3f782563a115
parent231705824f9bd2dbab1d5e8fa296668924f72c52 (diff)
downloadquilt-25e2a6ed62f686d304f81f24ec0317eb1d273032.tar.gz
- quilt/scripts/patchfns.in: Fix an off-by-one error in
change_db_strip_level when inserting the strip level in the patch argument list. Also cleanup this function a bit.
-rw-r--r--quilt.changes7
-rw-r--r--quilt/scripts/patchfns.in16
2 files changed, 16 insertions, 7 deletions
diff --git a/quilt.changes b/quilt.changes
index 0934032..924e700 100644
--- a/quilt.changes
+++ b/quilt.changes
@@ -1,4 +1,11 @@
-------------------------------------------------------------------
+Thu Feb 22 10:11:34 CET 2007 - khali@linux-fr.org
+
+- quilt/scripts/patchfns.in: Fix an off-by-one error in
+ change_db_strip_level when inserting the strip level in the
+ patch argument list. Also cleanup this function a bit.
+
+-------------------------------------------------------------------
Wed Feb 21 21:29:29 CET 2007 - khali@linux-fr.org
- quilt/import.in, quilt/scripts/patchfns.in: Implement import -R
diff --git a/quilt/scripts/patchfns.in b/quilt/scripts/patchfns.in
index 1c87139..070ee3a 100644
--- a/quilt/scripts/patchfns.in
+++ b/quilt/scripts/patchfns.in
@@ -185,10 +185,15 @@ change_db_strip_level()
$j=$(j+1)
NF--
}
+ function insert_arg(nr, value, j) {
+ for (j=NF; j>=nr; j--)
+ $(j+1)=$j
+ $nr=value
+ }
+
/^'"$(quote_re $patch)"'([ \t]|$)/ \
{ p_printed=0
- for (i=2; i<=NF; i++) {
- if ($i ~ /^#/) break
+ for (i=2; i<=NF && $i !~ /^#/; i++) {
if ($i ~ /^-p/) {
if ("'"$level"'" == "")
remove_arg(i--)
@@ -202,11 +207,8 @@ change_db_strip_level()
continue
}
}
- if (!p_printed && "'"$level"'" != "") {
- for (j=NF; j>i; j--)
- $(j+1)=$j
- $i="'"$level"'"
- }
+ if (!p_printed && "'"$level"'" != "")
+ insert_arg(2, "'"$level"'")
}
{ print }
' $SERIES > $tmpfile