mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-07-30 11:39:14 -07:00
streamline works
This commit is contained in:
parent
5060a52b3a
commit
600e5d7d6f
4 changed files with 112 additions and 64 deletions
|
@ -139,7 +139,7 @@ static bool is_directory(const char *filename) {
|
|||
#ifdef _WIN32
|
||||
#define make_dir(a) _mkdir(a)
|
||||
#else
|
||||
#define make_dir(a) mkdir(a,0755)
|
||||
#define make_dir(a) mkdir(a,0755) //note 0755 MUST have leading 0 for octal linux file permissions
|
||||
#endif
|
||||
bool create_path(const char *dirname) {
|
||||
|
||||
|
@ -190,6 +190,24 @@ bool create_path(const char *dirname) {
|
|||
return true;
|
||||
}
|
||||
|
||||
bool setDefaultPath (savePaths_t pathIndex,const char *Path) {
|
||||
|
||||
if (pathIndex < spItemCount) {
|
||||
if ((Path == NULL) && (session.defaultPaths[pathIndex] != NULL)) {
|
||||
free (session.defaultPaths[pathIndex]);
|
||||
session.defaultPaths[pathIndex] = NULL;
|
||||
}
|
||||
|
||||
if (Path != NULL) {
|
||||
session.defaultPaths[pathIndex] = (char *)realloc(session.defaultPaths[pathIndex], strlen(Path) + 1);
|
||||
strcpy(session.defaultPaths[pathIndex], Path);
|
||||
}
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static char *filenamemcopy(const char *preferredName, const char *suffix) {
|
||||
if (preferredName == NULL) return NULL;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue