aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDanielGavin <danielgavin5@hotmail.com>2024-04-13 12:43:03 +0200
committerDanielGavin <danielgavin5@hotmail.com>2024-04-13 12:43:03 +0200
commitaa1aabda1cce68a6038c48429cc759f09ad2ebab (patch)
treea66e665d0506e4362c6655956f6ace2424f0fc70 /src
parenteb6871910c9a19106a3e19f03c852942f2e096dc (diff)
Final path of collection was using temp_allocator instead of allocator
Diffstat (limited to 'src')
-rw-r--r--src/server/requests.odin24
1 files changed, 16 insertions, 8 deletions
diff --git a/src/server/requests.odin b/src/server/requests.odin
index 891f5f9..a616d5c 100644
--- a/src/server/requests.odin
+++ b/src/server/requests.odin
@@ -531,20 +531,28 @@ read_ols_initialize_options :: proc(
context.temp_allocator,
)
}
-
- final_path = strings.clone(final_path)
} else {
if filepath.is_abs(it.path) {
- final_path = strings.clone(forward_path)
+ final_path = forward_path
} else {
- final_path = path.join(elems = {uri.path, forward_path})
+ final_path = path.join(
+ elems = {uri.path, forward_path},
+ allocator = context.temp_allocator,
+ )
}
}
- ok: bool
- final_path, ok = filepath.abs(final_path, context.temp_allocator)
- if !ok do return
- config.collections[strings.clone(it.name)] = final_path
+ absolute_path, ok := filepath.abs(final_path, context.allocator)
+
+ if !ok {
+ log.errorf(
+ "Failed to find absolute adresss of collection: %v",
+ final_path,
+ )
+ return
+ }
+
+ config.collections[strings.clone(it.name)] = absolute_path
}
// ensure that core/vendor collections are provided