diff options
| author | Alex Rønne Petersen <alex@alexrp.com> | 2025-12-22 12:50:46 +0100 |
|---|---|---|
| committer | Alex Rønne Petersen <alex@alexrp.com> | 2025-12-22 12:50:46 +0100 |
| commit | aa0249d74e573742db3567f589fc6e4a00e1fff8 (patch) | |
| tree | cce61cb7f02072d205a12ae451922f0bf09c13ce /lib/std/process.zig | |
| parent | 6b9125cbe662d530160e0732c856aa0da86894c0 (diff) | |
| parent | 02c5f05e2f0e8e786f0530014e35c1520efd0084 (diff) | |
| download | zig-aa0249d74e573742db3567f589fc6e4a00e1fff8.tar.gz zig-aa0249d74e573742db3567f589fc6e4a00e1fff8.zip | |
Merge pull request 'std.ascii: rename indexOf functions to find' (#30101) from adria/zig:indexof-find into master
Reviewed-on: https://codeberg.org/ziglang/zig/pulls/30101
Reviewed-by: Andrew Kelley <andrewrk@noreply.codeberg.org>
Reviewed-by: mlugg <mlugg@noreply.codeberg.org>
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 = |
