diff options
| author | AdriĆ Arrufat <adria.arrufat@gmail.com> | 2025-12-04 11:10:30 +0900 |
|---|---|---|
| committer | mlugg <mlugg@noreply.codeberg.org> | 2025-12-05 14:31:27 +0100 |
| commit | 02c5f05e2f0e8e786f0530014e35c1520efd0084 (patch) | |
| tree | 38b298fa7849d78c7d02294e7bd3b7aed2b7e52c /lib/std/process.zig | |
| parent | 1a420a8dca34db8b632b0451d022ef92f78f96ac (diff) | |
| download | zig-02c5f05e2f0e8e786f0530014e35c1520efd0084.tar.gz zig-02c5f05e2f0e8e786f0530014e35c1520efd0084.zip | |
std: replace usages of std.mem.indexOf with std.mem.find
Diffstat (limited to 'lib/std/process.zig')
| -rw-r--r-- | lib/std/process.zig | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/std/process.zig b/lib/std/process.zig index d0424d09d1..a0a26c766f 100644 --- a/lib/std/process.zig +++ b/lib/std/process.zig @@ -546,7 +546,7 @@ pub fn getenvW(key: [*:0]const u16) ?[:0]const u16 { } const key_slice = mem.sliceTo(key, 0); // '=' anywhere but the start makes this an invalid environment variable name - if (key_slice.len > 0 and std.mem.indexOfScalar(u16, key_slice[1..], '=') != null) { + if (key_slice.len > 0 and std.mem.findScalar(u16, key_slice[1..], '=') != null) { return null; } const ptr = windows.peb().ProcessParameters.Environment; @@ -559,7 +559,7 @@ pub fn getenvW(key: [*:0]const u16) ?[:0]const u16 { // if it's the first character. // https://devblogs.microsoft.com/oldnewthing/20100506-00/?p=14133 const equal_search_start: usize = if (key_value[0] == '=') 1 else 0; - const equal_index = std.mem.indexOfScalarPos(u16, key_value, equal_search_start, '=') orelse { + const equal_index = std.mem.findScalarPos(u16, key_value, equal_search_start, '=') orelse { // This is enforced by CreateProcess. // If violated, CreateProcess will fail with INVALID_PARAMETER. unreachable; // must contain a = |
