diff options
author | pommicket <pommicket@gmail.com> | 2023-01-12 22:35:09 -0500 |
---|---|---|
committer | pommicket <pommicket@gmail.com> | 2023-01-12 22:35:29 -0500 |
commit | 1b318330c94a19b922d05b6fac19f6a4a59d248a (patch) | |
tree | 60ad90ff82c182435abd37aac6f791b97fd42c98 /util.c | |
parent | 024fd444d673be63ac23fc83481a8fe624127cbf (diff) |
[2.0] minor windows path-related fixes, windows installer version
Diffstat (limited to 'util.c')
-rw-r--r-- | util.c | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -338,9 +338,10 @@ void qsort_with_context(void *base, size_t nmemb, size_t size, #endif const char *path_filename(const char *path) { - const char *last_path_sep = strrchr(path, PATH_SEPARATOR); - if (last_path_sep) - return last_path_sep + 1; + for (int i = (int)strlen(path) - 1; i >= 0; --i) { + if (strchr(ALL_PATH_SEPARATORS, path[i])) + return &path[i+1]; + } // (a relative path with no path separators) return path; } |