From 96632fcff13a0c671994cf57d7bd207c928467eb Mon Sep 17 00:00:00 2001 From: Pavel Roskin Date: Thu, 20 Jun 2002 21:10:06 +0000 Subject: [PATCH] * dir.c (handle_dirent): Don't process ".." entries. (handle_path): Likewise. From Andrew V. Samoilov --- src/ChangeLog | 6 ++++++ src/dir.c | 13 ++++++------- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 3bc093cdd..63e22dfbf 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2002-06-20 Pavel Roskin + + * dir.c (handle_dirent): Don't process ".." entries. + (handle_path): Likewise. + From Andrew V. Samoilov + 2002-06-13 Oskar Liljeblad * slint.c (has_colors): Don't reset SLtt_Use_Ansi_Colors to 0 if diff --git a/src/dir.c b/src/dir.c index a1606da83..d72fe1a94 100644 --- a/src/dir.c +++ b/src/dir.c @@ -378,13 +378,10 @@ handle_dirent (dir_list *list, char *filter, struct dirent *dp, { if (dp->d_name [0] == '.' && dp->d_name [1] == 0) return 0; - if (!show_dot_files){ - if (dp->d_name [0] == '.'){ - if (!(dp->d_name [1] == 0)) - if (!(dp->d_name [1] == '.' && NLENGTH (dp) == 2)) - return 0; - } - } + if (dp->d_name [0] == '.' && dp->d_name [1] == '.' && dp->d_name [2] == 0) + return 0; + if (!show_dot_files && (dp->d_name [0] == '.')) + return 0; if (!show_backups && dp->d_name [NLENGTH (dp)-1] == '~') return 0; if (mc_lstat (dp->d_name, buf1) == -1) { @@ -432,6 +429,8 @@ handle_path (dir_list *list, char *path, { if (path [0] == '.' && path [1] == 0) return 0; + if (path [0] == '.' && path [1] == '.' && path [2] == 0) + return 0; if (mc_lstat (path, buf1) == -1) return 0;