mirror of https://github.com/MidnightCommander/mc
* vfs/extfs.c (extfs_done): Free all live archives.
Fixes savannah bug #13953. (extfs_free_entries): Comment out - it is unused. (extfs_free_archive): Use extfs_free_entry () instead of extfs_free_entries (). (extfs_free): Reflect the changes above. Simplify.
This commit is contained in:
parent
06b721a44c
commit
c585dcb01a
|
@ -1,3 +1,13 @@
|
|||
2006-03-23 Pavel Tsekov <ptsekov@gmx.net>
|
||||
|
||||
* extfs.c (extfs_done): Free all live archives.
|
||||
Fixes savannah bug #13953.
|
||||
(extfs_free_entries): Comment out - it is unused.
|
||||
(extfs_free_archive): Use extfs_free_entry () instead of
|
||||
extfs_free_entries ().
|
||||
(extfs_free): Reflect the changes above.
|
||||
Simplify.
|
||||
|
||||
2006-03-23 Pavel Tsekov <ptsekov@gmx.net>
|
||||
|
||||
* direntry.c (vfs_s_inode_from_path): Do not give up if a given path
|
||||
|
|
18
vfs/extfs.c
18
vfs/extfs.c
|
@ -97,6 +97,7 @@ static struct entry *extfs_find_entry (struct entry *dir, char *name,
|
|||
static int extfs_which (struct vfs_class *me, const char *path);
|
||||
static void extfs_remove_entry (struct entry *e);
|
||||
static void extfs_free (vfsid id);
|
||||
static void extfs_free_entry (struct entry *e);
|
||||
|
||||
static struct vfs_class vfs_extfs_ops;
|
||||
static struct archive *first_archive = NULL;
|
||||
|
@ -196,15 +197,17 @@ static struct entry *extfs_generate_entry (struct archive *archive,
|
|||
return entry;
|
||||
}
|
||||
|
||||
#if 0
|
||||
static void extfs_free_entries (struct entry *entry)
|
||||
{
|
||||
(void) entry;
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
static void extfs_free_archive (struct archive *archive)
|
||||
{
|
||||
extfs_free_entries (archive->root_entry);
|
||||
extfs_free_entry (archive->root_entry);
|
||||
if (archive->local_name != NULL) {
|
||||
struct stat my;
|
||||
|
||||
|
@ -1230,15 +1233,14 @@ static void extfs_free (vfsid id)
|
|||
struct archive *parc;
|
||||
struct archive *archive = (struct archive *)id;
|
||||
|
||||
extfs_free_entry (archive->root_entry);
|
||||
if (archive == first_archive) {
|
||||
first_archive = archive->next;
|
||||
} else {
|
||||
for (parc = first_archive; parc != NULL; parc = parc->next)
|
||||
if (parc->next == archive)
|
||||
if (parc->next == archive) {
|
||||
parc->next = archive->next;
|
||||
break;
|
||||
if (parc != NULL)
|
||||
parc->next = archive->next;
|
||||
}
|
||||
}
|
||||
extfs_free_archive (archive);
|
||||
}
|
||||
|
@ -1355,9 +1357,15 @@ static int extfs_which (struct vfs_class *me, const char *path)
|
|||
static void extfs_done (struct vfs_class *me)
|
||||
{
|
||||
int i;
|
||||
struct archive *ar;
|
||||
|
||||
(void) me;
|
||||
|
||||
for (ar = first_archive; ar != NULL;) {
|
||||
extfs_free ((vfsid) ar);
|
||||
ar = first_archive;
|
||||
}
|
||||
|
||||
for (i = 0; i < extfs_no; i++ )
|
||||
g_free (extfs_prefixes [i]);
|
||||
extfs_no = 0;
|
||||
|
|
Loading…
Reference in New Issue