bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#7680: 23.2.91; [PATCH] dnd-get-local-file-name bug


From: Leo
Subject: bug#7680: 23.2.91; [PATCH] dnd-get-local-file-name bug
Date: Sun, 19 Dec 2010 14:19:56 +0000

I just noticed the return value of dnd-get-local-file-name may contain
%20 etc. The patch fixes this.

commit 8d987eb074d6ff8282ce3fdc19f00cdb82fdfa28 (HEAD, refs/heads/leo-main)
Date:   Sun Dec 19 14:12:55 2010 +0000

    Unhex file name should always be performed
    
    in dnd-get-local-file-name.
---
 lisp/dnd.el |   14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)

        Modified lisp/dnd.el
diff --git a/lisp/dnd.el b/lisp/dnd.el
index aadfad6..e6e3190 100644
--- a/lisp/dnd.el
+++ b/lisp/dnd.el
@@ -143,14 +143,14 @@ Return nil if URI is not a local file."
                  (substring uri (1- (match-end 0))))
                 ((string-match "^file:" uri)           ; Old KDE, Motif, Sun
                  (substring uri (match-end 0))))))
+    (and f (setq f (replace-regexp-in-string
+                   "%[A-Fa-f0-9][A-Fa-f0-9]"
+                   (lambda (arg)
+                     (let ((str (make-string 1 0)))
+                       (aset str 0 (string-to-number (substring arg 1) 16))
+                       str))
+                   f t t)))
     (when (and f must-exist)
-      (setq f (replace-regexp-in-string
-              "%[A-Fa-f0-9][A-Fa-f0-9]"
-              (lambda (arg)
-                (let ((str (make-string 1 0)))
-                  (aset str 0 (string-to-number (substring arg 1) 16))
-                  str))
-              f t t))
       (let* ((decoded-f (decode-coding-string
                         f
                         (or file-name-coding-system






reply via email to

[Prev in Thread] Current Thread [Next in Thread]