From 763b47bb470d8348b0aaa74133ac79daf06c760a Mon Sep 17 00:00:00 2001 From: Ryo Nakamura Date: Tue, 12 Aug 2025 14:54:28 +0900 Subject: [PATCH] if dst path has suffix '/', the dst path should be a directory This fixes https://github.com/upa/mscp/issues/24 --- src/mscp.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/mscp.c b/src/mscp.c index f242010..0a24b13 100644 --- a/src/mscp.c +++ b/src/mscp.c @@ -400,6 +400,9 @@ void *mscp_scan_thread(void *arg) if (pool_size(m->src_pool) > 1) a.dst_path_should_dir = true; + if (m->dst_path[strlen(m->dst_path) - 1] == '/') + a.dst_path_should_dir = true; + if (mscp_stat(m->dst_path, &ds, dst_sftp) == 0) { if (S_ISDIR(ds.st_mode)) a.dst_path_is_dir = true;