]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix calc tests when running noninteractively
authorMattias Engdegård <mattiase@acm.org>
Fri, 11 Sep 2020 10:54:00 +0000 (12:54 +0200)
committerMattias Engdegård <mattiase@acm.org>
Fri, 11 Sep 2020 10:54:00 +0000 (12:54 +0200)
This error was introduced in 8e1376a39125c3ffc0484077b502444d853eca79.

* lisp/calc/calc.el (calc--header-line): Prevent size from being negative.

lisp/calc/calc.el

index 9b95bc149a65c07102864dfa501257b5cc9a8c5b..90789a69cd1bfa85002a074f0a85b35d631933ef 100644 (file)
@@ -1399,7 +1399,7 @@ border of the two cases."
                ;; fudge for trail is: -3 (added to len-long)
                ;; (width  ) for trail
                (factor (if (> width (+ len-long fudge)) len-long len-short))
-               (size   (/ (- width factor) 2))
+               (size   (max (/ (- width factor) 2) 0))
                (fill (make-string size ?-))
                (pre  (replace-regexp-in-string ".$" " " fill))
                (post (replace-regexp-in-string "^." " " fill)))