From 626dfa051b078aaa25af0bca23c01f5604c0fa66 Mon Sep 17 00:00:00 2001 From: lxoliva Date: Tue, 23 Feb 2010 22:43:46 +0000 Subject: [PATCH] Issue end-of-hunk and end-of-file marks at the end of patches. git-svn-id: http://www.fsfla.org/svn/fsfla/software/linux-libre/scripts@6582 559672b5-ba27-0410-b829-e8f1faed8b1b --- deblob-check | 30 +++++++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/deblob-check b/deblob-check index 066d2794cbcb..2ad24eb185ec 100755 --- a/deblob-check +++ b/deblob-check @@ -1,6 +1,6 @@ #! /bin/sh -# deblob-check version 2010-02-23 +# deblob-check version 2010-02-23a # Inspired in gNewSense's find-firmware script. # Written by Alexandre Oliva @@ -4400,7 +4400,7 @@ BAD regular expression: s=+ r=- fi sedpatch=" - /^[$r]/d; + /^[$r]/b testlastline; # /^[*!]/ { # s,^,context diffs are not properly supported\\n,; # W /dev/stderr @@ -4453,7 +4453,31 @@ BAD regular expression: p; d; } - s,^[ !$s],,;" + s,^[ !$s],, + p; + :testlastline + $ { + x; + /^@@ /{ + s,^,;/*end ,; + s,\\([\\n]\\|$\\),*/;&,; + i\\ +;/**/; + + P; + s,^[^\\n]*\\([\\n]\\|$\\),,; + } + /^$s$s$s /{ + s,^$s$s$s,;/*end,; + s,\\([\\n]\\|$\\),*/;&,; + i\\ + + P; + s,^[^\\n]*\\([\\n]\\|$\\),,; + } + x; + } + d;" cmd='${SED-sed} "$sedpatch"' ;; *) -- 2.31.1