diff src/os_win32.c @ 7619:6fed43c541c8 v7.4.1109

commit https://github.com/vim/vim/commit/4cf7679383dca81a4a351e2b0ec333c95d6d9085 Author: Bram Moolenaar <Bram@vim.org> Date: Sat Jan 16 22:02:57 2016 +0100 patch 7.4.1109 Problem: MS-Windows doesn't have rmdir(). Solution: Add mch_rmdir().
author Christian Brabandt <cb@256bit.org>
date Sat, 16 Jan 2016 22:15:04 +0100
parents 4456fa2d22e8
children 9c5e8254ea6b
line wrap: on
line diff
--- a/src/os_win32.c
+++ b/src/os_win32.c
@@ -3154,6 +3154,30 @@ mch_mkdir(char_u *name)
 }
 
 /*
+ * Delete directory "name".
+ * Return 0 on success, -1 on error.
+ */
+    int
+mch_rmdir(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 = _wrmdir(p);
+	vim_free(p);
+	return retval;
+    }
+#endif
+    return _rmdir(name);
+}
+
+/*
  * Return TRUE if file "fname" has more than one link.
  */
     int