Commit 0cd2e923 authored by Tino Calancha's avatar Tino Calancha Committed by Lars Magne Ingebrigtsen

Don't kill ~/ if it's the top level directory

* lisp/dired-aux.el (dired-kill-subdir): Don't kill ~/ if it's
the top level directory (bug#23017).
parent 4f40f5f6
......@@ -2486,8 +2486,8 @@ Lower levels are unaffected."
(cur-dir (dired-current-directory))
(cons (assoc-string cur-dir dired-switches-alist))
buffer-read-only)
(if (equal cur-dir default-directory)
(error "Attempt to kill top level directory"))
(when (equal cur-dir (expand-file-name default-directory))
(error "Attempt to kill top level directory"))
(prog1
(if remember-marks (dired-remember-marks beg end))
(delete-region beg end)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment