File: curl_path_make_SFTP_handle_a_path.patch

package info (click to toggle)
curl 8.14.1-2%2Bdeb13u2
  • links: PTS, VCS
  • area: main
  • in suites: trixie, trixie-proposed-updates
  • size: 32,980 kB
  • sloc: ansic: 205,388; perl: 20,194; python: 8,958; sh: 6,776; makefile: 1,617; pascal: 797; cpp: 173
file content (30 lines) | stat: -rw-r--r-- 817 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
From 0ede81dcc61844cecce8904fb4de24319afeb024 Mon Sep 17 00:00:00 2001
From: Carlos Henrique Lima Melara <charlesmelara@riseup.net>
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 117d2e6009f6..474a5ecb8e27 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)) {