From 17f35150e597aee7c4d000bea9973000e8f17b32 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Fri, 5 Feb 2016 19:08:28 +0000 Subject: [PATCH] commitid.scad.pl: make rjustt put prefix after pad --- commitid.scad.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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)); } -- 2.30.2