Skip to content

Commit

Permalink
stb.h: stb_splitpath correctly handles relative paths with explicit d…
Browse files Browse the repository at this point in the history
…rive specifiers
  • Loading branch information
Sean Barrett committed Aug 28, 2021
1 parent 59e7dec commit ef86142
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions deprecated/stb.h
Original file line number Diff line number Diff line change
Expand Up @@ -2423,6 +2423,12 @@ static char *stb__splitpath_raw(char *buffer, char *path, int flag)
char *s = stb_strrchr2(path, '/', '\\');
char *t = strrchr(path, '.');
if (s && t && t < s) t = NULL;

if (!s) {
// check for drive
if (isalpha(path[0]) && path[1] == ':')
s = &path[1];
}
if (s) ++s;

if (flag == STB_EXT_NO_PERIOD)
Expand Down

0 comments on commit ef86142

Please sign in to comment.