Browse Source

Fixed incorrect value returned from `org-habit-deadline'

John Wiegley 15 years ago
parent
commit
706129c0c4
1 changed files with 4 additions and 2 deletions
  1. 4 2
      lisp/org-habit.el

+ 4 - 2
lisp/org-habit.el

@@ -178,8 +178,10 @@ This list represents a \"habit\" for the rest of this module."
 (defsubst org-habit-deadline (habit)
   (let ((deadline (nth 2 habit)))
     (or deadline
-	(+ (org-habit-scheduled habit)
-	   (1- (org-habit-scheduled-repeat habit))))))
+	(if (nth 3 habit)
+	    (+ (org-habit-scheduled habit)
+	       (1- (org-habit-scheduled-repeat habit)))
+	  (org-habit-scheduled habit)))))
 (defsubst org-habit-deadline-repeat (habit)
   (or (nth 3 habit)
       (org-habit-scheduled-repeat habit)))