mirror of
https://github.com/mamedev/mame.git
synced 2024-11-16 07:48:32 +01:00
util/zippath.cpp: OSD_WINDOWS isn't a safe way to detect Windows target, and OSD_* macros must not be used outside libocore/libosd.
This commit is contained in:
parent
2e9297ee05
commit
bdbf452e91
1 changed files with 4 additions and 1 deletions
|
@ -48,7 +48,9 @@ int is_path_separator(char c)
|
|||
|
||||
bool is_root(std::string_view path)
|
||||
{
|
||||
#if defined(OSD_WINDOWS)
|
||||
#if defined(WIN32)
|
||||
// FIXME: don't assume paths are DOS-like - UNC paths, \\?\ long path prefix, etc. complicate this
|
||||
|
||||
// skip drive letter
|
||||
if (path.length() >= 2 && isalpha(path[0]) && (path[1] == ':'))
|
||||
path.remove_prefix(2);
|
||||
|
@ -56,6 +58,7 @@ bool is_root(std::string_view path)
|
|||
// skip path separators
|
||||
return path.find_first_not_of(PATH_SEPARATOR) == std::string_view::npos;
|
||||
#else
|
||||
// FIXME: handle multiple successive path separators, current directory references, parent directory references
|
||||
return (path.length() == 1) && (path[0] == '/');
|
||||
#endif
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue