summaryrefslogtreecommitdiff
path: root/coreutils/ls.c
diff options
context:
space:
mode:
authorErik Andersen <andersen@codepoet.org>1999-12-29 22:19:46 +0000
committerErik Andersen <andersen@codepoet.org>1999-12-29 22:19:46 +0000
commit1266a13e1f687d34052ae7e2469048d035633e58 (patch)
treedc70d49434faf03d25c199ebbb3d360d95e5fac5 /coreutils/ls.c
parenta89910829c73c5ed4f30eecb181d7b3087ca4f74 (diff)
downloadbusybox-w32-1266a13e1f687d34052ae7e2469048d035633e58.tar.gz
busybox-w32-1266a13e1f687d34052ae7e2469048d035633e58.tar.bz2
busybox-w32-1266a13e1f687d34052ae7e2469048d035633e58.zip
* sed now supports addresses (numeric or regexp, with negation) and
has an append command, thanks to Marco Pantaleoni <panta@prosa.it> * Fixed dmesg. It wasn't parsing its options (-n or -s) properly. * Some cosmetic fixes to ls output formatting to make it behave more like GNU ls. -Erik
Diffstat (limited to 'coreutils/ls.c')
-rw-r--r--coreutils/ls.c26
1 files changed, 15 insertions, 11 deletions
diff --git a/coreutils/ls.c b/coreutils/ls.c
index 571c962c7..862da4368 100644
--- a/coreutils/ls.c
+++ b/coreutils/ls.c
@@ -193,11 +193,13 @@ static void list_single(const char *name, struct stat *info, const char *fullnam
193 fputs(" ", stdout); 193 fputs(" ", stdout);
194#ifdef BB_FEATURE_LS_USERNAME 194#ifdef BB_FEATURE_LS_USERNAME
195 if (!(opts & DISP_NUMERIC)) { 195 if (!(opts & DISP_NUMERIC)) {
196 scratch[0]='\0'; 196 memset ( scratch, 0, sizeof (scratch));
197 my_getpwuid( scratch, info->st_uid); 197 my_getpwuid( scratch, info->st_uid);
198 scratch[8]='\0'; 198 if (*scratch) {
199 if (*scratch) 199 fputs(scratch, stdout);
200 wr(scratch,8); 200 if ( strlen( scratch) <= 8 )
201 wr(" ", 8-strlen( scratch));
202 }
201 else { 203 else {
202 writenum((long) info->st_uid,(short)8); 204 writenum((long) info->st_uid,(short)8);
203 fputs(" ", stdout); 205 fputs(" ", stdout);
@@ -208,20 +210,21 @@ static void list_single(const char *name, struct stat *info, const char *fullnam
208 writenum((long) info->st_uid,(short)8); 210 writenum((long) info->st_uid,(short)8);
209 fputs(" ", stdout); 211 fputs(" ", stdout);
210 } 212 }
211 tab(16);
212#ifdef BB_FEATURE_LS_USERNAME 213#ifdef BB_FEATURE_LS_USERNAME
213 if (!(opts & DISP_NUMERIC)) { 214 if (!(opts & DISP_NUMERIC)) {
214 scratch[0]='\0'; 215 memset ( scratch, 0, sizeof (scratch));
215 my_getgrgid( scratch, info->st_gid); 216 my_getgrgid( scratch, info->st_gid);
216 scratch[8]='\0'; 217 if (*scratch) {
217 if (*scratch) 218 fputs(scratch, stdout);
218 wr(scratch,8); 219 if ( strlen( scratch) <= 8 )
220 wr(" ", 8-strlen( scratch));
221 }
219 else 222 else
220 writenum((long) info->st_gid,(short)8); 223 writenum((long) info->st_gid,(short)8);
221 } else 224 } else
222#endif 225#endif
223 writenum((long) info->st_gid,(short)8); 226 writenum((long) info->st_gid,(short)8);
224 tab(17); 227 //tab(26);
225 if (S_ISBLK(mode) || S_ISCHR(mode)) { 228 if (S_ISBLK(mode) || S_ISCHR(mode)) {
226 writenum((long)MAJOR(info->st_rdev),(short)3); 229 writenum((long)MAJOR(info->st_rdev),(short)3);
227 fputs(", ", stdout); 230 fputs(", ", stdout);
@@ -230,6 +233,7 @@ static void list_single(const char *name, struct stat *info, const char *fullnam
230 else 233 else
231 writenum((long)info->st_size,(short)8); 234 writenum((long)info->st_size,(short)8);
232 fputs(" ", stdout); 235 fputs(" ", stdout);
236 //tab(32);
233#ifdef BB_FEATURE_LS_TIMESTAMPS 237#ifdef BB_FEATURE_LS_TIMESTAMPS
234 { 238 {
235 time_t cal; 239 time_t cal;