summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Krebbel <krebbel@linux.vnet.ibm.com>2012-12-18 18:14:42 +0100
committerJean Delvare <jdelvare@suse.de>2012-12-18 18:14:42 +0100
commit4de44512ba606c687158a0e58e94429c03e94d41 (patch)
tree8d7d41c8404330ff4ccfc9c91541d4bdaf04e363
parentaa6b59cdbdd167dfb035f5c69ea106f145676f54 (diff)
downloadquilt-4de44512ba606c687158a0e58e94429c03e94d41.tar.gz
remove-trailing-ws: Fix parsing of some context diffs
the script for trailing whitespace removal fails for me if a context diff has an "delete-only" chunk at the end. The following patch fixes this for me. [JD: Add one more check for when the "delete-only" chunk is not at the end.]
-rw-r--r--quilt/scripts/remove-trailing-ws.in5
1 files changed, 2 insertions, 3 deletions
diff --git a/quilt/scripts/remove-trailing-ws.in b/quilt/scripts/remove-trailing-ws.in
index c6c2194..9e40707 100644
--- a/quilt/scripts/remove-trailing-ws.in
+++ b/quilt/scripts/remove-trailing-ws.in
@@ -88,14 +88,13 @@ while (<>) {
my $last_line = defined $2 ? $2 : $1;
while ($line_number <= $last_line) {
$_ = <>;
- defined $_
- or die sprintf(_("%s: I'm confused.\n"), $0);
+ defined $_ or last;
if (s/(^[+!] .*?)[ \t]+$/$1/) {
push @{$files{$file}}, $line_number;
}
$line_number++;
print unless $opt_n;
- last if (/^\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*$/);
+ last if (/^\*\*\*[* ]/);
}
} elsif (/^--- (.+?)(?:[ \t][^\t]*)?$/) {
$file = $1;