From 5e99ee1d950ec52b6cafab37792a32a8f0272c92 Mon Sep 17 00:00:00 2001 From: Jack Andersen Date: Wed, 25 Oct 2017 19:37:15 -1000 Subject: [PATCH] Minor improvements --- hecl/driver/ToolBase.hpp | 2 ++ hecl/include/hecl/hecl.hpp | 1 + hecl/lib/ProjectPath.cpp | 2 ++ hecl/lib/hecl.cpp | 2 ++ 4 files changed, 7 insertions(+) diff --git a/hecl/driver/ToolBase.hpp b/hecl/driver/ToolBase.hpp index a013ee7dd..7ec7aa7e9 100644 --- a/hecl/driver/ToolBase.hpp +++ b/hecl/driver/ToolBase.hpp @@ -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 } diff --git a/hecl/include/hecl/hecl.hpp b/hecl/include/hecl/hecl.hpp index fb4880dc0..cb41beab9 100644 --- a/hecl/include/hecl/hecl.hpp +++ b/hecl/include/hecl/hecl.hpp @@ -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)) diff --git a/hecl/lib/ProjectPath.cpp b/hecl/lib/ProjectPath.cpp index e2b079cf1..e7a2b1155 100644 --- a/hecl/lib/ProjectPath.cpp +++ b/hecl/lib/ProjectPath.cpp @@ -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; } diff --git a/hecl/lib/hecl.cpp b/hecl/lib/hecl.cpp index fa257ab72..960926d82 100644 --- a/hecl/lib/hecl.cpp +++ b/hecl/lib/hecl.cpp @@ -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;