summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/filesystem.c8
-rw-r--r--src/world.c10
2 files changed, 9 insertions, 9 deletions
diff --git a/src/filesystem.c b/src/filesystem.c
index 27476ec..957629b 100644
--- a/src/filesystem.c
+++ b/src/filesystem.c
@@ -324,7 +324,9 @@ lilv_dir_for_each(const char* path,
HANDLE fh = FindFirstFile(pat, &fd);
if (fh != INVALID_HANDLE_VALUE) {
do {
- f(path, fd.cFileName, data);
+ if (strcmp(fd.cFileName, ".") && strcmp(fd.cFileName, "..")) {
+ f(path, fd.cFileName, data);
+ }
} while (FindNextFile(fh, &fd));
}
free(pat);
@@ -332,7 +334,9 @@ lilv_dir_for_each(const char* path,
DIR* dir = opendir(path);
if (dir) {
for (struct dirent* entry = NULL; (entry = readdir(dir));) {
- f(path, entry->d_name, data);
+ if (strcmp(entry->d_name, ".") && strcmp(entry->d_name, "..")) {
+ f(path, entry->d_name, data);
+ }
}
closedir(dir);
}
diff --git a/src/world.c b/src/world.c
index 17896ee..7095a6e 100644
--- a/src/world.c
+++ b/src/world.c
@@ -956,13 +956,9 @@ static void
load_dir_entry(const char* dir, const char* name, void* data)
{
LilvWorld* world = (LilvWorld*)data;
- if (!strcmp(name, ".") || !strcmp(name, "..")) {
- return;
- }
-
- char* path = lilv_strjoin(dir, "/", name, "/", NULL);
- SerdNode suri = serd_node_new_file_uri((const uint8_t*)path, 0, 0, true);
- LilvNode* node = lilv_new_uri(world, (const char*)suri.buf);
+ char* path = lilv_strjoin(dir, "/", name, "/", NULL);
+ SerdNode suri = serd_node_new_file_uri((const uint8_t*)path, 0, 0, true);
+ LilvNode* node = lilv_new_uri(world, (const char*)suri.buf);
lilv_world_load_bundle(world, node);
lilv_node_free(node);