diff options
author | Laszlo Csomor <laszlocsomor@google.com> | 2017-02-07 09:51:58 +0000 |
---|---|---|
committer | Kristina Chodorow <kchodorow@google.com> | 2017-02-07 18:26:57 +0000 |
commit | d657d7b5bd24e2c7411828b9652152cbb479a3a9 (patch) | |
tree | c39e810ac9055e176f6efc05ec3fff4861059230 /src/test | |
parent | 8e0991cb19eadfcb651cd6987255d5f7c0a58e0a (diff) |
Windows: fix off-by-one errors with MAX_PATH
In almost every place we compared paths against
MAX_PATH, we had it wrong. MAX_PATH is the
null-terminated maximum length, so paths exactly
MAX_PATH long (not counting the null-terminator)
were incorrectly considered short.
Also fix the error message in the MSVC python
wrapper, because it reported an incorrect path
length limit in the warning message.
See https://github.com/bazelbuild/bazel/issues/2107
--
PiperOrigin-RevId: 146762382
MOS_MIGRATED_REVID=146762382
Diffstat (limited to 'src/test')
-rw-r--r-- | src/test/java/com/google/devtools/build/lib/windows/WindowsProcessesTest.java | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/test/java/com/google/devtools/build/lib/windows/WindowsProcessesTest.java b/src/test/java/com/google/devtools/build/lib/windows/WindowsProcessesTest.java index b19ea488e7..0c477cc8ad 100644 --- a/src/test/java/com/google/devtools/build/lib/windows/WindowsProcessesTest.java +++ b/src/test/java/com/google/devtools/build/lib/windows/WindowsProcessesTest.java @@ -387,7 +387,7 @@ public class WindowsProcessesTest { process = WindowsProcesses.nativeCreateProcess(mockBinary, mockArgs("O."), null, dir1, null, null); assertNoProcessError(); - byte[] buf = new byte[1024]; // Windows MAX_PATH is 256, but whatever + byte[] buf = new byte[1024]; // Windows MAX_PATH is 260, but whatever int len = readStdout(buf, 0, 1024); assertNoProcessError(); assertThat(new String(buf, 0, len, UTF8).replace("\\", "/")).isEqualTo(dir1); |