From nobody@FreeBSD.ORG  Tue Nov 28 09:52:18 2000
Return-Path: <nobody@FreeBSD.ORG>
Received: by hub.freebsd.org (Postfix, from userid 32767)
	id 9FCAA37B400; Tue, 28 Nov 2000 09:52:18 -0800 (PST)
Message-Id: <20001128175218.9FCAA37B400@hub.freebsd.org>
Date: Tue, 28 Nov 2000 09:52:18 -0800 (PST)
From: anand@blandings.com
Sender: nobody@FreeBSD.ORG
To: freebsd-gnats-submit@FreeBSD.org
Subject: tcsh execs /bin/ls --color <other options>
X-Send-Pr-Version: www-1.0

>Number:         23161
>Category:       misc
>Synopsis:       tcsh execs /bin/ls --color <other options>
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    mp
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Nov 28 10:00:01 PST 2000
>Closed-Date:    Mon Oct 8 15:59:00 PDT 2001
>Last-Modified:  Mon Oct 08 15:59:32 PDT 2001
>Originator:     Anand Ranganathan
>Release:        4.2-RELEASE
>Organization:
>Environment:
FreeBSD wooster.jumpdata.com 4.2-RELEASE FreeBSD 4.2-RELEASE #2: Tue Nov 21 16:54:44 PST 2000     anand@wooster.jumpdata.com:/usr/src/sys/compile/WOOSTER  i386

>Description:
        tcsh supports an ls-F builtin that is purported to be faster than
the normal /bin/ls. ls-F also supports colorized ls listings and all the
normal ls options. When invoked with no arguments, ls-F produces a normal
listing like that of /bin/ls. When invoked with arguments, it executes
"/bin/ls <args>" where <args> are the arguments passed to ls-F. Colorized
output may be enabled by using the command "set color" on tcsh. In this
case ls-F <args> translates to "/bin/ls --color <args>". Due to a getopt
oddity reported in pr 23148, /bin/ls ignores the --color option and treats
the remaining arguments as filenames even if they were options to ls. This
causes weird behavior as shown below.


>How-To-Repeat:
    In an xterm execute the following:
        112 wooster:tmp/foo> ls
        bar  baz
        113 wooster:tmp/foo> tcsh -f
        > ls
        bar     baz
        > ls-F
        bar  baz
        > ls-F -l
        total 0
        -rw-r--r--  1 anand  wheel  0 Nov 27 17:45 bar
        -rw-r--r--  1 anand  wheel  0 Nov 27 17:45 baz
        > set color
        > ls-F
        bar  baz
        > ls-F -l
        ls: -l: No such file or directory
        > ls-F -a
        ls: -a: No such file or directory
>Fix:
        This is a patch that I generated on 4.2 RELEASE. I have sent a
modified version of this patch to the tcsh developers. I hope they include
it in their next version. Until then, could we have this patch in 4.2-stable please?

--- contrib/tcsh/tc.const.c.orig        Sat Jun 10 15:25:57 2000
+++ contrib/tcsh/tc.const.c     Tue Nov 28 09:20:33 2000
@@ -404,7 +404,7 @@
 #ifdef COLOR_LS_F
 Char STRlsmF[]         = { 'l', 's', '-', 'F', '\0' };
 Char STRcolor[]                = { 'c', 'o', 'l', 'o', 'r', '\0' };
-Char STRmmcolormauto[] = {'-', '-', 'c', 'o', 'l', 'o', 'r', '=', 'a', 'u', 't', 'o', '\0' };
+Char STRmmcolormauto[] = {'-', 'G', '\0' };
 Char STRLS_COLORS[]    = { 'L', 'S', '_', 'C', 'O', 'L', 'O', 'R', 'S', '\0' };
 #endif /* COLOR_LS_F */
 



>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->obrien 
Responsible-Changed-By: alex 
Responsible-Changed-When: Sun Dec 3 01:57:19 PST 2000 
Responsible-Changed-Why:  
Over to the tcsh-maintainer in the tree. 
If the tcsh-developers accept this patch (or another solution), 
I'm sure David will import a new version of this file soon. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=23161 
Responsible-Changed-From-To: obrien->freebsd-bugs 
Responsible-Changed-By: obrien 
Responsible-Changed-When: Sun Dec 3 02:04:44 PST 2000 
Responsible-Changed-Why:  
I'm not the tcsh maintainer any more. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=23161 
Responsible-Changed-From-To: freebsd-bugs->imp 
Responsible-Changed-By: jon 
Responsible-Changed-When: Sun Aug 5 03:34:15 PDT 2001 
Responsible-Changed-Why:  
imp == tcsh maintainer. 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=23161 
State-Changed-From-To: open->analyzed 
State-Changed-By: mp 
State-Changed-When: Wed Sep 5 16:10:53 PDT 2001 
State-Changed-Why:  
Committed through import of tcsh-6.11. 


Responsible-Changed-From-To: imp->mp 
Responsible-Changed-By: mp 
Responsible-Changed-When: Wed Sep 5 16:10:53 PDT 2001 
Responsible-Changed-Why:  
MFC reminder. 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=23161 
State-Changed-From-To: analyzed->closed 
State-Changed-By: mp 
State-Changed-When: Mon Oct 8 15:59:00 PDT 2001 
State-Changed-Why:  
MFC'd. 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=23161 
>Unformatted:
