packages: add ftplib
[openwrt/svn-archive/archive.git] / libs / ftplib / patches / 001-fix_ascii_read_without_eol.patch
1 Description: Fix reading FTP data is ASCII mode
2 In ASCII mode, if you don't have a line in the next block that you're
3 trying to read, then ftplib would set the first character to '\0'.
4 .
5 Upstream probably intented to return an empty string when requesting
6 to read only 1 character since that doesn't make much sense when the
7 EOL delimiter is 2 characters already (\r\n). However, due to the
8 way data is read, max can be set to 1 just after having read max-1
9 legitimate bytes and we should not be overwriting the first byte.
10 .
11 Patch is not submitted upstream since upstream is not actively
12 maintaining it.
13 Origin: vendor, see Author
14 Author: Raphaƫl Hertzog <hertzog@debian.org>
15 Last-Update: 2009-11-24
16
17 ---
18 The information above should follow the Patch Tagging Guidelines, please
19 checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here
20 are templates for supplementary fields that you might want to add:
21
22 Origin: <vendor|upstream|other>, <url of original patch>
23 Bug: <url in upstream bugtracker>
24 Bug-Debian: http://bugs.debian.org/<bugnumber>
25 Forwarded: <no|not-needed|url proving that it has been forwarded>
26 Reviewed-By: <name and email of someone who approved the patch>
27 Last-Update: <YYYY-MM-DD>
28
29 --- a/src/ftplib.c
30 +++ b/src/ftplib.c
31 @@ -220,7 +220,6 @@ static int readline(char *buf,int max,ne
32 }
33 if (max == 1)
34 {
35 - *buf = '\0';
36 break;
37 }
38 if (ctl->cput == ctl->cget)