From 0cd2e923dba8d8c7128b0c084ce6af22069e8db5 Mon Sep 17 00:00:00 2001 From: Tino Calancha Date: Sun, 24 Apr 2016 17:05:33 +0200 Subject: [PATCH] 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). --- lisp/dired-aux.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lisp/dired-aux.el b/lisp/dired-aux.el index d29abf3cab8..08db1877f1a 100644 --- a/lisp/dired-aux.el +++ b/lisp/dired-aux.el @@ -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) -- 2.39.2