Skip to content
This repository has been archived by the owner on Sep 21, 2021. It is now read-only.

Fix duplicate '/' in fspfs_lookup & fspfs_create_directory #159

Open
wants to merge 1 commit into
base: development
Choose a base branch
from

Conversation

marysaka
Copy link
Contributor

In 1.0.0, FS path normalization doesn't remove extraneous slash and this
lead to a 0x202 error code.

This fix misson20000/twili#73

In 1.0.0, FS path normalization doesn't remove extraneous slash and this
lead to a 0x202 error code.
Copy link
Member

@misson20000 misson20000 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like fspfs_create_file needs to be fixed too, right? Perhaps this would be better off being split into a static path_concat function, but I also wonder why this is necessary in the first place- where are these extraneous slashes coming from and is there a better place to sanitize them?


int extra_slash = 0;
if (base_path_len == 0 || new_inode->path[base_path_len - 1] != '/') {
new_inode->path[base_path_len] = '/';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

base_path_len++ and remove extra_slash variable?

if (base_path_len == 0 || full_path[base_path_len - 1] != '/') {
full_path[base_path_len] = '/';
extra_slash = 1;
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same thing here

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1.0.0 -- Failure to create a default settings file
2 participants