aboutsummaryrefslogtreecommitdiff
path: root/navigator.c
diff options
context:
space:
mode:
Diffstat (limited to 'navigator.c')
-rw-r--r--navigator.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/navigator.c b/navigator.c
index ccfeb51..e5babdb 100644
--- a/navigator.c
+++ b/navigator.c
@@ -78,6 +78,10 @@ void imv_navigator_add_path(struct imv_navigator *nav, const char *path)
if(d) {
struct dirent *dir;
while((dir = readdir(d)) != NULL) {
+ if(strcmp(dir->d_name, "..") == 0 ||
+ strcmp(dir->d_name, ".") == 0) {
+ continue;
+ }
snprintf(path_buf, sizeof(path_buf), "%s/%s", path, dir->d_name);
add_item(nav, path_buf);
}
@@ -97,6 +101,10 @@ void imv_navigator_add_path_recursive(struct imv_navigator *nav, const char *pat
if(d) {
struct dirent *dir;
while((dir = readdir(d)) != NULL) {
+ if(strcmp(dir->d_name, "..") == 0 ||
+ strcmp(dir->d_name, ".") == 0) {
+ continue;
+ }
snprintf(path_buf, sizeof(path_buf), "%s/%s", path, dir->d_name);
imv_navigator_add_path_recursive(nav, path_buf);
}