aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2012-03-21 13:44:55 -0400
committerStefan Monnier2012-03-21 13:44:55 -0400
commit1acad97c3e4b3c9cdf59c5debc10e5ed83699c4f (patch)
tree0e916ac577bc20933ed2094cdb7534453366a62c
parente298b5da3d0179d00e38d6baa8df515b160595ff (diff)
downloademacs-1acad97c3e4b3c9cdf59c5debc10e5ed83699c4f.tar.gz
emacs-1acad97c3e4b3c9cdf59c5debc10e5ed83699c4f.zip
* lisp/files.el (move-file-to-trash): Files aren't regexps.
Fixes: debbugs:11055
-rw-r--r--lisp/ChangeLog4
-rw-r--r--lisp/files.el6
2 files changed, 7 insertions, 3 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 801d0ac6a3c..dc8c5e04eb3 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,7 @@
12012-03-21 Stefan Monnier <monnier@iro.umontreal.ca>
2
3 * files.el (move-file-to-trash): Files aren't regexps (bug#11055).
4
12012-03-21 Sam Steingold <sds@gnu.org> 52012-03-21 Sam Steingold <sds@gnu.org>
2 6
3 * progmodes/etags.el (tags-completion-at-point-function): 7 * progmodes/etags.el (tags-completion-at-point-function):
diff --git a/lisp/files.el b/lisp/files.el
index cde15c5d0b1..8c61c288be9 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -6563,7 +6563,7 @@ Otherwise, trash FILENAME using the freedesktop.org conventions,
6563 (new-fn (expand-file-name (file-name-nondirectory fn) 6563 (new-fn (expand-file-name (file-name-nondirectory fn)
6564 trash-dir))) 6564 trash-dir)))
6565 ;; We can't trash a parent directory of trash-directory. 6565 ;; We can't trash a parent directory of trash-directory.
6566 (if (string-match fn trash-dir) 6566 (if (string-prefix-p fn trash-dir)
6567 (error "Trash directory `%s' is a subdirectory of `%s'" 6567 (error "Trash directory `%s' is a subdirectory of `%s'"
6568 trash-dir filename)) 6568 trash-dir filename))
6569 (unless (file-directory-p trash-dir) 6569 (unless (file-directory-p trash-dir)
@@ -6595,10 +6595,10 @@ Otherwise, trash FILENAME using the freedesktop.org conventions,
6595 (file-name-directory fn))) 6595 (file-name-directory fn)))
6596 (error "Cannot move %s to trash: Permission denied" filename)) 6596 (error "Cannot move %s to trash: Permission denied" filename))
6597 ;; The trashed file cannot be the trash dir or its parent. 6597 ;; The trashed file cannot be the trash dir or its parent.
6598 (if (string-match fn trash-files-dir) 6598 (if (string-prefix-p fn trash-files-dir)
6599 (error "The trash directory %s is a subdirectory of %s" 6599 (error "The trash directory %s is a subdirectory of %s"
6600 trash-files-dir filename)) 6600 trash-files-dir filename))
6601 (if (string-match fn trash-info-dir) 6601 (if (string-prefix-p fn trash-info-dir)
6602 (error "The trash directory %s is a subdirectory of %s" 6602 (error "The trash directory %s is a subdirectory of %s"
6603 trash-info-dir filename)) 6603 trash-info-dir filename))
6604 6604