From: Ian Jackson Date: Fri, 5 Feb 2016 19:08:28 +0000 (+0000) Subject: commitid.scad.pl: make rjustt put prefix after pad X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=17f35150e597aee7c4d000bea9973000e8f17b32;p=reprap-play.git commitid.scad.pl: make rjustt put prefix after pad --- diff --git a/commitid.scad.pl b/commitid.scad.pl index fbeed6f..83e3afe 100755 --- a/commitid.scad.pl +++ b/commitid.scad.pl @@ -275,8 +275,8 @@ sub rjustt ($$;$) { # right justify and truncate (ie, pad and truncate at left) my $lw = length $whole; my $spare = $sz - $lw - (length $prefix); return - $prefix. ($spare > 0 ? (' ' x $spare) : ''). + $prefix. substr($whole, ($spare < 0 ? -$spare : 0)); }