Commit 8492ced075

Jonathan Marler <johnnymarler@gmail.com>
2022-02-07 07:30:06
incorporate review changes from squeek
1 parent 71f6919
Changed files (1)
lib
lib/std/process.zig
@@ -100,7 +100,7 @@ pub const EnvMap = struct {
                     if (upcase(c_a) != upcase(c_b))
                         return false;
                 }
-                if (it_b.nextCodepoint()) |_| return false;
+                return if (it_b.nextCodepoint()) |_| false else true;
             }
             return std.hash_map.eqlString(a, b);
         }
@@ -232,6 +232,12 @@ test "EnvMap" {
     try testing.expect(env.get("SOMETHING_NEW") == null);
 
     try testing.expectEqual(@as(EnvMap.Size, 1), env.count());
+
+    // test Unicode case-insensitivity on Windows
+    if (builtin.os.tag == .windows) {
+        try env.put("КИРиллИЦА", "something else");
+        try testing.expectEqualStrings("something else", env.get("кириллица").?);
+    }
 }
 
 /// Returns a snapshot of the environment variables of the current process.