From 4bb11e1af48e7690755bd8a688ef67c92fe49074 Mon Sep 17 00:00:00 2001 From: midipix Date: Sun, 18 May 2025 14:10:06 +0000 Subject: helper interfaces: tpax_path_copy(): properly handle a single trailing slash. --- src/util/tpax_path_copy.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/util/tpax_path_copy.c b/src/util/tpax_path_copy.c index 046ddde..df0e0c0 100644 --- a/src/util/tpax_path_copy.c +++ b/src/util/tpax_path_copy.c @@ -77,6 +77,10 @@ int tpax_util_path_copy( } } + if (dst > dstpath) + if (dst[-1] == '/') + dst--; + if (nwritten) *nwritten = dst - dstpath; -- cgit v1.2.3