diff options
author | Laszlo Csomor <laszlocsomor@google.com> | 2017-07-20 10:09:44 +0200 |
---|---|---|
committer | Klaus Aehlig <aehlig@google.com> | 2017-07-20 10:33:15 +0200 |
commit | 6d47707a96752d3b876bed5cfd253d5e064cbec1 (patch) | |
tree | 15d5bf5d848bf648377138998511be3a593bcf93 /src/main/native | |
parent | 897018267e9bd78f343e068eee8fdfd82b9c292e (diff) |
Windows: clean up error reporting
In this commit:
- remove blaze::PrintError in favor of
blaze_util::PrintError
- remove Ijar's PrintLastErrorMessage in favor of
blaze_util::PrintError
- use pdie every time path conversion fails,
because that indicates a fatal error (bad user
input for a path flag, or downright bug)
- remove explicitly printing GetLastErrror; pdie
and PrintError do it already
- unify the pdie/PrintError message formats
Fixes https://github.com/bazelbuild/bazel/issues/2935
Change-Id: I5feaf73885cab95c43a28c529ada6942e037b162
PiperOrigin-RevId: 162587490
Diffstat (limited to 'src/main/native')
-rw-r--r-- | src/main/native/windows/file.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/main/native/windows/file.h b/src/main/native/windows/file.h index b1a57101ff..a8cbe71c5a 100644 --- a/src/main/native/windows/file.h +++ b/src/main/native/windows/file.h @@ -28,8 +28,11 @@ using std::wstring; template <typename char_type> bool HasUncPrefix(const char_type* path) { - return path[0] == '\\' && (path[1] == '\\' || path[1] == '?') && - (path[2] == '.' || path[2] == '?') && path[3] == '\\'; + // Return true iff `path` starts with "\\?\", "\\.\", or "\??\". + return path[0] == '\\' && + ((path[1] == '\\' && (path[2] == '?' || path[2] == '.')) || + (path[1] == '?' && path[2] == '?')) && + path[3] == '\\'; } // Keep in sync with j.c.g.devtools.build.lib.windows.WindowsFileOperations |