mirror of
https://github.com/wiiu-env/libromfs_wiiu.git
synced 2024-11-08 19:55:07 +01:00
Properly fill in stat struct in dirnext implementation
This commit is contained in:
parent
6be62dee19
commit
bb8470625e
@ -885,9 +885,7 @@ int romfs_dirnext(struct _reent *r, DIR_ITER *dirState, char *filename, struct s
|
|||||||
|
|
||||||
if (iter->state == 0) {
|
if (iter->state == 0) {
|
||||||
/* '.' entry */
|
/* '.' entry */
|
||||||
memset(filestat, 0, sizeof(*filestat));
|
fillDir(filestat, iter->mount, iter->dir);
|
||||||
filestat->st_ino = dir_inode(iter->mount, iter->dir);
|
|
||||||
filestat->st_mode = romFS_dir_mode;
|
|
||||||
|
|
||||||
strcpy(filename, ".");
|
strcpy(filename, ".");
|
||||||
iter->state = 1;
|
iter->state = 1;
|
||||||
@ -902,9 +900,7 @@ int romfs_dirnext(struct _reent *r, DIR_ITER *dirState, char *filename, struct s
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
memset(filestat, 0, sizeof(*filestat));
|
fillDir(filestat, iter->mount, dir);
|
||||||
filestat->st_ino = dir_inode(iter->mount, dir);
|
|
||||||
filestat->st_mode = romFS_dir_mode;
|
|
||||||
|
|
||||||
strcpy(filename, "..");
|
strcpy(filename, "..");
|
||||||
iter->state = 2;
|
iter->state = 2;
|
||||||
@ -922,9 +918,7 @@ int romfs_dirnext(struct _reent *r, DIR_ITER *dirState, char *filename, struct s
|
|||||||
|
|
||||||
iter->childDir = dir->sibling;
|
iter->childDir = dir->sibling;
|
||||||
|
|
||||||
memset(filestat, 0, sizeof(*filestat));
|
fillDir(filestat, iter->mount, dir);
|
||||||
filestat->st_ino = dir_inode(iter->mount, dir);
|
|
||||||
filestat->st_mode = romFS_dir_mode;
|
|
||||||
|
|
||||||
memset(filename, 0, NAME_MAX);
|
memset(filename, 0, NAME_MAX);
|
||||||
|
|
||||||
@ -948,9 +942,7 @@ int romfs_dirnext(struct _reent *r, DIR_ITER *dirState, char *filename, struct s
|
|||||||
|
|
||||||
iter->childFile = file->sibling;
|
iter->childFile = file->sibling;
|
||||||
|
|
||||||
memset(filestat, 0, sizeof(*filestat));
|
fillFile(filestat, iter->mount, file);
|
||||||
filestat->st_ino = file_inode(iter->mount, file);
|
|
||||||
filestat->st_mode = romFS_file_mode;
|
|
||||||
|
|
||||||
memset(filename, 0, NAME_MAX);
|
memset(filename, 0, NAME_MAX);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user