diff --git a/src/vfs/extfs/extfs.c b/src/vfs/extfs/extfs.c index 162be497f..be3662288 100644 --- a/src/vfs/extfs/extfs.c +++ b/src/vfs/extfs/extfs.c @@ -666,6 +666,7 @@ extfs_which (struct vfs_class *me, const char *path) static const char * extfs_get_path_int (const vfs_path_t * vpath, struct archive **archive, gboolean do_not_open) { + char *archive_name; int result = -1; struct archive *parc; int fstype; @@ -677,6 +678,8 @@ extfs_get_path_int (const vfs_path_t * vpath, struct archive **archive, gboolean if (fstype == -1) return NULL; + archive_name = vfs_path_to_str_elements_count (vpath, -1); + /* * All filesystems should have some local archive, at least * it can be PATH_SEP ('/'). @@ -684,14 +687,15 @@ extfs_get_path_int (const vfs_path_t * vpath, struct archive **archive, gboolean for (parc = first_archive; parc != NULL; parc = parc->next) if (parc->name != NULL) { - if (strcmp (parc->name, vfs_path_as_str (vpath)) == 0) + if (strcmp (parc->name, archive_name) == 0) { vfs_stamp (&vfs_extfs_ops, (vfsid) parc); goto return_success; } } - result = do_not_open ? -1 : extfs_read_archive (fstype, vfs_path_as_str (vpath), &parc); + result = do_not_open ? -1 : extfs_read_archive (fstype, archive_name, &parc); + g_free (archive_name); if (result == -1) { path_element->class->verrno = EIO;