REVIEWED: GetFileExtension() to include the dot #1523

This commit is contained in:
Ray
2021-03-02 01:07:08 +01:00
parent 2ff5fa73e9
commit bcc4418ff0
5 changed files with 19 additions and 19 deletions

View File

@@ -2351,14 +2351,14 @@ bool DirectoryExists(const char *dirPath)
return result;
}
// Get pointer to extension for a filename string
// Get pointer to extension for a filename string (includes the dot: .png)
const char *GetFileExtension(const char *fileName)
{
const char *dot = strrchr(fileName, '.');
if (!dot || dot == fileName) return NULL;
return (dot + 1);
return dot;
}
// String pointer reverse break: returns right-most occurrence of charset in s