Using app data path, deleting config every time, improve loop

This commit is contained in:
Krzosa Karol
2024-07-27 22:07:58 +02:00
parent 052894a628
commit 07a41e0266
6 changed files with 90 additions and 116 deletions

View File

@@ -314,6 +314,15 @@ String GetWorkingDir(Allocator arena) {
}
bool IsAbsolute(String path) {
bool result = path.len > 3 && IsAlphabetic(path.data[0]) && path.data[1] == ':' && path.data[2] == '/';
bool result = path.len > 3 && IsAlphabetic(path.data[0]) && path.data[1] == ':' && (path.data[2] == '/' || path.data[2] == '\\');
return result;
}
bool DeleteFile(String path) {
wchar_t wpath[1024];
CreateWidecharFromChar(wpath, Lengthof(wpath), path.data, path.len);
BOOL success = DeleteFileW(wpath);
bool result = true;
if (success == 0) result = false;
return result;
}