From owner-svn-src-head@FreeBSD.ORG Mon Jun 8 19:13:05 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A0C47E1C; Mon, 8 Jun 2015 19:13:05 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8EBA017CA; Mon, 8 Jun 2015 19:13:05 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t58JD5tS090443; Mon, 8 Jun 2015 19:13:05 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t58JD5KX090442; Mon, 8 Jun 2015 19:13:05 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201506081913.t58JD5KX090442@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Mon, 8 Jun 2015 19:13:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r284162 - head/bin/ls X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Jun 2015 19:13:05 -0000 Author: delphij Date: Mon Jun 8 19:13:04 2015 New Revision: 284162 URL: https://svnweb.freebsd.org/changeset/base/284162 Log: It has been long time that when doing 'ls -G /path/to/a/symlink', instead of using the color of symbolic link, the color is determined by the link target. This behavior was quite confusing. Looking at the file history, it looks like that r203665 intends to fix this but the issue was never actually fixed. Fix this by not setting FTS_COMFOLLOW when color is requested like what was done in r203665. MFC after: 2 weeks Modified: head/bin/ls/ls.c Modified: head/bin/ls/ls.c ============================================================================== --- head/bin/ls/ls.c Mon Jun 8 18:59:14 2015 (r284161) +++ head/bin/ls/ls.c Mon Jun 8 19:13:04 2015 (r284162) @@ -413,9 +413,14 @@ main(int argc, char *argv[]) /* * If not -F, -P, -d or -l options, follow any symbolic links listed on - * the command line. + * the command line, unless in color mode in which case we need to + * distinguish file type for a symbolic link itself and its target. */ - if (!f_nofollow && !f_longform && !f_listdir && (!f_type || f_slash)) + if (!f_nofollow && !f_longform && !f_listdir && (!f_type || f_slash) +#ifdef COLORLS + && !f_color +#endif + ) fts_options |= FTS_COMFOLLOW; /*