Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
zackradisic committed Feb 8, 2025
1 parent 6e7bdb0 commit a535ac0
Showing 1 changed file with 0 additions and 15 deletions.
15 changes: 0 additions & 15 deletions src/glob/ascii.zig
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,6 @@ pub fn match(alloc: Allocator, glob: []const u8, path: []const u8) MatchResult {
}

inline fn globMatchImpl(state: *State, glob: []const u8, path: []const u8) bool {
debugDisallowWindowsBackslashPatterns(glob);
while (state.glob_index < glob.len or state.path_index < path.len) {
if (state.glob_index < glob.len) {
switch (glob[state.glob_index]) {
Expand Down Expand Up @@ -271,20 +270,6 @@ inline fn globMatchImpl(state: *State, glob: []const u8, path: []const u8) bool
return true;
}

fn debugDisallowWindowsBackslashPatterns(glob: []const u8) void {
if (comptime bun.Environment.isWindows) {
var i: usize = 0;
while (i < glob.len) : (i += 1) {
if (glob[i] == '\\' and i + 1 < glob.len and switch (glob[i + 1]) {
'[', '{', '!', '*', '?' => false,
else => true,
}) {
@panic("Please do not use Windows backslashes in glob patterns.");
}
}
}
}

fn matchBrace(state: *State, glob: []const u8, path: []const u8) bool {
if (state.depth + 1 > BRACE_DEPTH_MAX) {
return false; // Invalid pattern! Too many nested braces
Expand Down

0 comments on commit a535ac0

Please sign in to comment.