]> git.eshelyaron.com Git - emacs.git/commitdiff
* dired.el (dired-get-filename): Pay attention to the case that
authorKenichi Handa <handa@m17n.org>
Wed, 19 Mar 2003 11:58:25 +0000 (11:58 +0000)
committerKenichi Handa <handa@m17n.org>
Wed, 19 Mar 2003 11:58:25 +0000 (11:58 +0000)
`read' returns a unibyte string.  Don't encode the file name by
buffer-file-coding-system.

lisp/dired.el

index 69dafbe6bfcc1de399cfb0012c65b30fa0b74c37..db067c5da164b80059695c0019f9d0f4c6479f57 100644 (file)
@@ -1462,16 +1462,17 @@ Optional arg NO-ERROR-IF-NOT-FILEP means return nil if no filename on
                         (or (dired-string-replace-match
                              "\\([^\\]\\|\\`\\)\"" file "\\1\\\\\"" nil t)
                             file)
-                        "\"")))))
+                        "\"")))
+         ;; The above `read' will return a unibyte string if FILE
+         ;; contains eight-bit-control/graphic characters.
+         (if (and enable-multibyte-characters
+                  (not (multibyte-string-p file)))
+             (setq file (string-to-multibyte file)))))
     (and file (file-name-absolute-p file)
         ;; A relative file name can start with ~.
         ;; Don't treat it as absolute in this context.
         (not (eq (aref file 0) ?~))
         (setq already-absolute t))
-    (and file buffer-file-coding-system
-        (not file-name-coding-system)
-        (not default-file-name-coding-system)
-        (setq file (encode-coding-string file buffer-file-coding-system)))
     (cond
      ((null file)
       nil)