1
0
mirror of https://github.com/Tha14/toxic.git synced 2025-06-30 03:56:45 +02:00

drop broken windows support

This commit is contained in:
Jfreegman
2014-06-11 14:37:36 -04:00
parent 328e7f8d57
commit 12e33a1760
4 changed files with 5 additions and 67 deletions

View File

@ -240,16 +240,12 @@ void get_file_name(uint8_t *namebuf, uint8_t *pathname)
while (idx >= 0 && pathname[idx] == '/')
pathname[idx--] = '\0';
uint8_t *filename = strrchr(pathname, '/'); /* Try unix style paths */
uint8_t *filename = strrchr(pathname, '/');
if (filename != NULL) {
if (!strlen(++filename))
filename = pathname;
} else {
filename = strrchr(pathname, '\\'); /* Try windows style paths */
if (filename == NULL)
filename = pathname;
if (filename == NULL) {
filename = pathname;
} else if (!strlen(++filename)) {
filename = pathname;
}
snprintf(namebuf, MAX_STR_SIZE, "%s", filename);