From 28be8101d1775667e0d7b3bd297b0f7b28570763 Mon Sep 17 00:00:00 2001 From: Andreas Gruenbacher Date: Mon, 18 Jul 2005 14:55:03 +0000 Subject: - Based on work done by several contributers, add a header command. - Bump version to 0.41. --- scripts/patchfns.in | 37 ++++++++++++++++++++++++------------- 1 file changed, 24 insertions(+), 13 deletions(-) (limited to 'scripts/patchfns.in') diff --git a/scripts/patchfns.in b/scripts/patchfns.in index b46b362..a70cfed 100644 --- a/scripts/patchfns.in +++ b/scripts/patchfns.in @@ -627,21 +627,32 @@ cat_to_new_file() > "$filename" } -patch_description() +patch_header() { - local patch_file=$1 + @AWK@ ' + $1 == "***" || $1 == "---" \ + { exit } + /^Index:[ \t]|^diff[ \t]|^==*$|^RCS file: |^retrieving revision [0-9]+(\.[0-9]+)*$/ \ + { eat = eat $0 "\n" + next } + { print eat $0 + eat = "" } + ' +} - if [ -e "$patch_file" -o -z "$patch_file" ] - then - @AWK@ ' - $1 == "***" || $1 == "---" { exit } - /^Index:[ \t]|^diff[ \t]|^==*$|^RCS file: |^retrieving revision [0-9]+(\.[0-9]+)*$/ \ - { eat = eat $0 "\n" - next } - { print eat $0 - eat = "" } - ' $patch_file - fi +patch_body() +{ + @AWK@ ' + /^Index:[ \t]|^diff[ \t]|^==*$|^RCS file: |^retrieving revision [0-9]+(\.[0-9]+)*$/ \ + { eat = eat $0 "\n" + next } + $1 == "***" || $1 == "---" \ + { body=1 } + body { print eat $0 + eat = "" + next } + { eat = "" } + ' } in_array() -- cgit