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:
@@ -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*)".";
|
||||
|
||||
Reference in New Issue
Block a user