From 0ede81dcc61844cecce8904fb4de24319afeb024 Mon Sep 17 00:00:00 2001 From: Carlos Henrique Lima Melara Date: Thu, 5 Jun 2025 14:29:06 +0200 Subject: [PATCH] curl_path: make SFTP handle a path like /~ properly. ... without a trailing slash. Fixes #17534 Closes #17542 --- lib/vssh/curl_path.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/vssh/curl_path.c b/lib/vssh/curl_path.c index 117d2e6009..474a5ecb8e 100644 --- a/lib/vssh/curl_path.c +++ b/lib/vssh/curl_path.c @@ -84,6 +84,12 @@ CURLcode Curl_getworkingpath(struct Curl_easy *data, return CURLE_OUT_OF_MEMORY; } } + else { + if(curlx_dyn_add(&npath, "/")) { + free(working_path); + return CURLE_OUT_OF_MEMORY; + } + } } if(curlx_dyn_len(&npath)) { -- 2.47.3