diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2017-01-25 04:52:45 +0100 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2017-01-25 04:52:45 +0100 |
commit | b13b6183354e6c9d031951fa4f11bcb9b38ae251 (patch) | |
tree | 382cb2426c2ee38e41ec350ed62a0e1b842e0fcd /coreutils | |
parent | 8a2657cbf5fe005914cf58836d2599e65e6c3e34 (diff) | |
download | busybox-w32-b13b6183354e6c9d031951fa4f11bcb9b38ae251.tar.gz busybox-w32-b13b6183354e6c9d031951fa4f11bcb9b38ae251.tar.bz2 busybox-w32-b13b6183354e6c9d031951fa4f11bcb9b38ae251.zip |
ftpd/ls: show directories first
Old TODO finally done
function old new delta
ls_main 548 568 +20
packed_usage 31116 31097 -19
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'coreutils')
-rw-r--r-- | coreutils/ls.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/coreutils/ls.c b/coreutils/ls.c index a858a3217..6e0a52d75 100644 --- a/coreutils/ls.c +++ b/coreutils/ls.c | |||
@@ -1045,7 +1045,7 @@ static void scan_and_display_dirs_recur(struct dnode **dn, int first) | |||
1045 | 1045 | ||
1046 | 1046 | ||
1047 | int ls_main(int argc UNUSED_PARAM, char **argv) | 1047 | int ls_main(int argc UNUSED_PARAM, char **argv) |
1048 | { | 1048 | { /* ^^^^^^^^^^^^^^^^^ note: if FTPD, argc can be wrong, see ftpd.c */ |
1049 | struct dnode **dnd; | 1049 | struct dnode **dnd; |
1050 | struct dnode **dnf; | 1050 | struct dnode **dnf; |
1051 | struct dnode **dnp; | 1051 | struct dnode **dnp; |
@@ -1175,6 +1175,11 @@ int ls_main(int argc UNUSED_PARAM, char **argv) | |||
1175 | if (!(option_mask32 & (OPT_l|OPT_1|OPT_x|OPT_C))) | 1175 | if (!(option_mask32 & (OPT_l|OPT_1|OPT_x|OPT_C))) |
1176 | option_mask32 |= (isatty(STDOUT_FILENO) ? OPT_C : OPT_1); | 1176 | option_mask32 |= (isatty(STDOUT_FILENO) ? OPT_C : OPT_1); |
1177 | 1177 | ||
1178 | if (ENABLE_FTPD && applet_name[0] == 'f') { | ||
1179 | /* ftpd secret backdoor. dirs first are much nicer */ | ||
1180 | option_mask32 |= OPT_dirs_first; | ||
1181 | } | ||
1182 | |||
1178 | argv += optind; | 1183 | argv += optind; |
1179 | if (!argv[0]) | 1184 | if (!argv[0]) |
1180 | *--argv = (char*)"."; | 1185 | *--argv = (char*)"."; |