chiark / gitweb /
commitid.scad.pl: make rjustt put prefix after pad
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Fri, 5 Feb 2016 19:08:28 +0000 (19:08 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Fri, 5 Feb 2016 19:08:28 +0000 (19:08 +0000)
commitid.scad.pl

index fbeed6fe1a4518f42374901c003303f342b3d7c3..83e3afe642e719c3105f119dea7805d2a2cfb8e3 100755 (executable)
@@ -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));
 }