View | Details | Raw Unified | Return to bug 33187
Collapse All | Expand All

(-)print.c Wed Dec 26 00:49:54 2001 (-6 / +8 lines)
Lines 69-75 Link Here
69
static int     printaname __P((FTSENT *, u_long, u_long));
69
static int     printaname __P((FTSENT *, u_long, u_long));
70
static void    printlink __P((FTSENT *));
70
static void    printlink __P((FTSENT *));
71
static void    printtime __P((time_t));
71
static void    printtime __P((time_t));
72
static int     printtype __P((u_int));
72
static int     printtype __P((u_int, const char*, u_int len));
73
#ifdef COLORLS
73
#ifdef COLORLS
74
static void     endcolor __P((int));
74
static void     endcolor __P((int));
75
static int      colortype __P((mode_t));
75
static int      colortype __P((mode_t));
Lines 190-196 Link Here
190
                       endcolor(0);
190
                       endcolor(0);
191
#endif
191
#endif
192
               if (f_type)
192
               if (f_type)
193
                       (void)printtype(sp->st_mode);
193
                       (void)printtype(sp->st_mode, p->fts_name, p->fts_namelen);
194
               if (S_ISLNK(sp->st_mode))
194
               if (S_ISLNK(sp->st_mode))
195
                       printlink(p);
195
                       printlink(p);
196
               (void)putchar('\n');
196
               (void)putchar('\n');
Lines 301-307 Link Here
301
               endcolor(0);
301
               endcolor(0);
302
#endif
302
#endif
303
       if (f_type)
303
       if (f_type)
304
               chcnt += printtype(sp->st_mode);
304
               chcnt += printtype(sp->st_mode, p->fts_name, p->fts_namelen);
305
       return (chcnt);
305
       return (chcnt);
306
}
306
}
307
307
Lines 334-345 Link Here
334
}
334
}
335
335
336
static int
336
static int
337
printtype(mode)
337
printtype(mode, name, len)
338
       u_int mode;
338
       const char* name;
339
       u_int       mode, len;
339
{
340
{
340
       switch (mode & S_IFMT) {
341
       switch (mode & S_IFMT) {
341
       case S_IFDIR:
342
       case S_IFDIR:
342
               (void)putchar('/');
343
               if (name[len - 1] != '/')
344
                       (void)putchar('/');
343
               return (1);
345
               return (1);
344
       case S_IFIFO:
346
       case S_IFIFO:
345
               (void)putchar('|');
347
               (void)putchar('|');

Return to bug 33187