]> Kevux Git Server - controller/commitdiff
Update: Ensure the controller_path_canonical_relative() resets the destination used.
authorKevin Day <Kevin@kevux.org>
Mon, 17 Nov 2025 02:28:30 +0000 (20:28 -0600)
committerKevin Day <Kevin@kevux.org>
Mon, 17 Nov 2025 02:28:30 +0000 (20:28 -0600)
The canonical function does not guarantee the destination used value to be set to 0.
Ensue that this value is set, if possible.

Update the documentation comment to communicate that the destination is not appended to and is instead replaced by.

sources/c/program/controller/main/path.c
sources/c/program/controller/main/path.h

index 50b1c52f7600b84e7dff73e992429a1204ff9fde..c86ac489e6a1e40bb184611b1a5b7aeca702aa33 100644 (file)
@@ -9,6 +9,8 @@ extern "C" {
 
     if (!main || !destination) return F_status_set_error(F_parameter);
 
+    destination->used = 0;
+
     {
       const f_status_t status = fl_path_canonical(source, destination);
       if (F_status_is_error(status)) return status;
index d8d2426ce4995e6810a7c0f439b9dd3080cfe036..83812311c6d224a7282ebd9b377bfa3268a2e746 100644 (file)
@@ -40,6 +40,8 @@ extern "C" {
  *   The resulting relative canonical path.
  *   The destination will be completely replaced on success.
  *
+ *   Any existing values will be replaced.
+ *
  *   Must not be NULL.
  *
  * @return