chiark
/
gitweb
/
~ianmdlvl
/
reprap-play.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
fbe0aad
)
commitid.scad.pl: make rjustt put prefix after pad
author
Ian Jackson
<ijackson@chiark.greenend.org.uk>
Fri, 5 Feb 2016 19:08:28 +0000
(19:08 +0000)
committer
Ian Jackson
<ijackson@chiark.greenend.org.uk>
Fri, 5 Feb 2016 19:08:28 +0000
(19:08 +0000)
commitid.scad.pl
patch
|
blob
|
history
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));
}