OSDN Git Service

paths_FindFileName(): return the folder name if passing the path with trailing slash
authorsdottaka <none@none>
Sat, 6 Jul 2013 05:14:44 +0000 (14:14 +0900)
committersdottaka <none@none>
Sat, 6 Jul 2013 05:14:44 +0000 (14:14 +0900)
Src/paths.cpp

index 3c2e0f7..16e5e4f 100644 (file)
@@ -97,7 +97,11 @@ String paths_FindFileName(const String& path)
 {
        const TCHAR *filename = path.c_str();
        while (const TCHAR *slash = _tcspbrk(filename, _T("\\/")))
+       {
+               if (*(slash + 1) == '\0')
+                       break;
                filename = slash + 1;
+       }
        return filename;
 }