Subject: bin/390: sort - (stdin) is broken.
To: None <gnats-admin>
From: John F. Woods <jfw@jfwhome.funhouse.com>
List: netbsd-bugs
Date: 08/03/1994 20:20:04
>Number:         390
>Category:       bin
>Synopsis:       sort with - (stdin) doesn't work for multiple files
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    gnats-admin (Utility Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Aug  3 20:20:02 1994
>Originator:     John F. Woods
>Organization:
Misanthropes-R-Us
>Release:        1.0 BETA
>Environment:
	
System: NetBSD jfwhome.funhouse.com 1.0_BETA NetBSD 1.0_BETA (JFW) #1: Wed Aug 3 07:58:06 PDT 1994 root@:/usr/src/sys/arch/i386/compile/JFW i386


>Description:
	When sort is asked to sort two input streams, one of which is - (for
stdin), it sorts only the first stream.  Two filenames appears to work.

>How-To-Repeat:
	cat /etc/motd | sort - /etc/group
>Fix:

*** sort.c.orig	Wed Aug  3 23:02:40 1994
--- sort.c	Wed Aug  3 23:02:42 1994
***************
*** 1487,1496 ****
  	  if (*s)
  	    badfieldspec (argv[i]);
  	}
!       else if (argv[i][0] == '-')
  	{
- 	  if (!strcmp ("-", argv[i]))
- 	    break;
  	  s = argv[i] + 1;
  	  if (digits[UCHAR (*s)])
  	    {
--- 1487,1494 ----
  	  if (*s)
  	    badfieldspec (argv[i]);
  	}
!       else if (argv[i][0] == '-' && argv[i][1])
  	{
  	  s = argv[i] + 1;
  	  if (digits[UCHAR (*s)])
  	    {
>Audit-Trail:
>Unformatted:


------------------------------------------------------------------------------