From b69acfaa1c281ac2e8fd7450f07bb3735d24ae23 Mon Sep 17 00:00:00 2001 From: laszlocsomor Date: Fri, 21 Jul 2017 13:18:13 +0200 Subject: Windows: add blaze_util::AsAbsoluteWindowsPath Replace blaze_util::AsWindowsPathWithUncPrefix with AsAbsoluteWindowsPath, which always returns an absolute path. Fixes https://github.com/bazelbuild/bazel/issues/2935 RELNOTES: none PiperOrigin-RevId: 162727218 --- third_party/ijar/mapped_file_windows.cc | 10 ++++------ third_party/ijar/platform_utils.cc | 4 ++-- 2 files changed, 6 insertions(+), 8 deletions(-) (limited to 'third_party/ijar') diff --git a/third_party/ijar/mapped_file_windows.cc b/third_party/ijar/mapped_file_windows.cc index 253065e453..abc93c2791 100644 --- a/third_party/ijar/mapped_file_windows.cc +++ b/third_party/ijar/mapped_file_windows.cc @@ -45,9 +45,8 @@ MappedInputFile::MappedInputFile(const char* name) { errmsg_ = errmsg; wstring wname; - if (!blaze_util::AsWindowsPathWithUncPrefix(name, &wname)) { - blaze_util::pdie(255, "MappedInputFile(%s): AsWindowsPathWithUncPrefix", - name); + if (!blaze_util::AsAbsoluteWindowsPath(name, &wname)) { + blaze_util::pdie(255, "MappedInputFile(%s): AsAbsoluteWindowsPath", name); } HANDLE file = CreateFileW(wname.c_str(), GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, NULL); @@ -120,9 +119,8 @@ MappedOutputFile::MappedOutputFile(const char* name, u8 estimated_size) { errmsg_ = errmsg; wstring wname; - if (!blaze_util::AsWindowsPathWithUncPrefix(name, &wname)) { - blaze_util::pdie(255, "MappedOutputFile(%s): AsWindowsPathWithUncPrefix", - name); + if (!blaze_util::AsAbsoluteWindowsPath(name, &wname)) { + blaze_util::pdie(255, "MappedOutputFile(%s): AsAbsoluteWindowsPath", name); } HANDLE file = CreateFileW(wname.c_str(), GENERIC_READ | GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, 0, NULL); diff --git a/third_party/ijar/platform_utils.cc b/third_party/ijar/platform_utils.cc index a998cabc8e..dde8868005 100644 --- a/third_party/ijar/platform_utils.cc +++ b/third_party/ijar/platform_utils.cc @@ -38,8 +38,8 @@ using std::string; bool stat_file(const char* path, Stat* result) { #if defined(COMPILER_MSVC) || defined(__CYGWIN__) std::wstring wpath; - if (!blaze_util::AsWindowsPathWithUncPrefix(path, &wpath)) { - blaze_util::pdie(255, "stat_file: AsWindowsPathWithUncPrefix(%s)", path); + if (!blaze_util::AsAbsoluteWindowsPath(path, &wpath)) { + blaze_util::pdie(255, "stat_file: AsAbsoluteWindowsPath(%s)", path); } bool success = false; BY_HANDLE_FILE_INFORMATION info; -- cgit v1.2.3