remove empty lines after kernel annotation
authorDobrica Pavlinusic <dpavlin@rot13.org>
Tue, 14 Nov 2017 09:32:13 +0000 (09:32 +0000)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Tue, 14 Nov 2017 09:32:13 +0000 (09:32 +0000)
gpio.pl

diff --git a/gpio.pl b/gpio.pl
index 4b68965..aa7ebb6 100755 (executable)
--- a/gpio.pl
+++ b/gpio.pl
@@ -78,9 +78,7 @@ while(<DATA>) {
 
 die "add pin definition for # $model" unless $pins;
 
-shift(@lines) while ( ! $lines[0] );   # remove empty at beginning
-pop(@lines) while ( ! $lines[-1] );    # remove empty at end
-
+#warn "# lines ",dump( \@lines );
 warn "# pins ",dump($pins);
 
 my $serial_tty;
@@ -129,6 +127,10 @@ warn "# pin_function = ",dump($pin_function);
 
 my @max_len = ( 0,0,0,0 );
 my @line_parts;
+
+shift(@lines) while ( ! $lines[0] );   # remove empty at beginning
+pop(@lines) while ( ! $lines[-1] );    # remove empty at end
+
 foreach my $line (@lines) {
        if ( $line =~ m/^#/ ) {
                push @line_parts, [ $line ] unless $opt_svg && $line =~ m/^###+/; # SVG doesn't display 3rd level comments