mirror of
https://github.com/vim/vim.git
synced 2025-09-24 03:44:06 -04:00
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)
This commit is contained in:
@@ -2639,6 +2639,30 @@ mch_isdir(char_u *name)
|
||||
return (f & FILE_ATTRIBUTE_DIRECTORY) != 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
Reference in New Issue
Block a user