Bug 23161

Summary: tcsh execs /bin/ls --color <other options>
Product: Base System Reporter: anand <anand>
Component: miscAssignee: Mark Peek <mp>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: 4.2-RELEASE   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
file.diff none

Description anand 2000-11-28 18:00:01 UTC
        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.

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?
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
Comment 1 alex freebsd_committer freebsd_triage 2000-12-03 09:57:19 UTC
Responsible Changed
From-To: freebsd-bugs->obrien

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.
Comment 2 David E. O'Brien freebsd_committer freebsd_triage 2000-12-03 10:04:44 UTC
Responsible Changed
From-To: obrien->freebsd-bugs

I'm not the tcsh maintainer any more.
Comment 3 Jonathan Chen freebsd_committer freebsd_triage 2001-08-05 11:34:15 UTC
Responsible Changed
From-To: freebsd-bugs->imp

imp == tcsh maintainer.
Comment 4 Mark Peek freebsd_committer freebsd_triage 2001-09-06 00:10:53 UTC
State Changed
From-To: open->analyzed

Committed through import of tcsh-6.11. 


Comment 5 Mark Peek freebsd_committer freebsd_triage 2001-09-06 00:10:53 UTC
Responsible Changed
From-To: imp->mp

MFC reminder.
Comment 6 Mark Peek freebsd_committer freebsd_triage 2001-10-08 23:59:00 UTC
State Changed
From-To: analyzed->closed

MFC'd.