summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean Delvare <jdelvare@suse.de>2012-12-18 18:14:43 +0100
committerJean Delvare <jdelvare@suse.de>2012-12-18 18:14:43 +0100
commit564b2af4cdd2d6c7e3d18dbb57609520ef3f5e85 (patch)
tree8d9ef048108d9557894445e83357681bd49398d0
parent5c1fda67244d1d516e12e757c0c09e729c0b73aa (diff)
downloadquilt-564b2af4cdd2d6c7e3d18dbb57609520ef3f5e85.tar.gz
remove-trailing-ws: Undefine $file at the end of every file
It should make no difference if the parser is right, but will make it easier to spot bugs in said parser.
-rw-r--r--quilt/scripts/remove-trailing-ws.in2
1 files changed, 2 insertions, 0 deletions
diff --git a/quilt/scripts/remove-trailing-ws.in b/quilt/scripts/remove-trailing-ws.in
index 9e40707..a388314 100644
--- a/quilt/scripts/remove-trailing-ws.in
+++ b/quilt/scripts/remove-trailing-ws.in
@@ -48,6 +48,7 @@ while (<>) {
print unless $opt_n;
if (/^--- ./) {
# unified diff
+ $file = undef;
while (<>) {
print unless $opt_n;
if (/^\+\+\+ (.+?)(?:[ \t][^\t]*)?$/) {
@@ -81,6 +82,7 @@ while (<>) {
}
} elsif (/^\*\*\* ./) {
# context diff
+ $file = undef;
while (<>) {
print unless $opt_n;
if ($file && /^--- (\d+)(?:,(\d+))? ----$/) {