- if (path_len >= PATH_MAX) {
- ret = BT_PLUGIN_STATUS_ERROR;
- goto end;
- }
-
- entry = alloc_dirent(path);
- if (!entry) {
- ret = BT_PLUGIN_STATUS_ERROR;
- goto end;
- }
-
- file_path = zmalloc(PATH_MAX);
- if (!file_path) {
- ret = BT_PLUGIN_STATUS_NOMEM;
- goto end;
- }
-
- strncpy(file_path, path, path_len);
- /* Append a trailing '/' to the path */
- if (file_path[path_len - 1] != '/') {
- file_path[path_len++] = '/';
- }
-
- directory = opendir(file_path);
- if (!directory) {
- perror("Failed to open plug-in directory");
- ret = BT_PLUGIN_STATUS_ERROR;
- goto end;
- }
-
- /* Recursively walk directory */
- while (!readdir_r(directory, entry, &result) && result) {
- struct stat st;
- int stat_ret;
- size_t file_name_len;
-
- if (result->d_name[0] == '.') {
- /* Skip hidden files, . and .. */
- continue;
+ if (name[0] == '.') {
+ /* Skip hidden files */
+ BT_LOGV("Skipping hidden file: path=\"%s\"", file);
+ goto end;