=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/ftp/ftp.c,v retrieving revision 1.22 retrieving revision 1.23 diff -c -r1.22 -r1.23 *** src/usr.bin/ftp/ftp.c 1997/09/04 04:37:16 1.22 --- src/usr.bin/ftp/ftp.c 1997/09/05 00:02:29 1.23 *************** *** 1,4 **** ! /* $OpenBSD: ftp.c,v 1.22 1997/09/04 04:37:16 millert Exp $ */ /* $NetBSD: ftp.c,v 1.27 1997/08/18 10:20:23 lukem Exp $ */ /* --- 1,4 ---- ! /* $OpenBSD: ftp.c,v 1.23 1997/09/05 00:02:29 millert Exp $ */ /* $NetBSD: ftp.c,v 1.27 1997/08/18 10:20:23 lukem Exp $ */ /* *************** *** 38,44 **** #if 0 static char sccsid[] = "@(#)ftp.c 8.6 (Berkeley) 10/27/94"; #else ! static char rcsid[] = "$OpenBSD: ftp.c,v 1.22 1997/09/04 04:37:16 millert Exp $"; #endif #endif /* not lint */ --- 38,44 ---- #if 0 static char sccsid[] = "@(#)ftp.c 8.6 (Berkeley) 10/27/94"; #else ! static char rcsid[] = "$OpenBSD: ftp.c,v 1.23 1997/09/05 00:02:29 millert Exp $"; #endif #endif /* not lint */ *************** *** 283,300 **** for (line = 0 ;; line++) { dig = n = code = 0; cp = current_line; ! while ((c = getc(cin)) != '\n') { if (c == IAC) { /* handle telnet commands */ ! switch (c = getc(cin)) { case WILL: case WONT: ! c = getc(cin); fprintf(cout, "%c%c%c", IAC, DONT, c); (void)fflush(cout); break; case DO: case DONT: ! c = getc(cin); fprintf(cout, "%c%c%c", IAC, WONT, c); (void)fflush(cout); break; --- 283,300 ---- for (line = 0 ;; line++) { dig = n = code = 0; cp = current_line; ! while ((c = fgetc(cin)) != '\n') { if (c == IAC) { /* handle telnet commands */ ! switch (c = fgetc(cin)) { case WILL: case WONT: ! c = fgetc(cin); fprintf(cout, "%c%c%c", IAC, DONT, c); (void)fflush(cout); break; case DO: case DONT: ! c = fgetc(cin); fprintf(cout, "%c%c%c", IAC, WONT, c); (void)fflush(cout); break; *************** *** 623,629 **** break; case TYPE_A: ! while ((c = getc(fin)) != EOF) { if (c == '\n') { while (hash && (!progress || filesize < 0) && (bytes >= hashbytes)) { --- 623,629 ---- break; case TYPE_A: ! while ((c = fgetc(fin)) != EOF) { if (c == '\n') { while (hash && (!progress || filesize < 0) && (bytes >= hashbytes)) { *************** *** 958,964 **** goto done; n = restart_point; for (i = 0; i++ < n;) { ! if ((ch = getc(fout)) == EOF) goto done; if (ch == '\n') i++; --- 958,964 ---- goto done; n = restart_point; for (i = 0; i++ < n;) { ! if ((ch = fgetc(fout)) == EOF) goto done; if (ch == '\n') i++; *************** *** 973,979 **** return; } } ! while ((c = getc(din)) != EOF) { if (c == '\n') bare_lfs++; while (c == '\r') { --- 973,979 ---- return; } } ! while ((c = fgetc(din)) != EOF) { if (c == '\n') bare_lfs++; while (c == '\r') { *************** *** 984,990 **** hashbytes += mark; } bytes++; ! if ((c = getc(din)) != '\n' || tcrflag) { if (ferror(fout)) goto break2; (void)putc('\r', fout); --- 984,990 ---- hashbytes += mark; } bytes++; ! if ((c = fgetc(din)) != '\n' || tcrflag) { if (ferror(fout)) goto break2; (void)putc('\r', fout);