summaryrefslogtreecommitdiff
path: root/ftpfs/dir.c
diff options
context:
space:
mode:
authorMiles Bader <miles@gnu.org>1997-08-11 19:03:21 +0000
committerMiles Bader <miles@gnu.org>1997-08-11 19:03:21 +0000
commit9b41f6fa92cfdb0996faeb5ebc0c4d4ac410e19e (patch)
treef97cb0f791ca0866819e4349e20dcba77ddd7ae6 /ftpfs/dir.c
parent949bb413bb8aad6eadc39a2da36fa3cafd62cd89 (diff)
(sweep):
Don't delete entries that have the NOENT flag set. (refresh_dir): Ensure that there are entries for `.' and `..'.
Diffstat (limited to 'ftpfs/dir.c')
-rw-r--r--ftpfs/dir.c8
1 files changed, 7 insertions, 1 deletions
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. */