Minor improvements

This commit is contained in:
Jack Andersen 2017-10-25 19:37:15 -10:00
parent b7208bfc5f
commit 5e99ee1d95
4 changed files with 7 additions and 0 deletions

View File

@ -260,6 +260,8 @@ static hecl::SystemString MakePathArgAbsolute(const hecl::SystemString& arg,
#else
if (arg[0] == _S('/') || arg[0] == _S('\\'))
return arg;
if (cwd.back() == _S('/') || cwd.back() == _S('\\'))
return cwd + arg;
return cwd + _S('/') + arg;
#endif
}

View File

@ -503,6 +503,7 @@ public:
uint32_t toUint32() const {return num;}
operator uint32_t() const {return num;}
const char* getChars() const {return fcc;}
char* getChars() {return fcc;}
};
#define FOURCC(chars) FourCC(SBIG(chars))

View File

@ -323,6 +323,8 @@ ProjectRootPath SearchForProject(const SystemString& path, SystemString& subpath
SystemString::const_iterator origEnd = testRoot.getAbsolutePath().end();
while (end != origEnd && *end != _S('/') && *end != _S('\\'))
++end;
if (*end == _S('/') || *end == _S('\\'))
++end;
subpathOut.assign(end, origEnd);
return newRootPath;
}

View File

@ -215,6 +215,8 @@ bool IsPathBlend(const hecl::ProjectPath& path)
bool IsPathYAML(const hecl::ProjectPath& path)
{
if (!hecl::StrCmp(path.getLastComponent(), _S("!catalog.yaml")))
return false; /* !catalog.yaml is exempt from general use */
const SystemChar* lastCompExt = path.getLastComponentExt();
if (!lastCompExt)
return false;