mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-01-05 23:52:27 +08:00
adapt file path checks
This commit is contained in:
parent
d1aa57ac5d
commit
19dd580b3b
1 changed files with 50 additions and 49 deletions
|
@ -85,10 +85,11 @@ int searchHomeFilePath(char **foundpath, const char *subdir, const char *filenam
|
|||
#ifdef _WIN32
|
||||
struct _stat st;
|
||||
// Mingw _stat fails if path ends with /, so let's use a stripped path
|
||||
if (path[strlen(path) - 1] == '/') {
|
||||
path[strlen(path) - 1] = '\0';
|
||||
if (str_endswith(path, PATHSEP))
|
||||
|
||||
memset(path + (strlen(path) - strlen(PATHSEP)), 0x00, strlen(PATHSEP));
|
||||
result = _stat(path, &st);
|
||||
path[strlen(path)] = '/';
|
||||
strncat(path, PATHSEP, strlen(PATHSEP));
|
||||
} else {
|
||||
result = _stat(path, &st);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue