Skip to content
This repository has been archived by the owner on May 16, 2020. It is now read-only.

Commit

Permalink
qcommon: use strrchr in COM_SkipPath
Browse files Browse the repository at this point in the history
  • Loading branch information
Exagone313 committed Jan 28, 2019
1 parent 6e1b03c commit 120d8c6
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions src/qcommon/q_shared.c
Original file line number Diff line number Diff line change
Expand Up @@ -81,17 +81,16 @@ void COM_FixPath(char *pathname)
*/
char *COM_SkipPath(char *pathname)
{
char *last = pathname;
char *last = strrchr(pathname, '/');

while (*pathname)
if (last)
{
if (*pathname == '/')
{
last = pathname + 1;
}
pathname++;
return last + 1;
}
else
{
return pathname;
}
return last;
}

/**
Expand Down

0 comments on commit 120d8c6

Please sign in to comment.