Anonymous avatar Anonymous committed 66f2d62

updated for version 7.3.177
Problem: MS-Windows: mkdir() doesn't work properly when 'encoding' is
"utf-8".
Solution: Convert to utf-16. (Yukihiro Nakadaira)

Comments (0)

Files changed (4)

 }
 
 /*
+ * Create directory "name".
+ * Return 0 on success, -1 on error.
+ */
+    int
+mch_mkdir(char_u *name)
+{
+#ifdef FEAT_MBYTE
+    if (enc_codepage >= 0 && (int)GetACP() != enc_codepage)
+    {
+	WCHAR	*p;
+	int	retval;
+
+	p = enc_to_utf16(name, NULL);
+	if (p == NULL)
+	    return -1;
+	retval = _wmkdir(p);
+	vim_free(p);
+	return retval;
+    }
+#endif
+    return _mkdir(name);
+}
+
+/*
  * Return TRUE if file "fname" has more than one link.
  */
     int
 #ifdef __BORLANDC__
 # define vim_mkdir(x, y) mkdir(x)
 #else
-# define vim_mkdir(x, y) _mkdir(x)
+# define vim_mkdir(x, y) mch_mkdir(x)
 #endif

src/proto/os_win32.pro

 int mch_setperm __ARGS((char_u *name, long perm));
 void mch_hide __ARGS((char_u *name));
 int mch_isdir __ARGS((char_u *name));
+int mch_mkdir __ARGS((char_u *name));
 int mch_is_linked __ARGS((char_u *fname));
 int win32_fileinfo __ARGS((char_u *name, BY_HANDLE_FILE_INFORMATION *lpFileInfo));
 int mch_writable __ARGS((char_u *name));
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    177,
+/**/
     176,
 /**/
     175,
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.