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>
This commit is contained in:
Denys Vlasenko
2017-01-25 04:52:45 +01:00
parent 8a2657cbf5
commit b13b618335
2 changed files with 11 additions and 11 deletions

View File

@@ -1045,7 +1045,7 @@ static void scan_and_display_dirs_recur(struct dnode **dn, int first)
int ls_main(int argc UNUSED_PARAM, char **argv)
{
{ /* ^^^^^^^^^^^^^^^^^ note: if FTPD, argc can be wrong, see ftpd.c */
struct dnode **dnd;
struct dnode **dnf;
struct dnode **dnp;
@@ -1175,6 +1175,11 @@ int ls_main(int argc UNUSED_PARAM, char **argv)
if (!(option_mask32 & (OPT_l|OPT_1|OPT_x|OPT_C)))
option_mask32 |= (isatty(STDOUT_FILENO) ? OPT_C : OPT_1);
if (ENABLE_FTPD && applet_name[0] == 'f') {
/* ftpd secret backdoor. dirs first are much nicer */
option_mask32 |= OPT_dirs_first;
}
argv += optind;
if (!argv[0])
*--argv = (char*)".";