FreeBSD Bugzilla – Attachment 18470 Details for
Bug 33187
[PATCH] /bin/ls -dF adds trailing slash regardless of whether there is already one there
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
file.diff
file.diff (text/plain), 1.43 KB, created by
mikem
on 2001-12-26 09:50:01 UTC
(
hide
)
Description:
file.diff
Filename:
MIME Type:
Creator:
mikem
Created:
2001-12-26 09:50:01 UTC
Size:
1.43 KB
patch
obsolete
>--- /usr/src/bin/ls/print.c Tue Nov 27 06:30:05 2001 >+++ print.c Wed Dec 26 00:49:54 2001 >@@ -69,7 +69,7 @@ > static int printaname __P((FTSENT *, u_long, u_long)); > static void printlink __P((FTSENT *)); > static void printtime __P((time_t)); >-static int printtype __P((u_int)); >+static int printtype __P((u_int, const char*, u_int len)); > #ifdef COLORLS > static void endcolor __P((int)); > static int colortype __P((mode_t)); >@@ -190,7 +190,7 @@ > endcolor(0); > #endif > if (f_type) >- (void)printtype(sp->st_mode); >+ (void)printtype(sp->st_mode, p->fts_name, p->fts_namelen); > if (S_ISLNK(sp->st_mode)) > printlink(p); > (void)putchar('\n'); >@@ -301,7 +301,7 @@ > endcolor(0); > #endif > if (f_type) >- chcnt += printtype(sp->st_mode); >+ chcnt += printtype(sp->st_mode, p->fts_name, p->fts_namelen); > return (chcnt); > } > >@@ -334,12 +334,14 @@ > } > > static int >-printtype(mode) >- u_int mode; >+printtype(mode, name, len) >+ const char* name; >+ u_int mode, len; > { > switch (mode & S_IFMT) { > case S_IFDIR: >- (void)putchar('/'); >+ if (name[len - 1] != '/') >+ (void)putchar('/'); > return (1); > case S_IFIFO: > (void)putchar('|');
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 33187
: 18470 |
18471