summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2025-05-18 14:10:06 +0000
committermidipix <writeonce@midipix.org>2025-05-18 14:14:22 +0000
commit4bb11e1af48e7690755bd8a688ef67c92fe49074 (patch)
treec7a738820dc689f1fd18dbf53cada5a7f8e5e725
parent563f2b7a806f3940720dea4c68a68faa40951f36 (diff)
downloadtpax-4bb11e1af48e7690755bd8a688ef67c92fe49074.tar.bz2
tpax-4bb11e1af48e7690755bd8a688ef67c92fe49074.tar.xz
helper interfaces: tpax_path_copy(): properly handle a single trailing slash.
-rw-r--r--src/util/tpax_path_copy.c4
1 files changed, 4 insertions, 0 deletions
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;