* org.el (org-sort-entries): Fix the number of blank lines to keep for the last entry to sort. Thanks to Kyle Meyer for raising this issue.
@@ -8639,7 +8639,8 @@ links."
(setq start (point)
end (progn (org-end-of-subtree t t)
(or (bolp) (insert "\n"))
- (org-back-over-empty-lines)
+ (when (>= (org-back-over-empty-lines) 1)
+ (forward-line 1))
(point))
what "children")
(goto-char start)