Hi Bernt,
Can you see if this patch fixes the problem?
--8<---------------cut here---------------start------------->8---
diff --git a/lisp/org.el b/lisp/org.el
index c7b28dd..41ac8c6 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -19212,7 +19212,9 @@ Returns the number of empty lines passed."
(let ((pos (point)))
(if (cdr (assoc 'heading org-blank-before-new-entry))
(skip-chars-backward " \t\n\r")
- (forward-line -1))
+ (unless (eq (line-number-at-pos)
+ (count-lines (point-min) (point-max)))
+ (forward-line -1)))
(beginning-of-line 2)
(goto-char (min (point) pos))
(count-lines (point) pos)))
--8<---------------cut here---------------end--------------->8---
Thanks,
Jason