--- libaitcli/src/aitcli.c 2010/04/18 20:42:23 1.1.1.1.2.1 +++ libaitcli/src/aitcli.c 2010/04/19 09:30:49 1.1.1.1.2.2 @@ -3,7 +3,7 @@ * by Michael Pounov * * $Author: misho $ -* $Id: aitcli.c,v 1.1.1.1.2.1 2010/04/18 20:42:23 misho Exp $ +* $Id: aitcli.c,v 1.1.1.1.2.2 2010/04/19 09:30:49 misho Exp $ * *************************************************************************/ #include "global.h" @@ -103,16 +103,16 @@ inline void cliTTY(FILE *inp, FILE *out) /* * cliExec() Execute CLI main loop * @cmdList = Commands list - * @out = Output handle * @csPrompt = Prompt text * return: -1 error, 0 = exit w/^+D, 1 done. */ -int cliExec(cliCommands_t *cmdList, FILE *out, const char *csPrompt) +int cliExec(cliCommands_t *cmdList, const char *csPrompt) { char *line, *s, *t, **app, *items[MAX_PROMPT_ITEMS]; int ret = 0; register int i; cliCommands_t *cmd = NULL; + FILE *out; inline int inline_help() { @@ -157,6 +157,10 @@ int cliExec(cliCommands_t *cmdList, FILE *out, const c } /* --- main body of CLI --- */ + + out = rl_outstream; + if (!out) + out = stdout; rl_bind_key('?', inline_help); if (!rl_attempted_completion_function)