Fix relative path to current directory being empty case for windows file system CreateDir function.
PiperOrigin-RevId: 223405610
This commit is contained in:
parent
94008f8c57
commit
7e70dc4317
@ -439,6 +439,9 @@ Status WindowsFileSystem::DeleteFile(const string& fname) {
|
||||
Status WindowsFileSystem::CreateDir(const string& name) {
|
||||
Status result;
|
||||
std::wstring ws_name = Utf8ToWideChar(name);
|
||||
if (ws_name.empty()) {
|
||||
return errors::AlreadyExists(name);
|
||||
}
|
||||
if (_wmkdir(ws_name.c_str()) != 0) {
|
||||
result = IOError("Failed to create a directory: " + name, errno);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user