]> granicus.if.org Git - vim/commitdiff
patch 7.4.1109 v7.4.1109
authorBram Moolenaar <Bram@vim.org>
Sat, 16 Jan 2016 21:02:57 +0000 (22:02 +0100)
committerBram Moolenaar <Bram@vim.org>
Sat, 16 Jan 2016 21:02:57 +0000 (22:02 +0100)
Problem:    MS-Windows doesn't have rmdir().
Solution:   Add mch_rmdir().

src/os_win32.c
src/proto/os_win32.pro
src/version.c

index c5b23ca7dbb53fb152e6066aeb7560f0f70784d4..a47ffaf18a04d652c254aba8d664afca3c4cbbf6 100644 (file)
@@ -3153,6 +3153,30 @@ mch_mkdir(char_u *name)
     return _mkdir(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.
  */
index e6fce88a3bea192e1d26829074b81d959503838f..7cdd15677a74738e33ff86ca76aa22b73e8760d2 100644 (file)
@@ -22,6 +22,7 @@ void mch_hide __ARGS((char_u *name));
 int mch_ishidden __ARGS((char_u *name));
 int mch_isdir __ARGS((char_u *name));
 int mch_mkdir __ARGS((char_u *name));
+int mch_rmdir __ARGS((char_u *name));
 int mch_is_hard_link __ARGS((char_u *fname));
 int mch_is_symbolic_link __ARGS((char_u *fname));
 int mch_is_linked __ARGS((char_u *fname));
index 1a61df43a0c5ad2edd051bf8f26b7124d04488c3..2767f1d820f6c3c1f1b0f1d045ab4041afe91bb7 100644 (file)
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1109,
 /**/
     1108,
 /**/