From 4bb11e1af48e7690755bd8a688ef67c92fe49074 Mon Sep 17 00:00:00 2001 From: midipix Date: May 18 2025 14:14:22 +0000 Subject: helper interfaces: tpax_path_copy(): properly handle a single trailing slash. --- 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;