Skip to content

Commit

Permalink
Use os::getExtension instead of the legacy path_get_extension function
Browse files Browse the repository at this point in the history
  • Loading branch information
codereader committed Jan 29, 2017
1 parent 2183d3d commit 2ab4d29
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 13 deletions.
12 changes: 0 additions & 12 deletions libs/os/path.h
Expand Up @@ -137,18 +137,6 @@ inline const char* path_get_filename_start(const char* path)
return path;
}

/// \brief Returns a pointer to the first character of the file extension of \p path, or "" if not found.
/// O(n)
inline const char* path_get_extension(const char* path)
{
const char* last_period = strrchr(path_get_filename_start(path), '.');
if(last_period != 0)
{
return ++last_period;
}
return "";
}

/** General utility functions for OS-related tasks
*/
namespace os
Expand Down
2 changes: 1 addition & 1 deletion radiant/map/Map.cpp
Expand Up @@ -194,7 +194,7 @@ MapFormatPtr Map::getFormatForFile(const std::string& filename)
std::string gameType = GlobalGameManager().currentGame()->getKeyValue("type");

MapFormatPtr mapFormat = GlobalMapFormatManager().getMapFormatForGameType(
gameType, path_get_extension(filename.c_str()));
gameType, os::getExtension(filename));

ASSERT_MESSAGE(mapFormat != NULL, "map format not found for file " + filename);

Expand Down

0 comments on commit 2ab4d29

Please sign in to comment.