From 2002396b8bd9960642b34693518195014f40d891 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ricardo=20Lu=C3=ADs=20Vaz=20Silva?= Date: Mon, 29 Jan 2024 18:57:39 -0300 Subject: [PATCH] Fix `..` to root folder in relative include --- src/common/scripting/frontend/zcc_parser.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/common/scripting/frontend/zcc_parser.cpp b/src/common/scripting/frontend/zcc_parser.cpp index 1b7e846fd9..6ea3c316e6 100644 --- a/src/common/scripting/frontend/zcc_parser.cpp +++ b/src/common/scripting/frontend/zcc_parser.cpp @@ -71,9 +71,16 @@ static FString ResolveIncludePath(const FString &path,const FString &lumpname){ { relativePath = relativePath.Mid(3); auto slash_index = fullPath.LastIndexOf("/"); - if (slash_index != -1) { + if (slash_index != -1) + { fullPath = fullPath.Mid(0, slash_index); - } else { + } + else if (fullPath.IsNotEmpty()) + { + fullPath = ""; + } + else + { pathOk = false; break; }