diff --git a/source/common/utility/findfile.cpp b/source/common/utility/findfile.cpp index ac0ca8fdf..6006a34a1 100644 --- a/source/common/utility/findfile.cpp +++ b/source/common/utility/findfile.cpp @@ -208,10 +208,10 @@ bool D_AddFile(TArray& wadfiles, const char* file, bool check, int posi // Confirm file exists in filesystem. struct stat info; bool found = stat(file, &info) == 0; + FString fullpath = file; if (!found) { // File not found, so split file into path and filename so we can enumerate the path for the file. - FString fullpath = file; auto lastindex = fullpath.LastIndexOf("/"); FString basepath = fullpath.Left(lastindex); FString filename = fullpath.Right(fullpath.Len() - lastindex - 1);