Fixed read_directory(): Leave us stuck at EOF - GnomeVFS behaves that way.
[ntfsprogs-gnomevfs.git] / src / gnome-vfs-method.c
index fbd4b13..0758d2e 100644 (file)
@@ -400,6 +400,7 @@ s64 pos;
 
        if (!libntfs_directory->file_info_list->data) {
                g_assert(libntfs_directory->file_info_list->next==NULL);
+               /* Do not clear the list to leave us stuck at EOF - GnomeVFS behaves that way. */
                errvfsresult=GNOME_VFS_ERROR_EOF;
                }
        else {
@@ -408,10 +409,10 @@ s64 pos;
                                file_info,      /* dest */
                                libntfs_directory->file_info_list->data);       /* src */
                gnome_vfs_file_info_unref(libntfs_directory->file_info_list->data);
+               libntfs_directory->file_info_list=g_list_delete_link(
+                               libntfs_directory->file_info_list,libntfs_directory->file_info_list);
                errvfsresult=GNOME_VFS_OK;
                }
-       libntfs_directory->file_info_list=g_list_delete_link(
-                       libntfs_directory->file_info_list,libntfs_directory->file_info_list);
        return errvfsresult;
 }