summaryrefslogtreecommitdiff
path: root/src/burn/engine/logging.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/burn/engine/logging.cpp')
-rw-r--r--src/burn/engine/logging.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/burn/engine/logging.cpp b/src/burn/engine/logging.cpp
index 3a403025..77f5079c 100644
--- a/src/burn/engine/logging.cpp
+++ b/src/burn/engine/logging.cpp
@@ -134,10 +134,12 @@ extern "C" HRESULT LoggingOpen(
134 134
135 if (sczPrefixFormatted && *sczPrefixFormatted) 135 if (sczPrefixFormatted && *sczPrefixFormatted)
136 { 136 {
137 // Best effort to open default logging.
137 LPCWSTR wzPrefix = sczPrefixFormatted; 138 LPCWSTR wzPrefix = sczPrefixFormatted;
139 LPCWSTR wzPastRoot = PathSkipPastRoot(sczPrefixFormatted, NULL, NULL, NULL);
138 140
139 // Best effort to open default logging. 141 // If the log path is rooted and has a file component, then use that path as is.
140 if (PathIsRooted(sczPrefixFormatted)) 142 if (wzPastRoot && *wzPastRoot)
141 { 143 {
142 hr = PathGetDirectory(sczPrefixFormatted, &sczLoggingBaseFolder); 144 hr = PathGetDirectory(sczPrefixFormatted, &sczLoggingBaseFolder);
143 ExitOnFailure(hr, "Failed to get parent directory from '%ls'.", sczPrefixFormatted); 145 ExitOnFailure(hr, "Failed to get parent directory from '%ls'.", sczPrefixFormatted);