From 306e90392921d984e928ef87a43a3c392019fd46 Mon Sep 17 00:00:00 2001 From: Dobrica Pavlinusic Date: Fri, 10 Nov 2017 17:21:10 +0100 Subject: [PATCH] remove empty lines at beginng/end and draw last line/cut mark --- gpio.pl | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/gpio.pl b/gpio.pl index 5b49c16..d9fffeb 100755 --- a/gpio.pl +++ b/gpio.pl @@ -49,8 +49,6 @@ while() { } else { $include = 0; } - } elsif ( m/^#\s+/ ) { - $include = 1; } elsif ( $include ) { push @{ $pins->{$1} }, $line_i while ( m/\t(\w+\d+)/g ); @@ -62,6 +60,9 @@ while() { } } +shift(@lines) while ( ! $lines[0] ); # remove empty at beginning +pop(@lines) while ( ! $lines[-1] ); # remove empty at end + die "add pin definition for # $model" unless $pins; warn "# pins ",dump($pins); @@ -322,6 +323,10 @@ foreach my $i ( 0 .. $#line_parts ) { } if ( $opt_svg ) { + cut_mark $x,$y; + cut_mark $max_x,$y; + line $x, $y, $max_x if $opt_lines; + print qq{