From b5fe4474804104f383b21b4dcb091d14adc9b610 Mon Sep 17 00:00:00 2001
From: =?utf8?q?Mattias=20Engdeg=C3=A5rd?= <mattiase@acm.org>
Date: Fri, 11 Sep 2020 12:54:00 +0200
Subject: [PATCH] Fix calc tests when running noninteractively

This error was introduced in 8e1376a39125c3ffc0484077b502444d853eca79.

* lisp/calc/calc.el (calc--header-line): Prevent size from being negative.
---
 lisp/calc/calc.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/calc/calc.el b/lisp/calc/calc.el
index 9b95bc149a6..90789a69cd1 100644
--- a/lisp/calc/calc.el
+++ b/lisp/calc/calc.el
@@ -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)))
-- 
2.39.5