From 6b0f2d978504da82070523eb6adb0b59f9812e93 Mon Sep 17 00:00:00 2001 From: Sean Hall Date: Fri, 3 Jun 2022 17:48:39 -0500 Subject: Add PathSkipPastRoot. --- src/burn/engine/logging.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/burn/engine/logging.cpp') 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( if (sczPrefixFormatted && *sczPrefixFormatted) { + // Best effort to open default logging. LPCWSTR wzPrefix = sczPrefixFormatted; + LPCWSTR wzPastRoot = PathSkipPastRoot(sczPrefixFormatted, NULL, NULL, NULL); - // Best effort to open default logging. - if (PathIsRooted(sczPrefixFormatted)) + // If the log path is rooted and has a file component, then use that path as is. + if (wzPastRoot && *wzPastRoot) { hr = PathGetDirectory(sczPrefixFormatted, &sczLoggingBaseFolder); ExitOnFailure(hr, "Failed to get parent directory from '%ls'.", sczPrefixFormatted); -- cgit v1.2.3-55-g6feb