1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-10-24 21:01:20 +00:00
freebsd-ports/ftp/cftp/files/patch-ftp.c
Christian Weisgerber 4ef1beeed0 * Handle unexpected "125" reply as seen e.g. from ftp.compaq.com.
Obtained from:	Dieter Baron <dillo@giga.or.at>

* Remove unnecessary gnugetopt dependency.
* Remove useless documentation.

Approved by:	knu (portmgr)
2002-09-28 17:57:00 +00:00

42 lines
876 B
C

$FreeBSD$
--- ftp.c.orig Tue Sep 17 16:58:18 2002
+++ ftp.c Sat Sep 28 15:49:05 2002
@@ -311,7 +311,7 @@
rftp_list(char *path)
{
directory *dir;
- int fd;
+ int fd, resp;
FILE *f;
if (ftp_mode('a') == -1 || ftp_cwd(path) == -1)
@@ -321,7 +321,7 @@
return NULL;
ftp_put("list");
- if (ftp_resp() != 150) {
+ if ((resp=ftp_resp()) != 150 && resp != 125) {
close(fd);
dir = (directory *)malloc(sizeof(directory));
dir->line = (direntry *)malloc(sizeof(direntry));
@@ -379,7 +379,7 @@
void *
rftp_retr(char *file, int mode, long *startp, long *sizep)
{
- int fd;
+ int fd, resp;
char *dir, *name, *can, *p;
FILE *fin;
@@ -400,7 +400,7 @@
}
ftp_put("retr %s", name);
- if (ftp_resp() != 150) {
+ if ((resp=ftp_resp()) != 150 && resp != 125) {
close(fd);
return NULL;
}