Submitted by:	Dave Glowacki <dglo@SSEC.WISC.EDU>
Support input via stdin if no input file name specified explicitly
This commit is contained in:
Peter Hawkins 1998-10-18 04:46:24 +00:00
parent a19bc2b0fb
commit 18251d7146
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=40502

View File

@ -46,7 +46,7 @@ static const char copyright[] =
static char sccsid[] = "@(#)indent.c 5.17 (Berkeley) 6/7/93"; static char sccsid[] = "@(#)indent.c 5.17 (Berkeley) 6/7/93";
#endif #endif
static const char rcsid[] = static const char rcsid[] =
"$Id$"; "$Id: indent.c,v 1.2 1997/07/15 09:50:59 charnier Exp $";
#endif /* not lint */ #endif /* not lint */
#include <sys/param.h> #include <sys/param.h>
@ -209,10 +209,10 @@ main(argc, argv)
set_option(argv[i]); set_option(argv[i]);
} /* end of for */ } /* end of for */
if (input == 0) { if (input == 0) {
usage(); input = stdin;
} }
if (output == 0) if (output == 0)
if (troff) if (troff || input == stdin)
output = stdout; output = stdout;
else { else {
out_name = in_name; out_name = in_name;
@ -1133,7 +1133,7 @@ check_type:
static void static void
usage() usage()
{ {
fprintf(stderr, "usage: indent file [ outfile ] [ options ]\n"); fprintf(stderr, "usage: indent [ file [ outfile ] ] [ options ]\n");
exit(1); exit(1);
} }