From: deraadt Date: Sat, 25 Jan 1997 21:42:27 +0000 (+0000) Subject: split cd() into two pieces, whoever was here last did a bad job X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=f96148166c016ab1ac808167ca317ddf00814d84;p=openbsd split cd() into two pieces, whoever was here last did a bad job --- diff --git a/usr.bin/ftp/cmds.c b/usr.bin/ftp/cmds.c index 4719ed4e612..1f14aff0b29 100644 --- a/usr.bin/ftp/cmds.c +++ b/usr.bin/ftp/cmds.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmds.c,v 1.9 1996/12/24 21:22:10 deraadt Exp $ */ +/* $OpenBSD: cmds.c,v 1.10 1997/01/25 21:42:27 deraadt Exp $ */ /* $NetBSD: cmds.c,v 1.8 1995/09/08 01:06:05 tls Exp $ */ /* @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)cmds.c 8.6 (Berkeley) 10/9/94"; #else -static char rcsid[] = "$OpenBSD: cmds.c,v 1.9 1996/12/24 21:22:10 deraadt Exp $"; +static char rcsid[] = "$OpenBSD: cmds.c,v 1.10 1997/01/25 21:42:27 deraadt Exp $"; #endif #endif /* not lint */ @@ -1075,7 +1075,7 @@ setdebug(argc, argv) * on remote machine. */ int -cd(argc, argv) +mcd(argc, argv) int argc; char *argv[]; { @@ -1083,7 +1083,7 @@ cd(argc, argv) if (argc < 2 && !another(&argc, &argv, "remote-directory")) { printf("usage: %s remote-directory\n", argv[0]); code = -1; - return; + return (-1); } if (command("CWD %s", argv[1]) == ERROR) { if (code == 500) { @@ -1098,6 +1098,14 @@ cd(argc, argv) return(0); } +void +cd(argc, argv) + int argc; + char *argv[]; +{ + mcd(argc, argv); +} + /* * Set current working directory * on local machine. diff --git a/usr.bin/ftp/extern.h b/usr.bin/ftp/extern.h index 5510736df21..5f369bccbd0 100644 --- a/usr.bin/ftp/extern.h +++ b/usr.bin/ftp/extern.h @@ -1,4 +1,4 @@ -/* $OpenBSD: extern.h,v 1.4 1996/12/17 02:11:46 michaels Exp $ */ +/* $OpenBSD: extern.h,v 1.5 1997/01/25 21:42:30 deraadt Exp $ */ /* $NetBSD: extern.h,v 1.4 1995/09/08 01:06:19 tls Exp $ */ /*- @@ -46,7 +46,8 @@ void abortsend __P(()); void account __P((int, char **)); int another __P((int *, char ***, char *)); void blkfree __P((char **)); -int cd __P((int, char **)); +void cd __P((int, char **)); +int mcd __P((int, char **)); void cdup __P((int, char **)); void changetype __P((int, int)); void cmdabort __P(()); diff --git a/usr.bin/ftp/main.c b/usr.bin/ftp/main.c index ef205df31f4..44cd8e43611 100644 --- a/usr.bin/ftp/main.c +++ b/usr.bin/ftp/main.c @@ -1,4 +1,4 @@ -/* $OpenBSD: main.c,v 1.14 1997/01/15 23:42:31 millert Exp $ */ +/* $OpenBSD: main.c,v 1.15 1997/01/25 21:42:33 deraadt Exp $ */ /* * Copyright (c) 1985, 1989, 1993, 1994 @@ -43,7 +43,7 @@ static char copyright[] = #if 0 static char sccsid[] = "@(#)main.c 8.6 (Berkeley) 10/9/94"; #else -static char rcsid[] = "$OpenBSD: main.c,v 1.14 1997/01/15 23:42:31 millert Exp $"; +static char rcsid[] = "$OpenBSD: main.c,v 1.15 1997/01/25 21:42:33 deraadt Exp $"; #endif #endif /* not lint */ @@ -237,7 +237,7 @@ main(argc, argv) xargc = 2; tmp = verbose; verbose = -1; - if (cd(xargc, xargv) == 0) { + if (mcd(xargc, xargv) == 0) { verbose = tmp; goto CLINE_CD; }