From eb4a1bb91d76a52d1f8019694f6ddcb374c6ab1c Mon Sep 17 00:00:00 2001
From: "alexey.stratulat" <alexey.stratulat@demlabs.net>
Date: Wed, 3 Apr 2024 11:57:13 +0700
Subject: [PATCH] [+] Added filter for paths '.' and '..' so that empty
 directories are not displayed.

---
 modules/net/dap_chain_node_cli_cmd.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/modules/net/dap_chain_node_cli_cmd.c b/modules/net/dap_chain_node_cli_cmd.c
index 85db305dd0..38f68d3f19 100644
--- a/modules/net/dap_chain_node_cli_cmd.c
+++ b/modules/net/dap_chain_node_cli_cmd.c
@@ -1875,6 +1875,8 @@ int l_arg_index = 1, l_rc, cmd_num = CMD_NONE;
                 struct dirent * l_dir_entry = NULL;
 
                 while( (l_dir_entry = readdir(l_dir)) ) {
+                    if (dap_strcmp(l_dir_entry->d_name, "..") == 0 || dap_strcmp(l_dir_entry->d_name, ".") == 0)
+                        continue;
                     json_object * json_obj_wall = json_object_new_object();
                     if (!json_obj_wall) {
                         json_object_put(json_arr_out);
-- 
GitLab