Line 0
Link Here
|
|
|
1 |
Patch for Squid bug #1857, obtained from Squid bugzilla 2007-01-15. |
2 |
|
3 |
--- src/ftp.c.orig Sun Feb 26 00:34:13 2006 |
4 |
+++ src/ftp.c Mon Jan 15 19:46:29 2007 |
5 |
@@ -441,7 +441,7 @@ |
6 |
ftpState->flags.dir_slash ? rfc1738_escape_part(ftpState->old_filepath) : "."); |
7 |
} else if (ftpState->typecode == 'D') { |
8 |
const char *path = ftpState->flags.dir_slash ? ftpState->filepath : "."; |
9 |
- storeAppendPrintf(e, "<A HREF=\"%s/\">[As extended directory]</A>\n", html_quote(path)); |
10 |
+ storeAppendPrintf(e, "<A HREF=\"%s/\">[As extended directory]</A>\n", rfc1738_escape_part(path)); |
11 |
} |
12 |
storeAppendPrintf(e, "<HR noshade size=\"1px\">\n"); |
13 |
storeAppendPrintf(e, "<ADDRESS>\n"); |
14 |
@@ -689,8 +689,8 @@ |
15 |
snprintf(html, 8192, "%s\n", line); |
16 |
return html; |
17 |
} |
18 |
- if (ftpState->flags.dir_slash) |
19 |
- snprintf(prefix, sizeof(prefix), "%s/", rfc1738_escape_part(ftpState->dirpath)); |
20 |
+ if (ftpState->flags.dir_slash && ftpState->dirpath && ftpState->typecode != 'D' ) |
21 |
+ snprintf(prefix, 2048, "%s/", rfc1738_escape_part(ftpState->dirpath)); |
22 |
else |
23 |
prefix[0] = '\0'; |
24 |
/* Handle builtin <dirup> */ |