From 9b41f6fa92cfdb0996faeb5ebc0c4d4ac410e19e Mon Sep 17 00:00:00 2001 From: Miles Bader Date: Mon, 11 Aug 1997 19:03:21 +0000 Subject: (sweep): Don't delete entries that have the NOENT flag set. (refresh_dir): Ensure that there are entries for `.' and `..'. --- ftpfs/dir.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'ftpfs') diff --git a/ftpfs/dir.c b/ftpfs/dir.c index f2de9277..e0d96e84 100644 --- a/ftpfs/dir.c +++ b/ftpfs/dir.c @@ -194,7 +194,7 @@ sweep (struct ftpfs_dir *dir) for (i = 0; i < len; i++) for (e = htable[i]; e; e = e->next) - if (! e->valid) + if (!e->valid && !e->noent) delete (e, dir); } @@ -372,6 +372,12 @@ refresh_dir (struct ftpfs_dir *dir, int update_stats, time_t timestamp) dfs.timestamp = timestamp; dfs.prev_entry_next_p = &dir->ordered; + /* Make sure `.' and `..' are always included (if the actual list also + includes `.' and `..', the ordered may be rearranged). */ + err = update_ordered_name (".", &dfs); + if (! err) + err = update_ordered_name ("..", &dfs); + /* Refetch the directory from the server. */ if (update_stats) /* Fetch both names and stat info. */ -- cgit v1.2.3