$NetBSD: patch-ac,v 1.2 2004/09/08 14:30:00 markd Exp $ Rename setmode (and clearmode for consistency) to avoid clash with unistd.h. --- telnet/telnet/commands.c.orig 1998-12-11 11:50:48.000000000 +1300 +++ telnet/telnet/commands.c @@ -64,11 +64,12 @@ static char sccsid[] = "@(#)commands.c 8 #include #endif /* CRAY */ +#include /* vfork() */ #include #include #include #include -#include +#include #include #include @@ -110,7 +111,8 @@ extern int isprefix(); extern char **genget(); extern int Ambiguous(); -static call(); +typedef int (*intrtn_t) __P((int, char *[])); +static call(intrtn_t, ...); typedef struct { char *name; /* command name */ @@ -1156,13 +1158,13 @@ dolmmode(bit, on) } int -setmode(bit) +setlmode(bit) { return dolmmode(bit, 1); } int -clearmode(bit) +clearlmode(bit) { return dolmmode(bit, 0); } @@ -1188,18 +1190,18 @@ static struct modelist ModeList[] = { #endif { "", "", 0 }, { "", "These require the LINEMODE option to be enabled", 0 }, - { "isig", "Enable signal trapping", setmode, 1, MODE_TRAPSIG }, - { "+isig", 0, setmode, 1, MODE_TRAPSIG }, - { "-isig", "Disable signal trapping", clearmode, 1, MODE_TRAPSIG }, - { "edit", "Enable character editing", setmode, 1, MODE_EDIT }, - { "+edit", 0, setmode, 1, MODE_EDIT }, - { "-edit", "Disable character editing", clearmode, 1, MODE_EDIT }, - { "softtabs", "Enable tab expansion", setmode, 1, MODE_SOFT_TAB }, - { "+softtabs", 0, setmode, 1, MODE_SOFT_TAB }, - { "-softtabs", "Disable character editing", clearmode, 1, MODE_SOFT_TAB }, - { "litecho", "Enable literal character echo", setmode, 1, MODE_LIT_ECHO }, - { "+litecho", 0, setmode, 1, MODE_LIT_ECHO }, - { "-litecho", "Disable literal character echo", clearmode, 1, MODE_LIT_ECHO }, + { "isig", "Enable signal trapping", setlmode, 1, MODE_TRAPSIG }, + { "+isig", 0, setlmode, 1, MODE_TRAPSIG }, + { "-isig", "Disable signal trapping", clearlmode, 1, MODE_TRAPSIG }, + { "edit", "Enable character editing", setlmode, 1, MODE_EDIT }, + { "+edit", 0, setlmode, 1, MODE_EDIT }, + { "-edit", "Disable character editing", clearlmode, 1, MODE_EDIT }, + { "softtabs", "Enable tab expansion", setlmode, 1, MODE_SOFT_TAB }, + { "+softtabs", 0, setlmode, 1, MODE_SOFT_TAB }, + { "-softtabs", "Disable character editing", clearlmode, 1, MODE_SOFT_TAB }, + { "litecho", "Enable literal character echo", setlmode, 1, MODE_LIT_ECHO }, + { "+litecho", 0, setlmode, 1, MODE_LIT_ECHO }, + { "-litecho", "Disable literal character echo", clearlmode, 1, MODE_LIT_ECHO }, { "help", 0, modehelp, 0 }, #ifdef KLUDGELINEMODE { "kludgeline", 0, dokludgemode, 1 }, @@ -2607,19 +2609,14 @@ static Command cmdtab2[] = { * Call routine with argc, argv set from args (terminated by 0). */ - /*VARARGS1*/ - static -call(va_alist) - va_dcl +static int +call(intrtn_t routine, ...) { va_list ap; - typedef int (*intrtn_t)(); - intrtn_t routine; char *args[100]; int argno = 0; - va_start(ap); - routine = (va_arg(ap, intrtn_t)); + va_start(ap, routine); while ((args[argno++] = va_arg(ap, char *)) != 0) { ; }