summaryrefslogtreecommitdiff
path: root/src/Stream.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/Stream.zig')
-rw-r--r--src/Stream.zig4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/Stream.zig b/src/Stream.zig
index 8e51b797..1e6abbc5 100644
--- a/src/Stream.zig
+++ b/src/Stream.zig
@@ -44,6 +44,8 @@ const batch_ns = 16 * std.time.ns_per_ms;
const batch_bytes = 256 * 1024;
/// A bigger file is not searched.
const max_file_bytes = 16 << 20;
+/// The walk goes no deeper than this many directories below its root.
+const max_walk_depth = 16;
/// What a worker sends: rows as fs.zig wrote them (`path:line:col-end
/// text`, a listing's `path`), relative to the search's directory. Owned by
@@ -883,7 +885,7 @@ const Worker = struct {
const path = if (prefix.len == 0) e.name else try std.fmt.allocPrint(a, "{s}/{s}", .{ prefix, e.name });
switch (e.kind) {
.directory => {
- if (depth + 1 >= filesystem.WalkNotes.max_depth or e.name[0] == '.') continue;
+ if (depth + 1 >= max_walk_depth or e.name[0] == '.') continue;
if (for (filesystem.find_skip) |skip| {
if (std.mem.eql(u8, e.name, skip)) break true;
} else false) continue;