Subject: [PATCH 11/14] checkbashisms: improve handling of line continuations

From: Raphael Geissert <[email-masked]>
Date: Thu, 13 May 2010 09:43:26 -0500

Signed-off-by: Raphael Geissert <[email-masked]>
---
 scripts/checkbashisms.pl |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/scripts/checkbashisms.pl b/scripts/checkbashisms.pl
index 1eeda6a..fead788 100755
--- a/scripts/checkbashisms.pl
+++ b/scripts/checkbashisms.pl
@@ -105,6 +105,7 @@ foreach my $filename (@ARGV) {
     my $last_continued = 0;
     my $continued = 0;
     my $found_rules = 0;
+    my $buffered_orig_line = "";
     my $buffered_line = "";
 
     while (<C>) {
@@ -175,12 +176,15 @@ foreach my $filename (@ARGV) {
 	if (!$makefile && $cat_string eq '' && m/\\$/) {
 	    chop;
 	    $buffered_line .= $_;
+	    $buffered_orig_line .= $orig_line . "\n";
 	    next;
 	}
 
 	if ($buffered_line ne '') {
 	    $_ = $buffered_line . $_;
+	    $orig_line = $buffered_orig_line . $orig_line;
 	    $buffered_line ='';
+	    $buffered_orig_line ='';
 	}
 
 	if ($makefile) {
-- 
1.7.1