* org.el (org-back-over-empty-lines): Don't move line upward if point is at eob. Fixes a bug with refiling reported by Bernt Hansen, simplified version of fix proposed by Jason Dunsmore.
@@ -19212,7 +19212,8 @@ 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 (eobp)
+ (forward-line -1)))
(beginning-of-line 2)
(goto-char (min (point) pos))
(count-lines (point) pos)))