aboutsummaryrefslogtreecommitdiffhomepage
path: root/third_party/ijar
diff options
context:
space:
mode:
authorGravatar laszlocsomor <laszlocsomor@google.com>2017-07-21 13:18:13 +0200
committerGravatar Jakob Buchgraber <buchgr@google.com>2017-07-24 09:51:01 +0200
commitb69acfaa1c281ac2e8fd7450f07bb3735d24ae23 (patch)
treebc6eb5f65d44fc8a29bcaba197f1e87ba7ab1a1a /third_party/ijar
parent1920dd98491fdb00daf6187beed58c8ff06d4fd6 (diff)
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
Diffstat (limited to 'third_party/ijar')
-rw-r--r--third_party/ijar/mapped_file_windows.cc10
-rw-r--r--third_party/ijar/platform_utils.cc4
2 files changed, 6 insertions, 8 deletions
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;