=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/ftp/ftp.c,v retrieving revision 1.21 retrieving revision 1.22 diff -c -r1.21 -r1.22 *** src/usr.bin/ftp/ftp.c 1997/08/06 17:35:41 1.21 --- src/usr.bin/ftp/ftp.c 1997/09/04 04:37:16 1.22 *************** *** 1,5 **** ! /* $OpenBSD: ftp.c,v 1.21 1997/08/06 17:35:41 mickey Exp $ */ ! /* $NetBSD: ftp.c,v 1.26 1997/07/20 09:45:53 lukem Exp $ */ /* * Copyright (c) 1985, 1989, 1993, 1994 --- 1,5 ---- ! /* $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 $ */ /* * Copyright (c) 1985, 1989, 1993, 1994 *************** *** 38,44 **** #if 0 static char sccsid[] = "@(#)ftp.c 8.6 (Berkeley) 10/27/94"; #else ! static char rcsid[] = "$OpenBSD: ftp.c,v 1.21 1997/08/06 17:35:41 mickey 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.22 1997/09/04 04:37:16 millert Exp $"; #endif #endif /* not lint */ *************** *** 713,721 **** } void ! recvrequest(cmd, local, remote, lmode, printnames) const char *cmd, *local, *remote, *lmode; ! int printnames; { FILE *fout, *din; int (*closefunc) __P((FILE *)); --- 713,721 ---- } void ! recvrequest(cmd, local, remote, lmode, printnames, ignorespecial) const char *cmd, *local, *remote, *lmode; ! int printnames, ignorespecial; { FILE *fout, *din; int (*closefunc) __P((FILE *)); *************** *** 752,758 **** opreserve = preserve; is_retr = strcmp(cmd, "RETR") == 0; if (is_retr && verbose && printnames) { ! if (local && *local != '-') fprintf(ttyout, "local: %s ", local); if (remote) fprintf(ttyout, "remote: %s\n", remote); --- 752,758 ---- opreserve = preserve; is_retr = strcmp(cmd, "RETR") == 0; if (is_retr && verbose && printnames) { ! if (local && (ignorespecial || *local != '-')) fprintf(ttyout, "local: %s ", local); if (remote) fprintf(ttyout, "remote: %s\n", remote); *************** *** 784,791 **** } oldintr = signal(SIGINT, abortrecv); oldinti = signal(SIGINFO, psummary); ! if (strcmp(local, "-") && *local != '|') { ! if (access(local, 2) < 0) { char *dir = strrchr(local, '/'); if (errno != ENOENT && errno != EACCES) { --- 784,791 ---- } oldintr = signal(SIGINT, abortrecv); oldinti = signal(SIGINFO, psummary); ! if (ignorespecial || (strcmp(local, "-") && *local != '|')) { ! if (access(local, W_OK) < 0) { char *dir = strrchr(local, '/'); if (errno != ENOENT && errno != EACCES) { *************** *** 797,803 **** } if (dir != NULL) *dir = 0; ! d = access(dir == local ? "/" : dir ? local : ".", 2); if (dir != NULL) *dir = '/'; if (d < 0) { --- 797,803 ---- } if (dir != NULL) *dir = 0; ! d = access(dir == local ? "/" : dir ? local : ".", W_OK); if (dir != NULL) *dir = '/'; if (d < 0) { *************** *** 865,875 **** din = dataconn("r"); if (din == NULL) goto abort; ! if (strcmp(local, "-") == 0) { fout = stdout; progress = 0; preserve = 0; ! } else if (*local == '|') { oldintp = signal(SIGPIPE, SIG_IGN); fout = popen(local + 1, "w"); if (fout == NULL) { --- 865,875 ---- din = dataconn("r"); if (din == NULL) goto abort; ! if (!ignorespecial && strcmp(local, "-") == 0) { fout = stdout; progress = 0; preserve = 0; ! } else if (!ignorespecial && *local == '|') { oldintp = signal(SIGPIPE, SIG_IGN); fout = popen(local + 1, "w"); if (fout == NULL) { *************** *** 1002,1010 **** } break2: if (bare_lfs) { ! printf( "WARNING! %d bare linefeeds received in ASCII mode.\n", bare_lfs); ! fputs("File may not have transferred correctly.\n", ttyout); } if (hash && (!progress || filesize < 0)) { if (bytes < hashbytes) --- 1002,1011 ---- } break2: if (bare_lfs) { ! fprintf(ttyout, "WARNING! %d bare linefeeds received in ASCII mode.\n", bare_lfs); ! fputs("File may not have transferred correctly.\n", ! ttyout); } if (hash && (!progress || filesize < 0)) { if (bytes < hashbytes) *************** *** 1043,1049 **** ut.actime = time(NULL); ut.modtime = mtime; if (utime(local, &ut) == -1) ! printf( "Can't change modification time on %s to %s", local, asctime(localtime(&mtime))); } --- 1044,1050 ---- ut.actime = time(NULL); ut.modtime = mtime; if (utime(local, &ut) == -1) ! fprintf(ttyout, "Can't change modification time on %s to %s", local, asctime(localtime(&mtime))); } *************** *** 1528,1534 **** if (cp) *cp = '\0'; ! d = access(cp == local ? "/" : cp ? local : ".", 2); if (cp) *cp = '/'; if (d < 0) { --- 1529,1535 ---- if (cp) *cp = '\0'; ! d = access(cp == local ? "/" : cp ? local : ".", W_OK); if (cp) *cp = '/'; if (d < 0) { *************** *** 1549,1555 **** ext = '0'; else ext++; ! if ((d = access(new, 0)) < 0) break; if (ext != '0') cp--; --- 1550,1556 ---- ext = '0'; else ext++; ! if ((d = access(new, F_OK)) < 0) break; if (ext != '0') cp--;