diff options
author | msmith <msmith@FreeBSD.org> | 1997-06-25 08:56:46 +0000 |
---|---|---|
committer | msmith <msmith@FreeBSD.org> | 1997-06-25 08:56:46 +0000 |
commit | 89334bc82c5b7ad1189c9a5fd805f53e80ad65b1 (patch) | |
tree | da509a34c25bd98d42aa22dab0f6cd5363f3c6a8 /usr.bin/ftp/domacro.c | |
parent | 556be62658f72a2060b34dc2e2d5ec070e75dd41 (diff) | |
download | FreeBSD-src-89334bc82c5b7ad1189c9a5fd805f53e80ad65b1.zip FreeBSD-src-89334bc82c5b7ad1189c9a5fd805f53e80ad65b1.tar.gz |
Import substantial improvements to ftp(1) from NetBSD, largely the
work of Luke Mewburn.
This includes, but is not limited to :
- commandline editing and history.
- local and remote filename completion.
- a new progress display.
- the ability to access files using either the ftp or http protocols,
and use http proxies for ftp transfers.
The FreeeBSD "restricted ports" functionality was preserved.
Obtained from: NetBSD
Diffstat (limited to 'usr.bin/ftp/domacro.c')
-rw-r--r-- | usr.bin/ftp/domacro.c | 32 |
1 files changed, 19 insertions, 13 deletions
diff --git a/usr.bin/ftp/domacro.c b/usr.bin/ftp/domacro.c index 9644487..cb42f7e 100644 --- a/usr.bin/ftp/domacro.c +++ b/usr.bin/ftp/domacro.c @@ -1,3 +1,6 @@ +/* $Id$ */ +/* $NetBSD: domacro.c,v 1.9 1997/03/13 06:23:14 lukem Exp $ */ + /* * Copyright (c) 1985, 1993, 1994 * The Regents of the University of California. All rights reserved. @@ -32,13 +35,17 @@ */ #ifndef lint +#if 0 static char sccsid[] = "@(#)domacro.c 8.3 (Berkeley) 4/2/94"; +#else +static char rcsid[] = "$Id$"; +#endif #endif /* not lint */ #include <ctype.h> #include <signal.h> #include <stdio.h> -#include <strings.h> +#include <string.h> #include "ftp_var.h" @@ -52,7 +59,7 @@ domacro(argc, argv) struct cmd *c; if (argc < 2 && !another(&argc, &argv, "macro name")) { - printf("Usage: %s macro_name.\n", argv[0]); + printf("usage: %s macro_name\n", argv[0]); code = -1; return; } @@ -66,7 +73,7 @@ domacro(argc, argv) code = -1; return; } - (void) strcpy(line2, line); + (void)strcpy(line2, line); TOP: cp1 = macros[i].mac_start; while (cp1 != macros[i].mac_end) { @@ -87,7 +94,7 @@ TOP: } cp1--; if (argc - 2 >= j) { - (void) strcpy(cp2, argv[j+1]); + (void)strcpy(cp2, argv[j+1]); cp2 += strlen(argv[j+1]); } break; @@ -96,7 +103,7 @@ TOP: loopflg = 1; cp1++; if (count < argc) { - (void) strcpy(cp2, argv[count]); + (void)strcpy(cp2, argv[count]); cp2 += strlen(argv[count]); } break; @@ -114,26 +121,25 @@ TOP: makeargv(); c = getcmd(margv[0]); if (c == (struct cmd *)-1) { - printf("?Ambiguous command\n"); + puts("?Ambiguous command."); code = -1; } else if (c == 0) { - printf("?Invalid command\n"); + puts("?Invalid command."); code = -1; } else if (c->c_conn && !connected) { - printf("Not connected.\n"); + puts("Not connected."); code = -1; } else { - if (verbose) { - printf("%s\n",line); - } + if (verbose) + puts(line); (*c->c_handler)(margc, margv); if (bell && c->c_bell) { - (void) putchar('\007'); + (void)putchar('\007'); } - (void) strcpy(line, line2); + (void)strcpy(line, line2); makeargv(); argc = margc; argv = margv; |