summaryrefslogtreecommitdiff
path: root/lisp/dnd.el
diff options
context:
space:
mode:
authorLeo Liu <sdl.web@gmail.com>2010-10-02 21:27:39 -0400
committerChong Yidong <cyd@stupidchicken.com>2010-10-02 21:27:39 -0400
commit83b8ea28ea1d3f9f7c73af717fefaaeca18a1594 (patch)
tree4719dc86c245ed201b30deb48932a20ed5dafe5b /lisp/dnd.el
parent7b2bf907f15edfed9480e7c4087cc54b603e426c (diff)
downloademacs-83b8ea28ea1d3f9f7c73af717fefaaeca18a1594.tar.gz
Fix return value of dnd-get-local-file-name (Bug#7090).
* lisp/dnd.el (dnd-get-local-file-name): If MUST-EXIST is non-nil, only return non-nil if the file exists (Bug#7090).
Diffstat (limited to 'lisp/dnd.el')
-rw-r--r--lisp/dnd.el9
1 files changed, 5 insertions, 4 deletions
diff --git a/lisp/dnd.el b/lisp/dnd.el
index d7cbb641bab..aadfad6d7ac 100644
--- a/lisp/dnd.el
+++ b/lisp/dnd.el
@@ -154,10 +154,11 @@ Return nil if URI is not a local file."
(let* ((decoded-f (decode-coding-string
f
(or file-name-coding-system
- default-file-name-coding-system)))
- (try-f (if (file-readable-p decoded-f) decoded-f f)))
- (when (file-readable-p try-f) try-f)))))
-
+ default-file-name-coding-system))))
+ (setq f (cond ((file-readable-p decoded-f) decoded-f)
+ ((file-readable-p f) f)
+ (t nil)))))
+ f))
(defun dnd-open-local-file (uri action)
"Open a local file.