From e27c94c1fdcb051db50d4b8bc89a0f9026aa59c8 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Fri, 11 Nov 2011 12:12:52 +0100 Subject: cgi: Start shortening line as well --- cgi/index.pl | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/cgi/index.pl b/cgi/index.pl index db519f6..7fafc4f 100644 --- a/cgi/index.pl +++ b/cgi/index.pl @@ -63,6 +63,14 @@ sub handle_request { ); } +sub shorten_line { + my ($line) = @_; + + $line =~ s{ ^ SB \K \s+ }{}x; + + return $line; +} + sub shorten_destination { my ( $dest, $city ) = @_; @@ -174,6 +182,7 @@ sub render_image { } $destination = shorten_destination( $destination, $city ); + $line = shorten_line($line); $png->draw_at( 0, $line ); $png->draw_at( 25, $destination ); -- cgit v1.2.3