Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Path issues related to trailing slashes #20

Merged
merged 1 commit into from
May 28, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion src/functions/delta_scan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ static void* allocate_string(const struct ffi::KernelStringSlice slice) {

static void visit_callback(ffi::NullableCvoid engine_context, struct ffi::KernelStringSlice path, int64_t size, const ffi::DvInfo *dv_info, const struct ffi::CStringMap *partition_values) {
auto context = (DeltaSnapshot *) engine_context;
auto path_string = context->GetPath() + "/" + from_delta_string_slice(path);
auto path_string = context->GetPath();
StringUtil::RTrim(path_string, "/");
path_string += "/" + from_delta_string_slice(path);

// printf("Fetch metadata for %s\n", path_string.c_str());

Expand Down Expand Up @@ -152,6 +154,12 @@ string DeltaSnapshot::ToDeltaPath(const string &raw_path) {
} else {
path = raw_path;
}

// Paths always end in a slash (kernel likes it that way for now)
if (path[path.size()-1] != '/') {
path = path + '/';
}

return path;
}

Expand Down
Loading