Changeset 84226f0 in mainline
- Timestamp:
- 2011-03-09T15:06:31Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- e2abab03
- Parents:
- a210bc7
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/fs/ext2fs/ext2fs_ops.c
ra210bc7 r84226f0 76 76 static void ext2fs_read_file(ipc_callid_t, ipc_callid_t, aoff64_t, 77 77 size_t, ext2fs_instance_t *, ext2_inode_ref_t *); 78 static bool ext2fs_is_dots(const uint8_t *, size_t); 78 79 79 80 /* … … 337 338 int rc; 338 339 bool found = false; 340 size_t name_size; 339 341 340 342 fs = enode->instance->filesystem; … … 356 358 while (it.current != NULL) { 357 359 if (it.current->inode != 0) { 358 found = true; 359 break; 360 name_size = ext2_directory_entry_ll_get_name_length(fs->superblock, 361 it.current); 362 if (!ext2fs_is_dots(&it.current->name, name_size)) { 363 found = true; 364 break; 365 } 360 366 } 361 367 … … 625 631 } 626 632 633 /** 634 * Determine whether given directory entry name is . or .. 635 */ 636 bool ext2fs_is_dots(const uint8_t *name, size_t name_size) { 637 if (name_size == 1 && name[0] == '.') { 638 return true; 639 } 640 641 if (name_size == 2 && name[0] == '.' && name[1] == '.') { 642 return true; 643 } 644 645 return false; 646 } 647 627 648 void ext2fs_read_directory(ipc_callid_t rid, ipc_callid_t callid, aoff64_t pos, 628 649 size_t size, ext2fs_instance_t *inst, ext2_inode_ref_t *inode_ref) … … 657 678 658 679 // skip . and .. 659 if ((name_size == 1 || name_size == 2) && it.current->name == '.') { 660 if (name_size == 1) { 661 goto skip; 662 } 663 else if (name_size == 2 && *(&it.current->name+1) == '.') { 664 goto skip; 665 } 680 if (ext2fs_is_dots(&it.current->name, name_size)) { 681 goto skip; 666 682 } 667 683
Note:
See TracChangeset
for help on using the changeset viewer.