diff --git a/lisp/org.el b/lisp/org.el index 0a71ab6ba..d50514263 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -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)))))))