components/emacs/patches/calc-forms.patch
changeset 3626 48d8d7ae6e0a
child 4791 fb9a6b5ef98f
equal deleted inserted replaced
3625:43b658b2e7cf 3626:48d8d7ae6e0a
       
     1 # Prevent uninterruptible infinite loop. This is the fix for
       
     2 #    20270656 calc: sign change of hh.mm value puts Emacs into tight loop
       
     3 # See components/emacs/README.
       
     4 #
       
     5 --- emacs-24.3.orig/lisp/calc/calc-forms.el	2013-01-01 13:37:17.000000000 -0700
       
     6 +++ emacs-24.3/lisp/calc/calc-forms.el	2015-01-02 14:57:36.824358166 -0700
       
     7 @@ -271,7 +271,10 @@
       
     8  	(m (math-normalize (nth 2 a)))
       
     9  	(s (let ((calc-internal-prec (max (- calc-internal-prec 4) 3)))
       
    10  	     (math-normalize (nth 3 a)))))
       
    11 -    (if (math-negp h)
       
    12 +    (if (or 
       
    13 +         (math-negp h)
       
    14 +         (and (= h 0) (math-negp m))
       
    15 +         (and (= h 0) (= m 0) (math-negp s)))
       
    16  	(progn
       
    17  	  (if (math-posp s)
       
    18  	      (setq s (math-add s -60)