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
1 changed files with 5 additions and 4 deletions

View File

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