Common/FileSystem: Fix a couple of warnings from #2716
This commit is contained in:
parent
e6741dad9b
commit
fca4a2ec28
|
@ -451,7 +451,7 @@ void CanonicalizePath(char* Destination, u32 cbDestination, const char* Path, bo
|
||||||
{
|
{
|
||||||
char prevCh = (i > 0) ? Path[i - 1] : '\0';
|
char prevCh = (i > 0) ? Path[i - 1] : '\0';
|
||||||
char currentCh = Path[i];
|
char currentCh = Path[i];
|
||||||
char nextCh = (i < pathLength) ? Path[i + 1] : '\0';
|
char nextCh = (i < (pathLength - 1)) ? Path[i + 1] : '\0';
|
||||||
|
|
||||||
if (currentCh == '.')
|
if (currentCh == '.')
|
||||||
{
|
{
|
||||||
|
@ -557,8 +557,8 @@ void CanonicalizePath(std::string& path, bool OSPath /*= true*/)
|
||||||
|
|
||||||
static inline bool FileSystemCharacterIsSane(char c, bool StripSlashes)
|
static inline bool FileSystemCharacterIsSane(char c, bool StripSlashes)
|
||||||
{
|
{
|
||||||
if (!(c >= 'a' && c <= 'z') && !(c >= 'A' && c <= 'Z') && !(c >= '0' && c <= '9') && c != ' ' && c != ' ' &&
|
if (!(c >= 'a' && c <= 'z') && !(c >= 'A' && c <= 'Z') && !(c >= '0' && c <= '9') && c != ' ' && c != '_' &&
|
||||||
c != '_' && c != '-' && c != '.')
|
c != '-' && c != '.')
|
||||||
{
|
{
|
||||||
if (!StripSlashes && (c == '/' || c == '\\'))
|
if (!StripSlashes && (c == '/' || c == '\\'))
|
||||||
return true;
|
return true;
|
||||||
|
|
Loading…
Reference in New Issue