diff options
author | Rob Landley <rob@landley.net> | 2006-06-20 17:43:01 +0000 |
---|---|---|
committer | Rob Landley <rob@landley.net> | 2006-06-20 17:43:01 +0000 |
commit | 2b8a05a77533419b098a990f065a879553de5fe0 (patch) | |
tree | 635dc93791dccdd92ca17f208a9f608933f1de4a | |
parent | 8437ede6c2ada03f48709e81e43a8195146b420e (diff) | |
download | busybox-w32-2b8a05a77533419b098a990f065a879553de5fe0.tar.gz busybox-w32-2b8a05a77533419b098a990f065a879553de5fe0.tar.bz2 busybox-w32-2b8a05a77533419b098a990f065a879553de5fe0.zip |
I broke allbareconfig with half-finished cleanups I'd forgotten weren't done.
Got both to a decent stopping point. (There's a lot more cleanup to do on ls.c
but now is not the time...)
-rw-r--r-- | coreutils/ls.c | 41 | ||||
-rw-r--r-- | libpwdgrp/pwd_grp.c | 4 |
2 files changed, 19 insertions, 26 deletions
diff --git a/coreutils/ls.c b/coreutils/ls.c index 4a20b3396..de8405dab 100644 --- a/coreutils/ls.c +++ b/coreutils/ls.c | |||
@@ -101,14 +101,10 @@ enum { | |||
101 | 101 | ||
102 | #define SORT_MASK (7U<<28) | 102 | #define SORT_MASK (7U<<28) |
103 | 103 | ||
104 | #ifdef CONFIG_FEATURE_LS_TIMESTAMPS | ||
105 | /* which of the three times will be used */ | 104 | /* which of the three times will be used */ |
106 | #define TIME_MOD 0 | 105 | #define TIME_CHANGE ((1U<<23) * ENABLE_FEATURE_LS_TIMESTAMPS) |
107 | #define TIME_CHANGE (1U<<23) | 106 | #define TIME_ACCESS ((1U<<24) * ENABLE_FEATURE_LS_TIMESTAMPS) |
108 | #define TIME_ACCESS (1U<<24) | 107 | #define TIME_MASK ((3U<<23) * ENABLE_FEATURE_LS_TIMESTAMPS) |
109 | |||
110 | #define TIME_MASK (3U<<23) | ||
111 | #endif | ||
112 | 108 | ||
113 | #ifdef CONFIG_FEATURE_LS_FOLLOWLINKS | 109 | #ifdef CONFIG_FEATURE_LS_FOLLOWLINKS |
114 | #define FOLLOW_LINKS (1U<<25) | 110 | #define FOLLOW_LINKS (1U<<25) |
@@ -507,19 +503,21 @@ static void showdirs(struct dnode **dn, int ndirs, int first) | |||
507 | /* list all files at this level */ | 503 | /* list all files at this level */ |
508 | if (ENABLE_FEATURE_LS_SORTFILES) dnsort(subdnp, nfiles); | 504 | if (ENABLE_FEATURE_LS_SORTFILES) dnsort(subdnp, nfiles); |
509 | showfiles(subdnp, nfiles); | 505 | showfiles(subdnp, nfiles); |
510 | #ifdef CONFIG_FEATURE_LS_RECURSIVE | 506 | if (ENABLE_FEATURE_LS_RECURSIVE) { |
511 | if (all_fmt & DISP_RECURSIVE) { | 507 | if (all_fmt & DISP_RECURSIVE) { |
512 | /* recursive- list the sub-dirs */ | 508 | /* recursive- list the sub-dirs */ |
513 | dnd = splitdnarray(subdnp, nfiles, SPLIT_SUBDIR); | 509 | dnd = splitdnarray(subdnp, nfiles, SPLIT_SUBDIR); |
514 | dndirs = countsubdirs(subdnp, nfiles); | 510 | dndirs = countsubdirs(subdnp, nfiles); |
515 | if (dndirs > 0) { | 511 | if (dndirs > 0) { |
516 | if (ENABLE_FEATURE_LS_SORTFILES) dnsort(dnd, dndirs); | 512 | if (ENABLE_FEATURE_LS_SORTFILES) dnsort(dnd, dndirs); |
517 | showdirs(dnd, dndirs, 0); | 513 | showdirs(dnd, dndirs, 0); |
518 | free(dnd); /* free the array of dnode pointers to the dirs */ | 514 | /* free the array of dnode pointers to the dirs */ |
515 | free(dnd); | ||
516 | } | ||
519 | } | 517 | } |
518 | /* free the dnodes and the fullname mem */ | ||
519 | dfree(subdnp, nfiles); | ||
520 | } | 520 | } |
521 | dfree(subdnp, nfiles); /* free the dnodes and the fullname mem */ | ||
522 | #endif | ||
523 | } | 521 | } |
524 | } | 522 | } |
525 | } | 523 | } |
@@ -825,7 +823,6 @@ static const char ls_options[]="Cadil1gnsxAk" \ | |||
825 | #define STYLE_MASK_TRIGGER STYLE_MASK | 823 | #define STYLE_MASK_TRIGGER STYLE_MASK |
826 | #define SORT_MASK_TRIGGER SORT_MASK | 824 | #define SORT_MASK_TRIGGER SORT_MASK |
827 | #define DISP_MASK_TRIGGER DISP_ROWS | 825 | #define DISP_MASK_TRIGGER DISP_ROWS |
828 | #define TIME_MASK_TRIGGER TIME_MASK | ||
829 | 826 | ||
830 | static const unsigned opt_flags[] = { | 827 | static const unsigned opt_flags[] = { |
831 | LIST_SHORT | STYLE_COLUMNS, /* C */ | 828 | LIST_SHORT | STYLE_COLUMNS, /* C */ |
@@ -904,7 +901,7 @@ int ls_main(int argc, char **argv) | |||
904 | char *color_opt; | 901 | char *color_opt; |
905 | #endif | 902 | #endif |
906 | 903 | ||
907 | all_fmt = LIST_SHORT | (ENABLE_FEATURE_LS_TIMESTAMPS * TIME_MOD) | | 904 | all_fmt = LIST_SHORT | |
908 | (ENABLE_FEATURE_LS_SORTFILES * (SORT_NAME | SORT_ORDER_FORWARD)); | 905 | (ENABLE_FEATURE_LS_SORTFILES * (SORT_NAME | SORT_ORDER_FORWARD)); |
909 | 906 | ||
910 | #ifdef CONFIG_FEATURE_AUTOWIDTH | 907 | #ifdef CONFIG_FEATURE_AUTOWIDTH |
@@ -954,11 +951,9 @@ int ls_main(int argc, char **argv) | |||
954 | if (flags & DISP_MASK_TRIGGER) { | 951 | if (flags & DISP_MASK_TRIGGER) { |
955 | all_fmt &= ~DISP_MASK; | 952 | all_fmt &= ~DISP_MASK; |
956 | } | 953 | } |
957 | #ifdef CONFIG_FEATURE_LS_TIMESTAMPS | 954 | if (flags & TIME_MASK) { |
958 | if (flags & TIME_MASK_TRIGGER) { | ||
959 | all_fmt &= ~TIME_MASK; | 955 | all_fmt &= ~TIME_MASK; |
960 | } | 956 | } |
961 | #endif | ||
962 | if (flags & LIST_CONTEXT) { | 957 | if (flags & LIST_CONTEXT) { |
963 | all_fmt |= STYLE_SINGLE; | 958 | all_fmt |= STYLE_SINGLE; |
964 | } | 959 | } |
diff --git a/libpwdgrp/pwd_grp.c b/libpwdgrp/pwd_grp.c index 98ecf40a3..05b83d66d 100644 --- a/libpwdgrp/pwd_grp.c +++ b/libpwdgrp/pwd_grp.c | |||
@@ -28,9 +28,7 @@ | |||
28 | #include <assert.h> | 28 | #include <assert.h> |
29 | #include <ctype.h> | 29 | #include <ctype.h> |
30 | 30 | ||
31 | //#include "pwd_.h" | 31 | #include "shadow_.h" |
32 | //#include "grp_.h" | ||
33 | //#include "shadow_.h" | ||
34 | 32 | ||
35 | #ifndef _PATH_SHADOW | 33 | #ifndef _PATH_SHADOW |
36 | #define _PATH_SHADOW "/etc/shadow" | 34 | #define _PATH_SHADOW "/etc/shadow" |