chiark
/
gitweb
/
~ianmdlvl
/
reprap-play.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
commitid.scad.pl: make rjustt put prefix after pad
[reprap-play.git]
/
commitid.scad.pl
diff --git
a/commitid.scad.pl
b/commitid.scad.pl
index fbeed6fe1a4518f42374901c003303f342b3d7c3..83e3afe642e719c3105f119dea7805d2a2cfb8e3 100755
(executable)
--- 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));
}