mirror of
https://git.disroot.org/80486DX2-66/polonium.git
synced 2024-09-19 02:25:33 +05:30
main.c: use correct_slashes
only on Windows
This commit is contained in:
parent
ee1dff912b
commit
e12a75788a
12
src/main.c
12
src/main.c
@ -66,12 +66,15 @@ static uint8_t threshold = 2;
|
||||
static size_t passes = 1;
|
||||
|
||||
/* function definitions */
|
||||
#ifdef SYS_NT
|
||||
static char* correct_slashes(const char* path);
|
||||
#endif
|
||||
static char* my_basename(const char* raw_path);
|
||||
static void parse_value(uint8_t destination, const char* arg);
|
||||
bool args_match(const char* arg, const char* args_list[]);
|
||||
|
||||
/* function implementations */
|
||||
#ifdef SYS_NT
|
||||
static char* correct_slashes(const char* path) {
|
||||
char* new_path = strdup(path);
|
||||
if (new_path == NULL)
|
||||
@ -86,9 +89,16 @@ static char* correct_slashes(const char* path) {
|
||||
|
||||
return new_path;
|
||||
}
|
||||
#endif
|
||||
|
||||
static char* my_basename(const char* raw_path) {
|
||||
char* path = correct_slashes(raw_path);
|
||||
char* path =
|
||||
#ifdef SYSNT
|
||||
correct_slashes
|
||||
#else
|
||||
strdup
|
||||
#endif
|
||||
(raw_path);
|
||||
if (path == NULL)
|
||||
return NULL;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user