diff --git a/hecl/lib/ProjectPath.cpp b/hecl/lib/ProjectPath.cpp index e7a2b1155..1e305f3e9 100644 --- a/hecl/lib/ProjectPath.cpp +++ b/hecl/lib/ProjectPath.cpp @@ -323,7 +323,7 @@ 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('\\')) + if (end != origEnd && (*end == _S('/') || *end == _S('\\'))) ++end; subpathOut.assign(end, origEnd); return newRootPath;