curl_path: make SFTP handle a path like /~ properly.

... without a trailing slash.

Fixes #17534
Closes #17542
This commit is contained in:
Carlos Henrique Lima Melara 2025-06-05 14:29:06 +02:00 committed by Daniel Stenberg
parent c314759c4c
commit 0ede81dcc6
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2

View File

@ -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)) {