components/emacs/patches/calc-forms.patch
author Ali Bahrami <Ali.Bahrami@Oracle.COM>
Tue, 18 Aug 2015 12:04:09 -0600
changeset 4791 fb9a6b5ef98f
parent 3626 48d8d7ae6e0a
permissions -rw-r--r--
21481648 update GNU Emacs to 24.5

# Prevent uninterruptible infinite loop. This is the fix for
#    20270656 calc: sign change of hh.mm value puts Emacs into tight loop
# See components/emacs/README.
#
--- emacs-24.5.orig/lisp/calc/calc-forms.el	2015-04-02 01:23:06.000000000 -0600
+++ emacs-24.5/lisp/calc/calc-forms.el	2015-06-29 11:29:19.191046059 -0600
@@ -273,7 +273,10 @@
 	(m (math-normalize (nth 2 a)))
 	(s (let ((calc-internal-prec (max (- calc-internal-prec 4) 3)))
 	     (math-normalize (nth 3 a)))))
-    (if (math-negp h)
+    (if (or 
+         (math-negp h)
+         (and (= h 0) (math-negp m))
+         (and (= h 0) (= m 0) (math-negp s)))
 	(progn
 	  (if (math-posp s)
 	      (setq s (math-add s -60)