Skip to content

Commit 18acbe1

Browse files
authored
Merge pull request #311 from rxbryan/hotfix23
fix depth in directory iterator
2 parents 24f9a4e + cfe94c3 commit 18acbe1

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

source/extensions/plugin_extension/source/plugin_extension.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ void *plugin_load_from_path(size_t argc, void *args[], void *data)
7171
auto i = fs::recursive_directory_iterator(ext_path);
7272
while (i != fs::recursive_directory_iterator())
7373
{
74-
if (i.depth() == 2)
74+
if (i.depth() == 1)
7575
{
7676
i.disable_recursion_pending();
7777
}
@@ -95,7 +95,11 @@ void *plugin_load_from_path(size_t argc, void *args[], void *data)
9595
return metacall_value_create_int(4);
9696
}
9797

98-
i.pop();
98+
i++;
99+
if (i != fs::end(i) && i.depth() == 1)
100+
{
101+
i.pop();
102+
}
99103
continue;
100104
}
101105
}

0 commit comments

Comments
 (0)