Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 13 Nov 2002 08:38:44 -0800 (PST)
From:      Brian Feldman <green@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 21034 for review
Message-ID:  <200211131638.gADGciVD042901@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=21034

Change 21034 by green@green_laptop_2 on 2002/11/13 08:38:20

	Okay, I really hate this code, fts(3), etc.  I'm SURE it works
	now.  Net changes are a single extra comparison and correct
	printing of pathname in errors.

Affected files ...

.. //depot/projects/trustedbsd/mac/bin/ls/ls.c#22 edit

Differences ...

==== //depot/projects/trustedbsd/mac/bin/ls/ls.c#22 (text+ko) ====

@@ -448,7 +448,8 @@
 	 * If not recursing down this tree and don't need stat info, just get
 	 * the names.
 	 */
-	ch_options = !f_recursive && options & FTS_NOSTAT ? FTS_NAMEONLY : 0;
+	ch_options = !f_recursive && !f_label &&
+	    options & FTS_NOSTAT ? FTS_NAMEONLY : 0;
 
 	while ((p = fts_read(ftsp)) != NULL)
 		switch (p->fts_info) {
@@ -697,9 +698,9 @@
 						goto label_out;
 					}
 
-					if (cur->fts_parent == NULL)
+					if (cur->fts_level == FTS_ROOTLEVEL)
 						snprintf(name, sizeof(name),
-						"%s", p->fts_name);
+						    "%s", cur->fts_name);
 					else
 						snprintf(name, sizeof(name),
 						    "%s/%s", cur->fts_parent->

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe p4-projects" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200211131638.gADGciVD042901>