ext: Fix next_cwd_len calculation

This commit is contained in:
mintsuki 2022-08-21 07:15:48 +02:00
parent 45f65b6b40
commit a17edef7bc

View File

@ -385,19 +385,18 @@ static bool ext2_parse_dirent(struct ext2_dir_entry *dir, struct ext2_file_handl
const char *cwd = path - 1; // because /
size_t cwd_len = 1;
size_t next_cwd_len = cwd_len;
next:
memset(token, 0, 256);
size_t next_cwd_len = cwd_len;
for (size_t i = 0; i < 255 && *path != '/' && *path != '\0'; i++, path++, next_cwd_len++)
token[i] = *path;
if (*path == '\0')
escape = true;
else
path++;
path++, next_cwd_len++;
uint32_t *alloc_map = create_alloc_map(fd, &current_inode);