Subject: bug#18891: Doesn't handle pwd = /C: very well

From: Michael Albinus <[email-masked]>
Date: Fri, 07 Nov 2014 17:58:30 +0100

Eli Zaretskii <[email-masked]> writes:

> Your change calls Ffile_accessible_directory_p, Fstring_match, and
> Fsubstring with a unibyte (encoded) string as their argument.  I think
> we should avoid that, as, e.g., Fstring_match might yield a false
> positive under some encodings.

Shall I change it like this?

--8<---------------cut here---------------start------------->8---
*** /usr/local/src/emacs-24/src/callproc.c.~117680~	2014-11-07 17:54:37.318055813 +0100
--- /usr/local/src/emacs-24/src/callproc.c	2014-11-07 17:54:03.865559094 +0100
***************
*** 150,157 ****
  
    dir = expand_and_dir_to_file (dir, Qnil);
  
-   if (STRING_MULTIBYTE (dir))
-     dir = ENCODE_FILE (dir);
    if (NILP (Ffile_accessible_directory_p (dir)))
      report_file_error ("Setting current directory",
  		       BVAR (current_buffer, directory));
--- 150,155 ----
***************
*** 160,165 ****
--- 158,166 ----
    if (Fstring_match (build_string ("^/:"), dir, Qnil))
      dir = Fsubstring (dir, make_number (2), Qnil);
  
+   if (STRING_MULTIBYTE (dir))
+     dir = ENCODE_FILE (dir);
+ 
    RETURN_UNGCPRO (dir);
  }
  
--8<---------------cut here---------------end--------------->8---

Best regards, Michael.