File curl-7.11.0-dirs.patch of Package compat-libcurl2
--- lib/ftp.c 2004-01-21 17:50:05.000000000 +0100
+++ lib/ftp.c 2004-02-25 19:18:22.000000000 +0100
@@ -2287,16 +2287,13 @@
/* parse the URL path into separate path components */
while((slash_pos=strchr(cur_pos, '/'))) {
- /* 1 or 0 to indicate absolute directory */
- bool absolute_dir = (cur_pos - conn->ppath > 0) && (path_part == 0);
-
/* seek out the next path component */
if (slash_pos-cur_pos) {
/* we skip empty path components, like "x//y" since the FTP command CWD
requires a parameter and a non-existant parameter a) doesn't work on
many servers and b) has no effect on the others. */
- ftp->dirs[path_part] = curl_unescape(cur_pos - absolute_dir,
- slash_pos - cur_pos + absolute_dir);
+ ftp->dirs[path_part] = curl_unescape(cur_pos,
+ slash_pos - cur_pos);
if (!ftp->dirs[path_part]) { /* run out of memory ... */
failf(data, "no memory");
@@ -2321,6 +2318,8 @@
}
}
+ ftp->dirs[path_part] = NULL;
+
ftp->file = cur_pos; /* the rest is the file name */
if(*ftp->file) {