Skip to content

Commit a10813c

Browse files
committed
improve fs_foreach
1 parent 6631a29 commit a10813c

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

docs/changes.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
* 修复OpenGL启动多重采样后fbo截屏没有抗锯齿的问题(感谢智明提供补丁)
1313
* 修复进度条设置部分圆角矩形的时候画面不正常的问题(感谢智明提供补丁)
1414
* 完善 统一foreach visit返回值处理逻辑(感谢兆坤提供补丁)
15+
* 完善 fs_foreach(感谢兆坤提供补丁)
1516

1617
2025/08/23
1718
* 完善 dlist_remove_ex

src/tkc/fs.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -807,11 +807,16 @@ ret_t fs_foreach(const char* path, int depth, tk_visit_t on_file, tk_visit_t on_
807807
ret, log_warn("%s: result type REMOVE is not supported!\n", __FUNCTION__));
808808
}
809809
} else if (item.is_dir) {
810+
bool_t is_skip = FALSE;
810811
if (on_dir != NULL) {
811812
ret = on_dir(ctx, filename);
813+
is_skip = (RET_SKIP == ret);
812814
TK_FOREACH_VISIT_RESULT_PROCESSING(
813815
ret, log_warn("%s: result type REMOVE is not supported!\n", __FUNCTION__));
814816
}
817+
if (is_skip) {
818+
continue;
819+
}
815820
ret = fs_foreach(filename, depth - 1, on_file, on_dir, ctx);
816821
TK_FOREACH_VISIT_RESULT_PROCESSING(
817822
ret, log_warn("%s: result type REMOVE is not supported!\n", __FUNCTION__));

0 commit comments

Comments
 (0)