0
0
Fork 1
mirror of https://git.savannah.gnu.org/git/emacs/org-mode.git synced 2024-09-30 17:03:09 +00:00

org.el (org-refresh-stats-properties): Fix arithmetic error

* org.el (org-refresh-stats-properties): Fix arithmetic error.

Thanks to Gregor Zattler for reporting this.
This commit is contained in:
Bastien Guerry 2014-05-24 11:25:39 +02:00
parent 99580828e6
commit 253b60cdaf

View file

@ -9433,10 +9433,11 @@ call CMD."
(concat org-outline-regexp-bol ".*" (concat org-outline-regexp-bol ".*"
"\\(?:\\[\\([0-9]+\\)%\\|\\([0-9]+\\)/\\([0-9]+\\)\\]\\)") "\\(?:\\[\\([0-9]+\\)%\\|\\([0-9]+\\)/\\([0-9]+\\)\\]\\)")
nil t) nil t)
(setq stats (if (match-string 2) (setq stats (cond ((equal (match-string 3) "0") 0)
(/ (* (string-to-number (match-string 2)) 100) ((match-string 2)
(string-to-number (match-string 3))) (/ (* (string-to-number (match-string 2)) 100)
(string-to-number (match-string 1)))) (string-to-number (match-string 3))))
(t (string-to-number (match-string 1)))))
(org-back-to-heading t) (org-back-to-heading t)
(put-text-property (point) (progn (org-end-of-subtree t t) (point)) (put-text-property (point) (progn (org-end-of-subtree t t) (point))
'org-stats stats))))))) 'org-stats stats)))))))