Merge pull request #38 from leper/dir_sep

Use the DIR_SEP macro to remove an ifdef.
This commit is contained in:
Frank Denis 2018-02-04 08:58:40 +01:00 committed by GitHub
commit e5f7f65b8a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -170,14 +170,9 @@ file_basename(const char *file)
{
char *ptr;
if ((ptr = strrchr(file, '/')) != NULL) {
if ((ptr = strrchr(file, DIR_SEP)) != NULL) {
return ptr + 1;
}
#ifdef _WIN32
if ((ptr = strrchr(file, '\\')) != NULL) {
return ptr + 1;
}
#endif
return file;
}