summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2022-03-24 07:32:53 +0100
committerYorhel <git@yorhel.nl>2022-03-24 07:32:55 +0100
commit5f383966a91d82394c69ea66ed64cf238bcf0ba0 (patch)
treee14bb0e80d0aa6db93d24ec6df6860ea35fa8f57
parent3942722eba5a53fce68054b65cef4e36f1b6d339 (diff)
Fix bad assertion in scan.zig:addSpecial()
While it's true that the root item can't be a special, the first item to be added is not necessarily the root item. In particular, it isn't when refreshing. Probably fixes #194
-rw-r--r--src/scan.zig2
1 files changed, 0 insertions, 2 deletions
diff --git a/src/scan.zig b/src/scan.zig
index b2a6d8b..86f7061 100644
--- a/src/scan.zig
+++ b/src/scan.zig
@@ -379,8 +379,6 @@ const Context = struct {
// Insert the current path as a special entry (i.e. a file/dir that is not counted)
// Ignores self.stat except for the 'dir' option.
fn addSpecial(self: *Self, t: Special) void {
- std.debug.assert(self.items_seen > 0); // root item can't be a special
-
if (t == .err) {
if (self.last_error) |p| main.allocator.free(p);
self.last_error = main.allocator.dupeZ(u8, self.path.items) catch unreachable;