Date: Tue, 28 Nov 2000 09:52:18 -0800 (PST) From: anand@blandings.com To: freebsd-gnats-submit@FreeBSD.ORG Subject: misc/23161: tcsh execs /bin/ls --color <other options> Message-ID: <20001128175218.9FCAA37B400@hub.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 23161
>Category: misc
>Synopsis: tcsh execs /bin/ls --color <other options>
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: freebsd-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: sw-bug
>Submitter-Id: current-users
>Arrival-Date: Tue Nov 28 10:00:01 PST 2000
>Closed-Date:
>Last-Modified:
>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:
>Unformatted:
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20001128175218.9FCAA37B400>
