Karsten Hopp e45c1e
To: vim_dev@googlegroups.com
Karsten Hopp e45c1e
Subject: Patch 7.3.177
Karsten Hopp e45c1e
Fcc: outbox
Karsten Hopp e45c1e
From: Bram Moolenaar <Bram@moolenaar.net>
Karsten Hopp e45c1e
Mime-Version: 1.0
Karsten Hopp e45c1e
Content-Type: text/plain; charset=UTF-8
Karsten Hopp e45c1e
Content-Transfer-Encoding: 8bit
Karsten Hopp e45c1e
------------
Karsten Hopp e45c1e
Karsten Hopp e45c1e
Patch 7.3.177
Karsten Hopp e45c1e
Problem:    MS-Windows: mkdir() doesn't work properly when 'encoding' is
Karsten Hopp e45c1e
	    "utf-8".
Karsten Hopp e45c1e
Solution:   Convert to utf-16. (Yukihiro Nakadaira)
Karsten Hopp e45c1e
Files:	    src/os_win32.c, src/os_win32.h, src/proto/os_win32.pro
Karsten Hopp e45c1e
Karsten Hopp e45c1e
Karsten Hopp e45c1e
*** ../vim-7.3.176/src/os_win32.c	2011-05-05 16:41:19.000000000 +0200
Karsten Hopp e45c1e
--- src/os_win32.c	2011-05-05 18:24:36.000000000 +0200
Karsten Hopp e45c1e
***************
Karsten Hopp e45c1e
*** 2640,2645 ****
Karsten Hopp e45c1e
--- 2640,2669 ----
Karsten Hopp e45c1e
  }
Karsten Hopp e45c1e
  
Karsten Hopp e45c1e
  /*
Karsten Hopp e45c1e
+  * Create directory "name".
Karsten Hopp e45c1e
+  * Return 0 on success, -1 on error.
Karsten Hopp e45c1e
+  */
Karsten Hopp e45c1e
+     int
Karsten Hopp e45c1e
+ mch_mkdir(char_u *name)
Karsten Hopp e45c1e
+ {
Karsten Hopp e45c1e
+ #ifdef FEAT_MBYTE
Karsten Hopp e45c1e
+     if (enc_codepage >= 0 && (int)GetACP() != enc_codepage)
Karsten Hopp e45c1e
+     {
Karsten Hopp e45c1e
+ 	WCHAR	*p;
Karsten Hopp e45c1e
+ 	int	retval;
Karsten Hopp e45c1e
+ 
Karsten Hopp e45c1e
+ 	p = enc_to_utf16(name, NULL);
Karsten Hopp e45c1e
+ 	if (p == NULL)
Karsten Hopp e45c1e
+ 	    return -1;
Karsten Hopp e45c1e
+ 	retval = _wmkdir(p);
Karsten Hopp e45c1e
+ 	vim_free(p);
Karsten Hopp e45c1e
+ 	return retval;
Karsten Hopp e45c1e
+     }
Karsten Hopp e45c1e
+ #endif
Karsten Hopp e45c1e
+     return _mkdir(name);
Karsten Hopp e45c1e
+ }
Karsten Hopp e45c1e
+ 
Karsten Hopp e45c1e
+ /*
Karsten Hopp e45c1e
   * Return TRUE if file "fname" has more than one link.
Karsten Hopp e45c1e
   */
Karsten Hopp e45c1e
      int
Karsten Hopp e45c1e
*** ../vim-7.3.176/src/os_win32.h	2010-08-15 21:57:30.000000000 +0200
Karsten Hopp e45c1e
--- src/os_win32.h	2011-05-05 18:25:44.000000000 +0200
Karsten Hopp e45c1e
***************
Karsten Hopp e45c1e
*** 191,195 ****
Karsten Hopp e45c1e
  #ifdef __BORLANDC__
Karsten Hopp e45c1e
  # define vim_mkdir(x, y) mkdir(x)
Karsten Hopp e45c1e
  #else
Karsten Hopp e45c1e
! # define vim_mkdir(x, y) _mkdir(x)
Karsten Hopp e45c1e
  #endif
Karsten Hopp e45c1e
--- 191,195 ----
Karsten Hopp e45c1e
  #ifdef __BORLANDC__
Karsten Hopp e45c1e
  # define vim_mkdir(x, y) mkdir(x)
Karsten Hopp e45c1e
  #else
Karsten Hopp e45c1e
! # define vim_mkdir(x, y) mch_mkdir(x)
Karsten Hopp e45c1e
  #endif
Karsten Hopp e45c1e
*** ../vim-7.3.176/src/proto/os_win32.pro	2011-05-05 16:41:19.000000000 +0200
Karsten Hopp e45c1e
--- src/proto/os_win32.pro	2011-05-05 18:26:20.000000000 +0200
Karsten Hopp e45c1e
***************
Karsten Hopp e45c1e
*** 20,25 ****
Karsten Hopp e45c1e
--- 20,26 ----
Karsten Hopp e45c1e
  int mch_setperm __ARGS((char_u *name, long perm));
Karsten Hopp e45c1e
  void mch_hide __ARGS((char_u *name));
Karsten Hopp e45c1e
  int mch_isdir __ARGS((char_u *name));
Karsten Hopp e45c1e
+ int mch_mkdir __ARGS((char_u *name));
Karsten Hopp e45c1e
  int mch_is_linked __ARGS((char_u *fname));
Karsten Hopp e45c1e
  int win32_fileinfo __ARGS((char_u *name, BY_HANDLE_FILE_INFORMATION *lpFileInfo));
Karsten Hopp e45c1e
  int mch_writable __ARGS((char_u *name));
Karsten Hopp e45c1e
*** ../vim-7.3.176/src/version.c	2011-05-05 18:10:11.000000000 +0200
Karsten Hopp e45c1e
--- src/version.c	2011-05-05 18:27:56.000000000 +0200
Karsten Hopp e45c1e
***************
Karsten Hopp e45c1e
*** 716,717 ****
Karsten Hopp e45c1e
--- 716,719 ----
Karsten Hopp e45c1e
  {   /* Add new patch number below this line */
Karsten Hopp e45c1e
+ /**/
Karsten Hopp e45c1e
+     177,
Karsten Hopp e45c1e
  /**/
Karsten Hopp e45c1e
Karsten Hopp e45c1e
-- 
Karsten Hopp e45c1e
hundred-and-one symptoms of being an internet addict:
Karsten Hopp e45c1e
56. You leave the modem speaker on after connecting because you think it
Karsten Hopp e45c1e
    sounds like the ocean wind...the perfect soundtrack for "surfing the net".
Karsten Hopp e45c1e
Karsten Hopp e45c1e
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
Karsten Hopp e45c1e
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
Karsten Hopp e45c1e
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
Karsten Hopp e45c1e
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///