mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-20 13:23:51 -07:00
Get ~/.proxmark3 working on Mingw
This commit is contained in:
parent
d2d58db985
commit
11c7db3523
1 changed files with 10 additions and 6 deletions
16
client/ui.c
16
client/ui.c
|
@ -27,7 +27,10 @@
|
||||||
#include "proxmark3.h" // PROXLOG
|
#include "proxmark3.h" // PROXLOG
|
||||||
#include "fileutils.h"
|
#include "fileutils.h"
|
||||||
#include "pm3_cmd.h"
|
#include "pm3_cmd.h"
|
||||||
|
#ifdef _WIN32
|
||||||
|
# include <direct.h> // _mkdir
|
||||||
|
#endif
|
||||||
|
#include <time.h>
|
||||||
session_arg_t session;
|
session_arg_t session;
|
||||||
|
|
||||||
double CursorScaleFactor = 1;
|
double CursorScaleFactor = 1;
|
||||||
|
@ -55,15 +58,16 @@ int searchHomeFilePath(char **foundpath, const char *filename, bool create_home)
|
||||||
strcpy(path, user_path);
|
strcpy(path, user_path);
|
||||||
strcat(path, PM3_USER_DIRECTORY);
|
strcat(path, PM3_USER_DIRECTORY);
|
||||||
|
|
||||||
#ifdef _WIN32
|
// Mingw: _stat fails on mangled HOME path /pm3 => C:\ProxSpace\pm3, while stat works fine
|
||||||
struct _stat st;
|
|
||||||
int result = _stat(path, &st);
|
|
||||||
#else
|
|
||||||
struct stat st;
|
struct stat st;
|
||||||
int result = stat(path, &st);
|
int result = stat(path, &st);
|
||||||
#endif
|
|
||||||
if ((result != 0) && create_home) {
|
if ((result != 0) && create_home) {
|
||||||
|
|
||||||
|
#ifdef _WIN32
|
||||||
|
if (_mkdir(path)) {
|
||||||
|
#else
|
||||||
if (mkdir(path, 0700)) {
|
if (mkdir(path, 0700)) {
|
||||||
|
#endif
|
||||||
free(path);
|
free(path);
|
||||||
return PM3_EFILE;
|
return PM3_EFILE;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue