FreeBSD Bugzilla – Attachment 46057 Details for
Bug 70813
ls(1) is not POSIX compliant: options -g, -n, and -o in particular
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
file.diff
file.diff (text/plain), 3.77 KB, created by
Paul P
on 2004-08-22 06:20:21 UTC
(
hide
)
Description:
file.diff
Filename:
MIME Type:
Creator:
Paul P
Created:
2004-08-22 06:20:21 UTC
Size:
3.77 KB
patch
obsolete
>diff -u ls.orig/ls.c ls/ls.c >--- ls.orig/ls.c Sun Aug 22 00:52:45 2004 >+++ ls/ls.c Sun Aug 22 00:52:15 2004 >@@ -126,8 +126,10 @@ > int f_sectime; /* print the real time for all files */ > static int f_singlecol; /* use single column output */ > int f_size; /* list size in short listing */ >+ int f_sgroup; /* Show group on output */ > int f_slash; /* similar to f_type, but only for dirs */ > int f_sortacross; /* sort across rows, not down columns */ >+ int f_sowner; /* Show owner in output */ > int f_statustime; /* use time of last mode change */ > static int f_stream; /* stream the output, separate with commas */ > static int f_timesort; /* sort by time vice name */ >@@ -208,6 +210,9 @@ > f_singlecol = 0; > f_stream = 0; > break; >+ case 'O': >+ f_flags = 1; >+ break; > case 'x': > f_sortacross = 1; > f_longform = 0; >@@ -259,6 +264,14 @@ > f_nosort = 1; > break; > case 'g': /* Compatibility with 4.3BSD. */ >+#ifndef COMPAT_43 >+ f_longform = 1; >+ f_singlecol = 0; >+ f_stream = 0; >+ f_sowner = 1; >+#else >+ f_sowner = 0; >+#endif > break; > case 'h': > f_humanval = 1; >@@ -277,9 +290,15 @@ > break; > case 'n': > f_numericonly = 1; >+ f_longform = 1; >+ f_singlecol = 0; >+ f_stream = 0; > break; > case 'o': >- f_flags = 1; >+ f_longform = 1; >+ f_singlecol = 0; >+ f_stream = 0; >+ f_sgroup = 1; > break; > case 'p': > f_slash = 1; >diff -u ls.orig/ls.h ls/ls.h >--- ls.orig/ls.h Sun Aug 22 00:52:45 2004 >+++ ls/ls.h Sun Aug 22 00:52:15 2004 >@@ -53,8 +53,10 @@ > extern int f_nonprint; /* show unprintables as ? */ > extern int f_sectime; /* print the real time for all files */ > extern int f_size; /* list size in short listing */ >+extern int f_sgroup; /* Show group on output */ > extern int f_slash; /* append a '/' if the file is a directory */ > extern int f_sortacross; /* sort across rows, not down columns */ >+extern int f_sowner; /* Show owner on output */ > extern int f_statustime; /* use time of last mode change */ > extern int f_notabs; /* don't use tab-separated multi-col output */ > extern int f_type; /* add type character for non-regular files */ >diff -u ls.orig/print.c ls/print.c >--- ls.orig/print.c Sun Aug 22 00:52:45 2004 >+++ ls/print.c Sun Aug 22 00:52:15 2004 >@@ -191,9 +191,11 @@ > prevdev = sp->st_dev; > } > np = p->fts_pointer; >- (void)printf("%s %*u %-*s %-*s ", buf, dp->s_nlink, >- sp->st_nlink, dp->s_user, np->user, dp->s_group, >- np->group); >+ (void)printf("%s %u ", buf, dp->s_nlink); >+ if(!f_sowner) >+ (void)printf("%-*s ", dp->s_user, np->user); >+ if(!f_sgroup) >+ (void)printf("%-*s ", dp->s_group, np->group); > if (f_flags) > (void)printf("%-*s ", dp->s_flags, np->flags); > if (f_label)
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 70813
: 46057