From GregoryC@stcinc.com  Thu Apr 11 20:10:12 2002
Return-Path: <GregoryC@stcinc.com>
Received: from internet.simplifiedtechnology.com (internet.simplifiedtechnology.com [168.103.109.65])
	by hub.freebsd.org (Postfix) with ESMTP id E047337B405
	for <FreeBSD-gnats-submit@freebsd.org>; Thu, 11 Apr 2002 20:10:11 -0700 (PDT)
Received: from stcinc.com ([10.2.1.2])
	by internet.simplifiedtechnology.com (8.10.2/8.10.2) with ESMTP id g3C39KN36206
	for <FreeBSD-gnats-submit@freebsd.org>; Thu, 11 Apr 2002 20:09:20 -0700 (PDT)
Message-Id: <3CB64FF6.4CC2D434@stcinc.com>
Date: Thu, 11 Apr 2002 20:09:42 -0700
From: Gregory Carvalho <GregoryC@stcinc.com>
Sender: gregory@internet.simplifiedtechnology.com
To: FreeBSD-gnats-submit@freebsd.org
Subject: ls directory name output trailing slash duplcation - PATCH

>Number:         37013
>Category:       bin
>Synopsis:       [patch] ls(1) directory name output trailing slash duplcation
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Apr 11 20:20:00 PDT 2002
>Closed-Date:    Sat Mar 05 13:40:01 EST 2011
>Last-Modified:  Sat Mar 05 13:40:01 EST 2011
>Originator:     Gregory Carvalho
>Release:        FreeBSD 4.5-RELEASE i386
>Organization:
Simplified Technology Company
>Environment:
 System: FreeBSD newest.simplifiedtechnology.com 4.5-RELEASE FreeBSD 4.5-RELEASE
  #0: Mon Apr 1 21:55:35 PST 2002 root@newest.simplifiedtechnology.com:/usr/src/s
 ys/compile/NEWEST i386
>Description:
ls outputs an aesthetically unpleasant double slash at the conclusion of a direc
tory name when the -d and -F options are used and a slash is appended to the dir
ectory name in the argument list.
>How-To-Repeat:
# ls -dF /usr/
/usr//
# 
>Fix:
*** ls.slashfix.c       Thu Apr 11 19:36:07 2002
--- ls.c        Wed Aug 16 12:57:11 2000
***************
*** 570,584 ****
                                continue;
                        }
                }
-               /*
-                * Strip a trailing slash in argv if the options -d and -F
-                  * are in the option list.
-                */
-               if (f_listdir && f_type &&
-                   !strcmp(cur->fts_name + cur->fts_namelen - 1, "/")) {
-                       strcpy(cur->fts_name + cur->fts_namelen - 1, "\0");
-                       cur->fts_namelen -= 1;
-               }
                if (cur->fts_namelen > maxlen)
                        maxlen = cur->fts_namelen;
                if (f_octal || f_octal_escape) {
--- 570,575 ----
>Release-Note:
>Audit-Trail:

From: Maxim Konovalov <maxim@macomnet.ru>
To: Gregory Carvalho <GregoryC@stcinc.com>
Cc: bug-followup@freebsd.org
Subject: Re: bin/37013: ls directory name output trailing slash duplcation
 - PATCH
Date: Fri, 12 Apr 2002 10:04:21 +0400 (MSD)

 Have you seen bin/33187?
 
 http://www.freebsd.org/cgi/query-pr.cgi?pr=bin/33187
 
 -- 
 Maxim Konovalov, MAcomnet, Internet Dept., system engineer
 phone: +7 (095) 796-9079, mailto:maxim@macomnet.ru
 

From: Gregory Carvalho <GregoryC@stcinc.com>
To: Maxim Konovalov <maxim@macomnet.ru>
Cc: bug-followup@freebsd.org
Subject: Re: bin/37013: ls directory name output trailing slash duplcation- PATCH
Date: Thu, 25 Apr 2002 16:25:45 -0700

 Maxim Konovalov wrote:
 > 
 > Have you seen bin/33187?
 > 
 > http://www.freebsd.org/cgi/query-pr.cgi?pr=bin/33187
 
 I apologize for my oversight. Perhaps the compact patch I provided sufficiently
 addresses the concerns expressed in the thread related to bin/33187.
 
 1) Color settings remain unaffected by bin/37013.
 2) The code style of bin/37013 maintains consistency with the original ls.c.
 3) bin/37013 doesn't break ``ls -dF /''.
 4) Symlinks operate properly with bin/37013.
 5) While bin/37013 does not truncate the output of ``ls -dF
 /usr////////////////'' to /usr/, it resrticts ls(1) from appending an
 additional, illegitimate /.
 6) bin/37013 is a minimal patch, and I anticipate negligible performance impact;
 in other words, bin/37013 could still be interpreted as "overloading" the
 utilites.
 
 I recognize bin/33187 addressed some of these issues, but, in my opinion, item 5
 above is the weakest link for bin/37013.
 
 With respect,
 Gregory Carvalho
State-Changed-From-To: open->closed 
State-Changed-By: eadler 
State-Changed-When: Sat Mar 5 13:40:01 EST 2011 
State-Changed-Why:  
for the same reason bin/33187 was closed 

http://www.freebsd.org/cgi/query-pr.cgi?pr=37013 
>Unformatted:
