summaryrefslogtreecommitdiff
path: root/src/libs/dutil/WixToolset.DUtil/logutil.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/libs/dutil/WixToolset.DUtil/logutil.cpp')
-rw-r--r--src/libs/dutil/WixToolset.DUtil/logutil.cpp15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/libs/dutil/WixToolset.DUtil/logutil.cpp b/src/libs/dutil/WixToolset.DUtil/logutil.cpp
index bd21098c..94c21374 100644
--- a/src/libs/dutil/WixToolset.DUtil/logutil.cpp
+++ b/src/libs/dutil/WixToolset.DUtil/logutil.cpp
@@ -117,6 +117,7 @@ extern "C" HRESULT DAPI LogOpen(
117{ 117{
118 HRESULT hr = S_OK; 118 HRESULT hr = S_OK;
119 BOOL fEnteredCriticalSection = FALSE; 119 BOOL fEnteredCriticalSection = FALSE;
120 LPWSTR sczCombined = NULL;
120 LPWSTR sczLogDirectory = NULL; 121 LPWSTR sczLogDirectory = NULL;
121 122
122 ::EnterCriticalSection(&LogUtil_csLog); 123 ::EnterCriticalSection(&LogUtil_csLog);
@@ -129,9 +130,20 @@ extern "C" HRESULT DAPI LogOpen(
129 } 130 }
130 else 131 else
131 { 132 {
132 hr = PathConcat(wzDirectory, wzLog, &LogUtil_sczLogPath); 133 hr = PathConcat(wzDirectory, wzLog, &sczCombined);
133 LoguExitOnFailure(hr, "Failed to combine the log path."); 134 LoguExitOnFailure(hr, "Failed to combine the log path.");
134 135
136 if (!PathIsFullyQualified(sczCombined, NULL))
137 {
138 hr = PathExpand(&LogUtil_sczLogPath, sczCombined, PATH_EXPAND_FULLPATH);
139 LoguExitOnFailure(hr, "Failed to expand the log path.");
140 }
141 else
142 {
143 LogUtil_sczLogPath = sczCombined;
144 sczCombined = NULL;
145 }
146
135 hr = PathGetDirectory(LogUtil_sczLogPath, &sczLogDirectory); 147 hr = PathGetDirectory(LogUtil_sczLogPath, &sczLogDirectory);
136 LoguExitOnFailure(hr, "Failed to get log directory."); 148 LoguExitOnFailure(hr, "Failed to get log directory.");
137 149
@@ -176,6 +188,7 @@ LExit:
176 ::LeaveCriticalSection(&LogUtil_csLog); 188 ::LeaveCriticalSection(&LogUtil_csLog);
177 } 189 }
178 190
191 ReleaseStr(sczCombined);
179 ReleaseStr(sczLogDirectory); 192 ReleaseStr(sczLogDirectory);
180 193
181 return hr; 194 return hr;