]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
curl_path: make SFTP handle a path like /~ properly.
authorCarlos Henrique Lima Melara <charlesmelara@riseup.net>
Thu, 5 Jun 2025 12:29:06 +0000 (14:29 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Mon, 9 Jun 2025 09:23:16 +0000 (11:23 +0200)
... without a trailing slash.

Fixes #17534
Closes #17542

lib/vssh/curl_path.c

index 117d2e6009f622a3e2d6b8714c42c1b953d86bfb..474a5ecb8e276160c7846f5bf894cdf5655dd8d1 100644 (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)) {