Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F144283117
D34747.id104701.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D34747.id104701.diff
View Options
Index: bin/ls/ls.h
===================================================================
--- bin/ls/ls.h
+++ bin/ls/ls.h
@@ -54,8 +54,10 @@
extern int f_samesort; /* sort time and name in same direction */
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_thousands; /* show file sizes with thousands separators */
extern char *f_timeformat; /* user-specified time format */
Index: bin/ls/ls.c
===================================================================
--- bin/ls/ls.c
+++ bin/ls/ls.c
@@ -141,8 +141,10 @@
static int f_singlecol; /* use single column output */
int f_size; /* list size in short listing */
static int f_sizesort;
+ 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 */
int f_thousands; /* show file sizes with thousands separators */
@@ -401,7 +403,11 @@
f_listdir = 1;
f_recursive = 0;
break;
- case 'g': /* Compatibility with 4.3BSD. */
+ case 'g':
+ f_longform = 1;
+ f_singlecol = 0;
+ f_stream = 0;
+ f_sowner = 1;
break;
case 'h':
f_humanval = 1;
@@ -420,9 +426,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;
Index: bin/ls/print.c
===================================================================
--- bin/ls/print.c
+++ bin/ls/print.c
@@ -234,9 +234,11 @@
strmode(sp->st_mode, buf);
aclmode(buf, p);
np = p->fts_pointer;
- (void)printf("%s %*ju %-*s %-*s ", buf, dp->s_nlink,
- (uintmax_t)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)
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Feb 8, 2:33 PM (14 h, 53 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
28469882
Default Alt Text
D34747.id104701.diff (2 KB)
Attached To
Mode
D34747: ls(1): Change -g and make -n imply -l to implement POSIX
Attached
Detach File
Event Timeline
Log In to Comment