From 5f383966a91d82394c69ea66ed64cf238bcf0ba0 Mon Sep 17 00:00:00 2001 From: Yorhel <git@yorhel.nl> Date: Thu, 24 Mar 2022 07:32:53 +0100 Subject: [PATCH] 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 --- src/scan.zig | 2 -- 1 file changed, 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; -- GitLab