PERFORCE change 18589 for review
Robert Watson
rwatson at freebsd.org
Thu Oct 3 16:51:43 GMT 2002
http://people.freebsd.org/~peter/p4db/chv.cgi?CH=18589
Change 18589 by rwatson at rwatson_paprika on 2002/10/03 09:50:42
Attempt to better approximate ls behavior in the presence of
symlinks: don't follow links if the user has requested that
statistics be generated for the links themselves, but do follow
links if they haven't.
Affected files ...
.. //depot/projects/trustedbsd/mac/bin/ls/ls.c#13 edit
Differences ...
==== //depot/projects/trustedbsd/mac/bin/ls/ls.c#13 (text+ko) ====
@@ -80,7 +80,7 @@
*/
#define STRBUF_SIZEOF(t) (1 + CHAR_BIT * sizeof(t) / 3 + 1)
-static void display(FTSENT *, FTSENT *);
+static void display(FTSENT *, FTSENT *, int);
static u_quad_t makenines(u_long);
static int mastercmp(const FTSENT * const *, const FTSENT * const *);
static void traverse(int, char **, int);
@@ -440,7 +440,7 @@
fts_open(argv, options, f_nosort ? NULL : mastercmp)) == NULL)
err(1, "fts_open");
- display(NULL, fts_children(ftsp, 0));
+ display(NULL, fts_children(ftsp, 0), options);
if (f_listdir)
return;
@@ -477,7 +477,7 @@
output = 1;
}
chp = fts_children(ftsp, ch_options);
- display(p, chp);
+ display(p, chp, options);
if (!f_recursive && chp != NULL)
(void)fts_set(ftsp, p, FTS_SKIP);
@@ -495,7 +495,7 @@
* points to the parent directory of the display list.
*/
static void
-display(FTSENT *p, FTSENT *list)
+display(FTSENT *p, FTSENT *list, int options)
{
struct stat *sp;
DISPLAY d;
@@ -693,16 +693,12 @@
goto label_out;
}
-#if 0
- if (S_ISLNK(sp->st_mode))
-#endif
- error = mac_get_link(
+ if (options & FTS_LOGICAL)
+ error = mac_get_file(
cur->fts_path, label);
-#if 0
else
- error = mac_get_file(
+ error = mac_get_link(
cur->fts_name, label);
-#endif
if (error == -1) {
perror(cur->fts_name);
mac_free(label);
To Unsubscribe: send mail to majordomo at trustedbsd.org
with "unsubscribe trustedbsd-cvs" in the body of the message
More information about the trustedbsd-cvs
mailing list