feat(color): warning when duplicating theme if name exists (#4694)

This commit is contained in:
philmoz
2024-04-08 08:32:08 +10:00
committed by GitHub
parent 18dbca3f5f
commit 9ed9227212
23 changed files with 73 additions and 15 deletions
+12 -8
View File
@@ -489,17 +489,21 @@ FRESULT f_mkfs (const TCHAR* path, BYTE opt, DWORD au, void* work, UINT len)
FRESULT f_mkdir (const TCHAR * name)
{
std::string path = convertToSimuPath(name);
if (f_stat(name, nullptr) != FR_OK) {
#if defined(WIN32) && defined(__GNUC__)
if (mkdir(path.c_str())) {
if (mkdir(path.c_str())) {
#else
if (mkdir(path.c_str(), 0777)) {
if (mkdir(path.c_str(), 0777)) {
#endif
TRACE_SIMPGMSPACE("mkdir(%s) = error %d (%s)", path.c_str(), errno, strerror(errno));
return FR_INVALID_NAME;
}
else {
TRACE_SIMPGMSPACE("mkdir(%s) = OK", path.c_str());
return FR_OK;
TRACE_SIMPGMSPACE("mkdir(%s) = error %d (%s)", path.c_str(), errno, strerror(errno));
return FR_INVALID_NAME;
}
else {
TRACE_SIMPGMSPACE("mkdir(%s) = OK", path.c_str());
return FR_OK;
}
} else {
return FR_EXIST;
}
return FR_OK;
}