From 8e75fed8d95e5cbccfd3e1545ed3613e45c5b7eb Mon Sep 17 00:00:00 2001 From: Frank-74 Date: Sun, 21 Aug 2016 17:20:42 +0100 Subject: [PATCH] Fix Exception in main.cpp If Project64 is run from C:\Project64, we get an exception in main.cpp. This fixes that bug. --- Source/Common/path.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Source/Common/path.cpp b/Source/Common/path.cpp index 0fc797bdf..7d4a2f381 100644 --- a/Source/Common/path.cpp +++ b/Source/Common/path.cpp @@ -587,6 +587,11 @@ void CPath::SetComponents(const char * lpszDrive, const char * lpszDirectory, co char buff_fullname[MAX_PATH]; memset(buff_fullname, 0, sizeof(buff_fullname)); + if (lpszDirectory == NULL || strlen(lpszDirectory) == 0) + { + static char empty_dir[] = { DIRECTORY_DELIMITER, '\0' }; + lpszDirectory = empty_dir; + } _makepath(buff_fullname, lpszDrive, lpszDirectory, lpszName, lpszExtension); m_strPath.erase();