aboutsummaryrefslogtreecommitdiff
path: root/lib/std/os.zig
diff options
context:
space:
mode:
authorJonathan S <gereeter+code@gmail.com>2020-03-27 14:28:48 -0500
committerAndrew Kelley <andrew@ziglang.org>2020-05-29 18:23:06 -0400
commit631633b25253201968b97cf129d986def37eed4a (patch)
treea09677ad9b9e71568c4ad384ac48a2a71710f628 /lib/std/os.zig
parent4c8b937fb016a54b09d7447ca634b7cf1af78fce (diff)
downloadzig-631633b25253201968b97cf129d986def37eed4a.tar.gz
zig-631633b25253201968b97cf129d986def37eed4a.zip
Document and reduce usage of MAX_PATH_BYTES, lifting arbitrary buffer size requirements
Diffstat (limited to 'lib/std/os.zig')
-rw-r--r--lib/std/os.zig2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/std/os.zig b/lib/std/os.zig
index 22c884fce8..0fbffc822e 100644
--- a/lib/std/os.zig
+++ b/lib/std/os.zig
@@ -1236,6 +1236,8 @@ pub fn execvpeZ_expandArg0(
if (mem.indexOfScalar(u8, file_slice, '/') != null) return execveZ(file, child_argv, envp);
const PATH = getenvZ("PATH") orelse "/usr/local/bin:/bin/:/usr/bin";
+ // Use of MAX_PATH_BYTES here is valid as the path_buf will be passed
+ // directly to the operating system in execveZ.
var path_buf: [MAX_PATH_BYTES]u8 = undefined;
var it = mem.tokenize(PATH, ":");
var seen_eacces = false;