From: ceriel Date: Thu, 8 Feb 1990 15:11:23 +0000 (+0000) Subject: only print file names if there is more than one X-Git-Tag: release-5-5~1837 X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=ba6c223113e12efd025a62994ae1e7f48d0bdc67;p=ack.git only print file names if there is more than one --- diff --git a/util/ack/main.c b/util/ack/main.c index 200ee45b7..5b8dc9e32 100644 --- a/util/ack/main.c +++ b/util/ack/main.c @@ -17,6 +17,7 @@ static char rcs_ack[] = RCS_ACK ; #endif static int sigs[] = { SIGINT, SIGHUP, SIGTERM, 0 } ; +static int arg_count; extern char *getenv(); @@ -66,6 +67,9 @@ main(argc,argv) char **argv ; { } } + scanlist ( l_first(arguments), elem ) { + arg_count++; + } scanlist ( l_first(arguments), elem ) { if ( !process(l_content(*elem)) && !k_flag ) exit(1) ; @@ -312,7 +316,7 @@ process(arg) char *arg ; { return 1 ; } in= orig ; - if ( !nill_flag ) { + if ( !nill_flag && arg_count > 1 ) { printf("%s\n",arg) ; } return startrf(phase) ;