diff --git a/src/qcommon/q_shared.c b/src/qcommon/q_shared.c index 2e37aa643e..cef46780c8 100644 --- a/src/qcommon/q_shared.c +++ b/src/qcommon/q_shared.c @@ -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; } /**