+2002-09-30 Theodore Ts'o <tytso@mit.edu>
+
+ * dir_com.c (search_dir_entries): If there is a directory entry of
+ length 0, go to the next block, so we don't end up looping
+ forever.
+
2001-09-24 Theodore Tso <tytso@mit.edu>
* Release of E2fsprogs 1.29
{
struct struct_file_info info; /* Temporary variables used to */
struct ext2_dir_entry_2 *dir_entry_ptr; /* contain the current search entries */
-
- int return_code;
+ int return_code, next;
info=first_file_info; /* Start from the first entry - Read it */
low_read (info.buffer,file_system_info.block_size,info.global_block_offset);
dir_entry_ptr=(struct ext2_dir_entry_2 *) (info.buffer+info.dir_entry_offset);
info.dir_entry_num++;
- info.dir_entry_offset+=dir_entry_ptr->rec_len;
- info.file_offset+=dir_entry_ptr->rec_len;
+ next = dir_entry_ptr->rec_len;
+ if (!next)
+ next = file_system_info.block_size - info.dir_entry_offset;
+ info.dir_entry_offset += next;
+ info.file_offset += next;
if (info.file_offset >= info.file_length) break;