Skip to content

Commit

Permalink
shell: windows: make EnvMap case-insensitive (#9704)
Browse files Browse the repository at this point in the history
* shell: windows: make EnvMap case-insensitive

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
  • Loading branch information
nektro and autofix-ci[bot] committed Mar 29, 2024
1 parent 40f61eb commit fb8a299
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/shell/interpreter.zig
Original file line number Diff line number Diff line change
Expand Up @@ -509,11 +509,17 @@ pub const EnvMap = struct {
const MapType = std.ArrayHashMap(EnvStr, EnvStr, struct {
pub fn hash(self: @This(), s: EnvStr) u32 {
_ = self;
if (bun.Environment.isWindows) {
return bun.CaseInsensitiveASCIIStringContext.hash(undefined, s.slice());
}
return std.array_hash_map.hashString(s.slice());
}
pub fn eql(self: @This(), a: EnvStr, b: EnvStr, b_index: usize) bool {
_ = self;
_ = b_index;
if (bun.Environment.isWindows) {
return bun.CaseInsensitiveASCIIStringContext.eql(undefined, a.slice(), b.slice(), undefined);
}
return std.array_hash_map.eqlString(a.slice(), b.slice());
}
}, true);
Expand Down

0 comments on commit fb8a299

Please sign in to comment.