aboutsummaryrefslogtreecommitdiff
path: root/src/dutil/pathutil.cpp
diff options
context:
space:
mode:
authorRob Mensching <rob@firegiant.com>2021-04-08 14:06:21 -0700
committerRob Mensching <rob@firegiant.com>2021-04-12 12:29:11 -0700
commitb2c4600453f926fbfdc63219126930ad39601f25 (patch)
treeb7c8429ffcfe4f1f8b98f9e43b00d671b2d3a1d6 /src/dutil/pathutil.cpp
parent0c2b4cf3a439eda3e19d20fadfc65ddc7d0394c0 (diff)
downloadwix-b2c4600453f926fbfdc63219126930ad39601f25.tar.gz
wix-b2c4600453f926fbfdc63219126930ad39601f25.tar.bz2
wix-b2c4600453f926fbfdc63219126930ad39601f25.zip
Port missing WiX v3 changes
Diffstat (limited to 'src/dutil/pathutil.cpp')
-rw-r--r--src/dutil/pathutil.cpp33
1 files changed, 33 insertions, 0 deletions
diff --git a/src/dutil/pathutil.cpp b/src/dutil/pathutil.cpp
index ec338f71..183849ac 100644
--- a/src/dutil/pathutil.cpp
+++ b/src/dutil/pathutil.cpp
@@ -215,6 +215,39 @@ LExit:
215} 215}
216 216
217 217
218DAPI_(HRESULT) PathGetParentPath(
219 __in_z LPCWSTR wzPath,
220 __out_z LPWSTR *psczParent
221 )
222{
223 HRESULT hr = S_OK;
224 LPCWSTR wzParent = NULL;
225
226 for (LPCWSTR wz = wzPath; *wz; ++wz)
227 {
228 if (wz[1] && (L'\\' == *wz || L'/' == *wz))
229 {
230 wzParent = wz;
231 }
232 }
233
234 if (wzParent)
235 {
236 DWORD cchPath = static_cast<DWORD>(wzParent - wzPath) + 1;
237
238 hr = StrAllocString(psczParent, wzPath, cchPath);
239 PathExitOnFailure(hr, "Failed to copy directory.");
240 }
241 else
242 {
243 ReleaseNullStr(psczParent);
244 }
245
246LExit:
247 return hr;
248}
249
250
218DAPI_(HRESULT) PathExpand( 251DAPI_(HRESULT) PathExpand(
219 __out LPWSTR *psczFullPath, 252 __out LPWSTR *psczFullPath,
220 __in_z LPCWSTR wzRelativePath, 253 __in_z LPCWSTR wzRelativePath,