quilt-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Quilt-dev] [PATCH] remove-trailing-ws: Undefine $file at the end of eve


From: Jean Delvare
Subject: [Quilt-dev] [PATCH] remove-trailing-ws: Undefine $file at the end of every file
Date: Fri, 14 Dec 2012 15:36:49 +0100

It should make no difference if the parser is right, but will make it
easier to spot bugs in said parser.
---
 quilt/scripts/remove-trailing-ws.in |    2 ++
 1 file changed, 2 insertions(+)

--- 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+))? ----$/) {

-- 
Jean Delvare
Suse L3




reply via email to

[Prev in Thread] Current Thread [Next in Thread]