chiark / gitweb /
Makefile: try to cope with .m4s with toplevels
[reprap-play.git] / commitid.scad.pl
index 983a4abc08abf4a5b8423705bb59058357f35d5b..0af0115b410e3c6c4405e64199ea5ae947c3f185 100755 (executable)
@@ -538,11 +538,11 @@ sub do_git () {
 
        if (defined($git_count)) {
            my $smallstr = rjustt($sz, $git_count, $git_dirty);
-           if (defined($git_object) && $sz >= length($git_count) + 3) {
-               $smallstr = $git_object;
-               $smallstr .= ($git_dirty || ' ');
-               $smallstr .= $git_count;
-               $smallstr = rjustt($sz, $smallstr);
+           my $forgitobj = $sz - length($git_count) - 1;
+           if (defined($git_object) && $forgitobj >= 2) {
+               $smallstr = ljustt($forgitobj, $git_object).
+                   ($git_dirty || ' ').
+                   $git_count;
            }
            genform_plusq("Small$sz", $smallstr);
        }