mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-16 23:10:54 +00:00
Make RenderDoc::SetLogFile safer
logFile will be "" when the app is launched from renderdoccmd on Linux.
This commit is contained in:
@@ -773,9 +773,12 @@ void RenderDoc::SetCaptureOptions(const CaptureOptions &opts)
|
||||
|
||||
void RenderDoc::SetLogFile(const char *logFile)
|
||||
{
|
||||
if (logFile == NULL || logFile[0] == '\0')
|
||||
return;
|
||||
|
||||
m_LogFile = logFile;
|
||||
|
||||
if(m_LogFile.substr(m_LogFile.length()-4) == ".rdc")
|
||||
if(m_LogFile.length() > 4 && m_LogFile.substr(m_LogFile.length()-4) == ".rdc")
|
||||
m_LogFile = m_LogFile.substr(0, m_LogFile.length()-4);
|
||||
|
||||
FileIO::CreateParentDirectory(m_LogFile);
|
||||
|
||||
Reference in New Issue
Block a user