From 6417ba84400fcae1bd92e66c992e4641b515d8da Mon Sep 17 00:00:00 2001 From: Andreas Gustafsson Date: Mon, 27 Nov 2000 17:56:35 +0000 Subject: [PATCH] don't print prompts when reading input from file --- bin/nsupdate/nsupdate.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/bin/nsupdate/nsupdate.c b/bin/nsupdate/nsupdate.c index ad04eef537..c56903f5ad 100644 --- a/bin/nsupdate/nsupdate.c +++ b/bin/nsupdate/nsupdate.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: nsupdate.c,v 1.66 2000/11/27 00:43:32 marka Exp $ */ +/* $Id: nsupdate.c,v 1.67 2000/11/27 17:56:35 gson Exp $ */ #include @@ -117,6 +117,7 @@ static char *keystr = NULL, *keyfile = NULL; static isc_entropy_t *entp = NULL; static isc_boolean_t shuttingdown = ISC_FALSE; static FILE *input; +static isc_boolean_t interactive = ISC_TRUE; typedef struct nsu_requestinfo { dns_message_t *msg; @@ -581,6 +582,7 @@ parse_args(int argc, char **argv) { isc_result_totext(result)); exit(1); } + interactive = ISC_FALSE; } } @@ -1120,7 +1122,8 @@ get_next_command(void) { char *word; ddebug("get_next_command()"); - fprintf(stdout, "> "); + if (interactive) + fprintf(stdout, "> "); cmdline = fgets(cmdlinebuf, MAXCMD, input); if (cmdline == NULL) return (STATUS_QUIT);