emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] /srv/bzr/emacs/emacs-24 r110988: Fix another instance of b


From: Eli Zaretskii
Subject: [Emacs-diffs] /srv/bzr/emacs/emacs-24 r110988: Fix another instance of bug #12933 with non-ASCII file names on Windows.
Date: Tue, 04 Dec 2012 20:48:01 +0200
User-agent: Bazaar (2.5.0)

------------------------------------------------------------
revno: 110988
fixes bug: http://debbugs.gnu.org/12933
committer: Eli Zaretskii <address@hidden>
branch nick: emacs-24
timestamp: Tue 2012-12-04 20:48:01 +0200
message:
  Fix another instance of bug #12933 with non-ASCII file names on Windows.
  
   src/fileio.c (file_name_as_directory, directory_file_name) [DOS_NT]:
   Encode the file name before passing it to dostounix_filename, in
   case it will downcase it (under w32-downcase-file-names).
modified:
  src/ChangeLog
  src/fileio.c
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2012-12-01 01:49:48 +0000
+++ b/src/ChangeLog     2012-12-04 18:48:01 +0000
@@ -1,3 +1,10 @@
+2012-12-04  Eli Zaretskii  <address@hidden>
+
+       * fileio.c (file_name_as_directory, directory_file_name) [DOS_NT]:
+       Encode the file name before passing it to dostounix_filename, in
+       case it will downcase it (under w32-downcase-file-names).
+       (Bug#12933)
+
 2012-12-01  Chong Yidong  <address@hidden>
 
        * fileio.c (Vauto_save_list_file_name): Doc fix.

=== modified file 'src/fileio.c'
--- a/src/fileio.c      2012-12-01 01:49:48 +0000
+++ b/src/fileio.c      2012-12-04 18:48:01 +0000
@@ -455,7 +455,7 @@
 
 /* Convert from file name SRC of length SRCLEN to directory name
    in DST.  On UNIX, just make sure there is a terminating /.
-   Return the length of DST.  */
+   Return the length of DST in bytes.  */
 
 static ptrdiff_t
 file_name_as_directory (char *dst, const char *src, ptrdiff_t srclen)
@@ -477,7 +477,14 @@
       srclen++;
     }
 #ifdef DOS_NT
-  dostounix_filename (dst);
+  {
+    Lisp_Object tem_fn = make_specified_string (dst, -1, srclen, 1);
+
+    tem_fn = ENCODE_FILE (tem_fn);
+    dostounix_filename (SSDATA (tem_fn));
+    tem_fn = DECODE_FILE (tem_fn);
+    memcpy (dst, SSDATA (tem_fn), (srclen = SBYTES (tem_fn)) + 1);
+  }
 #endif
   return srclen;
 }
@@ -519,7 +526,7 @@
 
 /* Convert from directory name SRC of length SRCLEN to
    file name in DST.  On UNIX, just make sure there isn't
-   a terminating /.  Return the length of DST.  */
+   a terminating /.  Return the length of DST in bytes.  */
 
 static ptrdiff_t
 directory_file_name (char *dst, char *src, ptrdiff_t srclen)
@@ -538,7 +545,14 @@
       srclen--;
     }
 #ifdef DOS_NT
-  dostounix_filename (dst);
+  {
+    Lisp_Object tem_fn = make_specified_string (dst, -1, srclen, 1);
+
+    tem_fn = ENCODE_FILE (tem_fn);
+    dostounix_filename (SSDATA (tem_fn));
+    tem_fn = DECODE_FILE (tem_fn);
+    memcpy (dst, SSDATA (tem_fn), (srclen = SBYTES (tem_fn)) + 1);
+  }
 #endif
   return srclen;
 }


reply via email to

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