Skip to content
Snippets Groups Projects
Commit 5f383966 authored by Yorhel's avatar Yorhel
Browse files

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
parent 3942722e
No related branches found
No related tags found
No related merge requests found
......@@ -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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment