Skip to content

Commit

Permalink
fix slashes by having every path have a slash internally
Browse files Browse the repository at this point in the history
  • Loading branch information
samansmink committed May 28, 2024
1 parent e82a9bb commit 2ecd77a
Showing 1 changed file with 9 additions and 1 deletion.
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

0 comments on commit 2ecd77a

Please sign in to comment.