1
0
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:
Intel A80486DX2-66 2024-08-06 23:07:23 +03:00
parent ee1dff912b
commit e12a75788a
Signed by: 80486DX2-66
GPG Key ID: 83631EF27054609B

View File

@ -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;