From dglo@tick.ssec.wisc.edu  Tue Aug 11 19:43:22 1998
Received: from tick.ssec.wisc.edu (tick.ssec.wisc.edu [144.92.108.121])
          by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id TAA02090
          for <FreeBSD-gnats-submit@freebsd.org>; Tue, 11 Aug 1998 19:43:17 -0700 (PDT)
          (envelope-from dglo@tick.ssec.wisc.edu)
Received: from tick.ssec.wisc.edu (localhost [127.0.0.1])
	by tick.ssec.wisc.edu (8.8.7/8.8.7) with ESMTP id VAA21912
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 11 Aug 1998 21:42:53 -0500 (CDT)
Message-Id: <199808120242.VAA21912@tick.ssec.wisc.edu>
Date: Tue, 11 Aug 1998 21:42:52 -0500
From: Dave Glowacki <dglo@SSEC.WISC.EDU>
To: FreeBSD-gnats-submit@freebsd.org
Subject: indent(1) input file isn't really optional
X-Send-Pr-Version: 3.2

>Number:         7583
>Category:       bin
>Synopsis:       indent input file argument isn't really optional
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Aug 11 19:50:01 PDT 1998
>Closed-Date:    Sat Oct 17 21:46:30 PDT 1998
>Last-Modified:  Sat Oct 17 21:47:38 PDT 1998
>Originator:     Dave Glowacki
>Release:        FreeBSD 2.2.6-STABLE i386
>Organization:
>Environment:

	

>Description:

	The synopsis for indent(1) starts out:

		indent [input-file [output-file]] [-bad | -nbad] [-bap | -nbap]

	but when indent is run as 'indent < infile > outfile', it spits
	out

		usage: indent file [ outfile ] [ options ]

>How-To-Repeat:

	Run indent

>Fix:

	The CVS log didn't indicate any reason *not* to support input
	via standard input and I made the following patch without any
	apparent ill effects (though I didn't really test it exhaustively)

Index: indent.c
===================================================================
RCS file: /disk0/freebsd/src/usr.bin/indent/indent.c,v
retrieving revision 1.1.1.1.8.1
diff -c -r1.1.1.1.8.1 indent.c
*** indent.c	1997/07/16 06:41:29	1.1.1.1.8.1
--- indent.c	1998/08/11 23:16:50
***************
*** 209,218 ****
  	    set_option(argv[i]);
      }				/* end of for */
      if (input == 0) {
! 		usage();
      }
      if (output == 0)
! 	if (troff)
  	    output = stdout;
  	else {
  	    out_name = in_name;
--- 209,218 ----
  	    set_option(argv[i]);
      }				/* end of for */
      if (input == 0) {
! 	input = stdin;
      }
      if (output == 0)
! 	if (troff || input == stdin)
  	    output = stdout;
  	else {
  	    out_name = in_name;
***************
*** 1133,1139 ****
  static void
  usage()
  {
! 	fprintf(stderr, "usage: indent file [ outfile ] [ options ]\n");
  	exit(1);
  }
  
--- 1133,1139 ----
  static void
  usage()
  {
! 	fprintf(stderr, "usage: indent [ file [ outfile ] ] [ options ]\n");
  	exit(1);
  }
  
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: thepish 
State-Changed-When: Sat Oct 17 21:46:30 PDT 1998 
State-Changed-Why:  
Good patch. Thankyou. 
>Unformatted:
