summaryrefslogtreecommitdiff
path: root/cgi
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2011-11-11 12:12:52 +0100
committerDaniel Friesel <derf@finalrewind.org>2011-11-11 12:12:52 +0100
commite27c94c1fdcb051db50d4b8bc89a0f9026aa59c8 (patch)
treebacb238c6e0a087fd24565627708e76f9741f4b2 /cgi
parent57602c4604197bfce27e09115c30ab54b50d014a (diff)
cgi: Start shortening line as well
Diffstat (limited to 'cgi')
-rw-r--r--cgi/index.pl9
1 files changed, 9 insertions, 0 deletions
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 );