Skip to content

Commit 4cf7679

Browse files
committed
patch 7.4.1109
Problem: MS-Windows doesn't have rmdir(). Solution: Add mch_rmdir().
1 parent 58adb14 commit 4cf7679

3 files changed

Lines changed: 27 additions & 0 deletions

File tree

src/os_win32.c

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3153,6 +3153,30 @@ mch_mkdir(char_u *name)
31533153
return _mkdir(name);
31543154
}
31553155

3156+
/*
3157+
* Delete directory "name".
3158+
* Return 0 on success, -1 on error.
3159+
*/
3160+
int
3161+
mch_rmdir(char_u *name)
3162+
{
3163+
#ifdef FEAT_MBYTE
3164+
if (enc_codepage >= 0 && (int)GetACP() != enc_codepage)
3165+
{
3166+
WCHAR *p;
3167+
int retval;
3168+
3169+
p = enc_to_utf16(name, NULL);
3170+
if (p == NULL)
3171+
return -1;
3172+
retval = _wrmdir(p);
3173+
vim_free(p);
3174+
return retval;
3175+
}
3176+
#endif
3177+
return _rmdir(name);
3178+
}
3179+
31563180
/*
31573181
* Return TRUE if file "fname" has more than one link.
31583182
*/

src/proto/os_win32.pro

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ void mch_hide __ARGS((char_u *name));
2222
int mch_ishidden __ARGS((char_u *name));
2323
int mch_isdir __ARGS((char_u *name));
2424
int mch_mkdir __ARGS((char_u *name));
25+
int mch_rmdir __ARGS((char_u *name));
2526
int mch_is_hard_link __ARGS((char_u *fname));
2627
int mch_is_symbolic_link __ARGS((char_u *fname));
2728
int mch_is_linked __ARGS((char_u *fname));

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -741,6 +741,8 @@ static char *(features[]) =
741741

742742
static int included_patches[] =
743743
{ /* Add new patch number below this line */
744+
/**/
745+
1109,
744746
/**/
745747
1108,
746748
/**/

0 commit comments

Comments
 (0)