From 2ecd77a5d3e3ecd9c138384d2428cc6edd546cf5 Mon Sep 17 00:00:00 2001 From: Sam Ansmink Date: Tue, 28 May 2024 16:44:33 +0200 Subject: [PATCH] fix slashes by having every path have a slash internally --- src/functions/delta_scan.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/functions/delta_scan.cpp b/src/functions/delta_scan.cpp index 2febd95..dfe5a62 100644 --- a/src/functions/delta_scan.cpp +++ b/src/functions/delta_scan.cpp @@ -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()); @@ -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; }