summaryrefslogtreecommitdiff
path: root/lisp/files.el
diff options
context:
space:
mode:
authorJoakim Verona <joakim@verona.se>2012-03-25 22:04:52 +0200
committerJoakim Verona <joakim@verona.se>2012-03-25 22:04:52 +0200
commit75da28a3845b9dfa4e730cfa19c14edc52cbb222 (patch)
treeb04519bffcb21264cbe3ce8af13df7186548667f /lisp/files.el
parentb827329a89291ed68dd017c53976be7ce5ed3b22 (diff)
parentf514f6f0e3f8bbeb5212d0337e5bda5a9a4eaeb5 (diff)
downloademacs-75da28a3845b9dfa4e730cfa19c14edc52cbb222.tar.gz
emacs-75da28a3845b9dfa4e730cfa19c14edc52cbb222.tar.bz2
emacs-75da28a3845b9dfa4e730cfa19c14edc52cbb222.zip
upstream
Diffstat (limited to 'lisp/files.el')
-rw-r--r--lisp/files.el6
1 files changed, 3 insertions, 3 deletions
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,
(new-fn (expand-file-name (file-name-nondirectory fn)
trash-dir)))
;; We can't trash a parent directory of trash-directory.
- (if (string-match fn trash-dir)
+ (if (string-prefix-p fn trash-dir)
(error "Trash directory `%s' is a subdirectory of `%s'"
trash-dir filename))
(unless (file-directory-p trash-dir)
@@ -6595,10 +6595,10 @@ Otherwise, trash FILENAME using the freedesktop.org conventions,
(file-name-directory fn)))
(error "Cannot move %s to trash: Permission denied" filename))
;; The trashed file cannot be the trash dir or its parent.
- (if (string-match fn trash-files-dir)
+ (if (string-prefix-p fn trash-files-dir)
(error "The trash directory %s is a subdirectory of %s"
trash-files-dir filename))
- (if (string-match fn trash-info-dir)
+ (if (string-prefix-p fn trash-info-dir)
(error "The trash directory %s is a subdirectory of %s"
trash-info-dir filename))