From cd74f3103976553b9405a4c458b37575b4b220bb Mon Sep 17 00:00:00 2001 From: bde Date: Fri, 19 Oct 2001 12:27:26 +0000 Subject: Fixed most style bugs in previous commit. --- usr.bin/tftp/main.c | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) (limited to 'usr.bin/tftp/main.c') diff --git a/usr.bin/tftp/main.c b/usr.bin/tftp/main.c index 4d7f5f2..eacb88a 100644 --- a/usr.bin/tftp/main.c +++ b/usr.bin/tftp/main.c @@ -62,6 +62,7 @@ static const char rcsid[] = #include #include +#include #include #include #include @@ -70,14 +71,11 @@ static const char rcsid[] = #include #include -#include - #include "extern.h" +#define MAXLINE 200 #define TIMEOUT 5 /* secs between rexmt's */ -#define MAXLINE 200 - struct sockaddr_in peeraddr; int f; short port; @@ -107,6 +105,7 @@ void setverbose __P((int, char **)); void status __P((int, char **)); static void command __P((void)) __dead2; +static const char *command_prompt __P((void)); static void getusage __P((char *)); static void makeargv __P((void)); @@ -593,7 +592,9 @@ tail(filename) } static const char * -command_prompt() { +command_prompt() +{ + return ("tftp> "); } @@ -603,17 +604,15 @@ command_prompt() { static void command() { + HistEvent he; register struct cmd *c; + static EditLine *el; + static History *hist; + const char *bp; char *cp; - static EditLine *el = NULL; - static History *hist = NULL; - HistEvent he; - const char * bp; - int len, num; - int verbose; + int len, num, verbose; verbose = isatty(0); - if (verbose) { el = el_init("tftp", stdin, stdout, stderr); hist = history_init(); @@ -624,12 +623,10 @@ command() el_set(el, EL_SIGNAL, 1); el_source(el, NULL); } - for (;;) { if (verbose) { if ((bp = el_gets(el, &num)) == NULL || num == 0) exit(0); - len = (num > MAXLINE) ? MAXLINE : num; memcpy(line, bp, len); line[len] = '\0'; -- cgit v1.1