Codechange: use std::string for FiosIsRoot

This commit is contained in:
Rubidium
2023-05-30 22:37:33 +02:00
committed by rubidium42
parent 13789d1703
commit f2e704b9a7
4 changed files with 8 additions and 8 deletions

View File

@@ -36,9 +36,9 @@
# include <i86.h>
#endif
bool FiosIsRoot(const char *file)
bool FiosIsRoot(const std::string &file)
{
return file[3] == '\0';
return file.size() == 3; // C:\...
}
void FiosGetDrives(FileList &file_list)

View File

@@ -57,9 +57,9 @@
#include "../../safeguards.h"
bool FiosIsRoot(const char *path)
bool FiosIsRoot(const std::string &path)
{
return path[1] == '\0';
return path == PATHSEP;
}
void FiosGetDrives(FileList &file_list)

View File

@@ -168,9 +168,9 @@ int closedir(DIR *d)
return 0;
}
bool FiosIsRoot(const char *file)
bool FiosIsRoot(const std::string &file)
{
return file[3] == '\0'; // C:\...
return file.size() == 3; // C:\...
}
void FiosGetDrives(FileList &file_list)