authorgravatar for squeek502@hotmail.comRyan Liptak <squeek502@hotmail.com> 2025-11-16 03:45:38-08:00
committergravatar for squeek502@hotmail.comRyan Liptak <squeek502@hotmail.com> 2025-11-16 04:03:52-08:00
logadf74ba4fb86b9fa95739e9e6cb78bf93858e1a5
treed8331a109b4fd873ea829bf13550d9cc7ab270b6
parentaa4332fb0e5f46657c8c41a3971150b642be1c19

windows.eqlIgnoreCaseWTF16 -> eqlIgnoreCaseWtf16

Consistent with naming of other, similar functions

3 files changed, 7 insertions(+), 7 deletions(-)

lib/std/os/windows.zig+4-4
......@@ -2088,7 +2088,7 @@ pub fn nanoSecondsToFileTime(ns: Io.Timestamp) FILETIME {
20882088/// Compares two WTF16 strings using the equivalent functionality of
20892089/// `RtlEqualUnicodeString` (with case insensitive comparison enabled).
20902090/// This function can be called on any target.
2091pub fn eqlIgnoreCaseWTF16(a: []const u16, b: []const u16) bool {
2091pub fn eqlIgnoreCaseWtf16(a: []const u16, b: []const u16) bool {
20922092 if (@inComptime() or builtin.os.tag != .windows) {
20932093 // This function compares the strings code unit by code unit (aka u16-to-u16),
20942094 // so any length difference implies inequality. In other words, there's no possible
......@@ -2165,19 +2165,19 @@ pub fn eqlIgnoreCaseWtf8(a: []const u8, b: []const u8) bool {
21652165
21662166fn testEqlIgnoreCase(comptime expect_eql: bool, comptime a: []const u8, comptime b: []const u8) !void {
21672167 try std.testing.expectEqual(expect_eql, eqlIgnoreCaseWtf8(a, b));
2168 try std.testing.expectEqual(expect_eql, eqlIgnoreCaseWTF16(
2168 try std.testing.expectEqual(expect_eql, eqlIgnoreCaseWtf16(
21692169 std.unicode.utf8ToUtf16LeStringLiteral(a),
21702170 std.unicode.utf8ToUtf16LeStringLiteral(b),
21712171 ));
21722172
21732173 try comptime std.testing.expect(expect_eql == eqlIgnoreCaseWtf8(a, b));
2174 try comptime std.testing.expect(expect_eql == eqlIgnoreCaseWTF16(
2174 try comptime std.testing.expect(expect_eql == eqlIgnoreCaseWtf16(
21752175 std.unicode.utf8ToUtf16LeStringLiteral(a),
21762176 std.unicode.utf8ToUtf16LeStringLiteral(b),
21772177 ));
21782178}
21792179
2180test "eqlIgnoreCaseWTF16/Wtf8" {
2180test "eqlIgnoreCaseWtf16/Wtf8" {
21812181 try testEqlIgnoreCase(true, "\x01 a B Λ ɐ", "\x01 A b λ Ɐ");
21822182 // does not do case-insensitive comparison for codepoints >= U+10000
21832183 try testEqlIgnoreCase(false, "𐓏", "𐓷");
lib/std/process.zig+1-1
......@@ -564,7 +564,7 @@ pub fn getenvW(key: [*:0]const u16) ?[:0]const u16 {
564564 };
565565
566566 const this_key = key_value[0..equal_index];
567 if (windows.eqlIgnoreCaseWTF16(key_slice, this_key)) {
567 if (windows.eqlIgnoreCaseWtf16(key_slice, this_key)) {
568568 return key_value[equal_index + 1 ..];
569569 }
570570
lib/std/process/Child.zig+2-2
......@@ -1227,7 +1227,7 @@ fn windowsCreateProcessPathExt(
12271227 const app_name = app_buf.items[0..app_name_len];
12281228 const ext_start = std.mem.lastIndexOfScalar(u16, app_name, '.') orelse break :unappended err;
12291229 const ext = app_name[ext_start..];
1230 if (windows.eqlIgnoreCaseWTF16(ext, unicode.utf8ToUtf16LeStringLiteral(".EXE"))) {
1230 if (windows.eqlIgnoreCaseWtf16(ext, unicode.utf8ToUtf16LeStringLiteral(".EXE"))) {
12311231 return error.UnrecoverableInvalidExe;
12321232 }
12331233 break :unappended err;
......@@ -1278,7 +1278,7 @@ fn windowsCreateProcessPathExt(
12781278 // On InvalidExe, if the extension of the app name is .exe then
12791279 // it's treated as an unrecoverable error. Otherwise, it'll be
12801280 // skipped as normal.
1281 if (windows.eqlIgnoreCaseWTF16(ext, unicode.utf8ToUtf16LeStringLiteral(".EXE"))) {
1281 if (windows.eqlIgnoreCaseWtf16(ext, unicode.utf8ToUtf16LeStringLiteral(".EXE"))) {
12821282 return error.UnrecoverableInvalidExe;
12831283 }
12841284 continue;