aboutsummaryrefslogtreecommitdiff
path: root/src/libs/dutil/WixToolset.DUtil/logutil.cpp
diff options
context:
space:
mode:
authorSean Hall <r.sean.hall@gmail.com>2022-06-03 17:47:31 -0500
committerSean Hall <r.sean.hall@gmail.com>2022-06-07 19:44:36 -0500
commit8a4d03207633e9fdc364aaed82bd167f844679f9 (patch)
tree9ca862bb51fd3507fc5867c292aef236e3411867 /src/libs/dutil/WixToolset.DUtil/logutil.cpp
parent5d35ff01e33b8ffdab04a49ddc5927185309391a (diff)
downloadwix-8a4d03207633e9fdc364aaed82bd167f844679f9.tar.gz
wix-8a4d03207633e9fdc364aaed82bd167f844679f9.tar.bz2
wix-8a4d03207633e9fdc364aaed82bd167f844679f9.zip
Resolve paths while parsing them from the command line.
The current directory is a process wide setting that can potentially be changed by any thread. Remove fileutil methods that had equivalent pathutil methods.
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;