From 51b91330486fd47c81f3212fea8a7b1068edb0bd Mon Sep 17 00:00:00 2001 From: Kevin Day Date: Sun, 16 Nov 2025 20:28:30 -0600 Subject: [PATCH] Update: Ensure the controller_path_canonical_relative() resets the destination used. 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 | 2 ++ sources/c/program/controller/main/path.h | 2 ++ 2 files changed, 4 insertions(+) diff --git a/sources/c/program/controller/main/path.c b/sources/c/program/controller/main/path.c index 50b1c52..c86ac48 100644 --- a/sources/c/program/controller/main/path.c +++ b/sources/c/program/controller/main/path.c @@ -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; diff --git a/sources/c/program/controller/main/path.h b/sources/c/program/controller/main/path.h index d8d2426..8381231 100644 --- a/sources/c/program/controller/main/path.h +++ b/sources/c/program/controller/main/path.h @@ -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 -- 1.8.3.1