aboutsummaryrefslogtreecommitdiff
path: root/coreutils/ls.c
AgeCommit message (Collapse)Author
2017-05-26ls: fix support for long options when FEATURE_LS_COLOR is deselectedLaurent Bercot
Declaration of ls_longopts and initialization of applet_long_options were incorrectly guarded with ENABLE_FEATURE_LS_COLOR; that yielded a "ls: NO_OPT: \xff" error message when long options were selected and color support was not. This patch ensures long options are initialized separately from color support. Signed-off-by: Laurent Bercot <ska-dietlibc@skarnet.org> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2017-01-25ftpd/ls: show directories firstDenys Vlasenko
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>
2017-01-23ls: convert DISP_DIRNAME to a bool variableDenys Vlasenko
function old new delta ls_main 553 548 -5 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2017-01-23ls: get rid of opt_flags[], handle -l1c through option_mask32Denys Vlasenko
function old new delta display_single 885 888 +3 scan_and_display_dirs_recur 496 486 -10 opt_flags 11 - -11 ls_main 618 553 -65 ------------------------------------------------------------------------------ (add/remove: 0/1 grow/shrink: 1/2 up/down: 3/-86) Total: -83 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2017-01-23ls: handle -x through option_mask32, remove default -C from --helpDenys Vlasenko
function old new delta packed_usage 31024 31002 -22 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2017-01-23ls: handle -d and -R through option_mask32Denys Vlasenko
function old new delta scan_and_display_dirs_recur 545 550 +5 display_single 1039 1044 +5 append_char 67 68 +1 display_files 399 396 -3 ls_main 736 717 -19 opt_flags 68 11 -57 .rodata 168864 168784 -80 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 3/4 up/down: 11/-159) Total: -148 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2017-01-23ls: handle -p and -F through option_mask32Denys Vlasenko
function old new delta display_single 1039 1044 +5 append_char 67 68 +1 display_files 399 396 -3 scan_and_display_dirs_recur 545 541 -4 ls_main 736 722 -14 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 2/3 up/down: 6/-21) Total: -15 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2017-01-23ls: LIST_ID_NAME/ID_NUMERIC/LOPT/LONG are the same, merge as LONGDenys Vlasenko
Also, handle -n and --full-time using option_mask32 function old new delta scan_and_display_dirs_recur 548 545 -3 display_single 1053 1039 -14 ls_main 777 736 -41 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 0/3 up/down: 0/-58) Total: -58 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2017-01-23ls: make -Z output compatible with GNU coreutils 8.25Denys Vlasenko
This also makes it clear that LIST_MODEBITS == LIST_LOPT function old new delta ls_main 752 777 +25 display_files 400 399 -1 display_single 1055 1053 -2 my_stat 320 317 -3 packed_usage 32311 32280 -31 .rodata 168895 168864 -31 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 1/5 up/down: 25/-68) Total: -43 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2017-01-23ls: LIST_NLINKS/SIZE/DATE_TIME/SYMLINK are always the same, merge as LIST_LOPTDenys Vlasenko
They are always set and cleared together function old new delta append_char 69 68 -1 display_single 910 908 -2 ls_main 677 664 -13 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 0/3 up/down: 0/-16) Total: -16 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2017-01-23ls: handle -s through option_mask32Denys Vlasenko
function old new delta scan_and_display_dirs_recur 493 494 +1 sort_and_display_files 424 423 -1 ls_main 682 677 -5 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2017-01-23ls: handle -i through option_mask32Denys Vlasenko
function old new delta sort_and_display_files 420 424 +4 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2017-01-23ls: handle -a and -A through option_mask32Denys Vlasenko
function old new delta ls_main 685 682 -3 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2017-01-23ls: handle all sort options through option_mask32Denys Vlasenko
function old new delta packed_usage 31007 31024 +17 my_stat 318 324 +6 sort_and_display_files 419 420 +1 print_name 216 217 +1 sortcmp 228 216 -12 opt_flags 96 64 -32 ls_main 732 685 -47 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 4/3 up/down: 25/-91) Total: -66 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2017-01-22ls: -1 should be ignored by -l (and options which imply -l)Denys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2017-01-22ls: more correct handling of -c, -uDenys Vlasenko
function old new delta my_stat 302 318 +16 packed_usage 30977 30969 -8 display_single 928 910 -18 sortcmp 258 228 -30 ls_main 776 732 -44 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 1/4 up/down: 16/-100) Total: -84 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2017-01-22ls: replace -e with --full-time, add --group-directories-first, delete -KDenys Vlasenko
-K and -e were non-standard function old new delta static.ls_longopts 9 47 +38 ls_main 748 776 +28 display_single 901 928 +27 sortcmp 254 258 +4 ls_options 32 31 -1 opt_flags 100 96 -4 packed_usage 31032 30977 -55 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 4/3 up/down: 97/-60) Total: 37 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2017-01-11Move FEATURE_AUTOWIDTH config option to two applets which use itDenys Vlasenko
No code changes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2017-01-10Big cleanup in config help and descriptionDenys Vlasenko
Redundant help texts (one which only repeats the description) are deleted. Descriptions and help texts are trimmed. Some config options are moved, even across menus. No config option _names_ are changed. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2016-11-23Convert all coreutils/* applets to "new style" applet definitionsDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2016-04-21*: add most of the required setup_common_bufsiz() callsDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2016-04-21libbb: make bb_common_bufsiz1 1 kbyte, add capability to use bss tail for itDenys Vlasenko
The config item is FEATURE_USE_BSS_TAIL. When it is off (default): function old new delta read_config 210 228 +18 doCommands 2279 2294 +15 ipneigh_list_or_flush 763 772 +9 ipaddr_list_or_flush 1256 1261 +5 display_process_list 1301 1306 +5 conspy_main 1378 1383 +5 do_lzo_compress 352 355 +3 do_lzo_decompress 565 567 +2 push 46 44 -2 inetd_main 2136 2134 -2 uevent_main 421 418 -3 addLines 97 92 -5 bb_common_bufsiz1 8193 1024 -7169 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 8/5 up/down: 62/-7181) Total: -7119 bytes text data bss dec hex filename 829850 4086 9080 843016 cdd08 busybox_old 829901 4086 1904 835891 cc133 busybox_unstripped FEATURE_USE_BSS_TAIL=y: read_config 210 228 +18 doCommands 2279 2294 +15 ipneigh_list_or_flush 763 772 +9 ipaddr_list_or_flush 1256 1261 +5 display_process_list 1301 1306 +5 conspy_main 1378 1383 +5 do_lzo_compress 352 355 +3 do_lzo_decompress 565 567 +2 inetd_main 2136 2134 -2 bb_common_bufsiz1 8193 - -8193 ------------------------------------------------------------------------------ (add/remove: 0/1 grow/shrink: 8/1 up/down: 62/-8195) Total: -8133 bytes text data bss dec hex filename 829850 4086 9080 843016 cdd08 busybox_old 829911 4086 880 834877 cbd3d busybox_unstripped FIXME: setup_common_bufsiz() calls are missing. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2016-03-06ls: fix columnar output. Closes 8731Denys Vlasenko
In coreutils/ls.c, 1.19 introduced commit 2f7d9e8903029b1b5e51a15f9cb0dcb6ca17c3ac, removing the variable tabstops and hard coding the column separation to 2 characters, but was not done correctly. The column_width assumes a gap of 1 character, so the computed number of columns exceeds the terminal width when many small files are encountered. A minor problem but surprisingly annoying. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2015-10-23libbb: factor out code which queries screen widthDenys Vlasenko
function old new delta get_terminal_width - 17 +17 stty_main 1196 1197 +1 pstree_main 321 319 -2 ls_main 735 731 -4 watch_main 232 225 -7 bb_progress_update 714 706 -8 ps_main 555 543 -12 run_applet_and_exit 708 695 -13 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 1/6 up/down: 18/-46) Total: -28 byte Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2015-02-23ls: heed compiler warningDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2015-02-18ls: trivial code shrinkDenys Vlasenko
function old new delta display_single 914 893 -21 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2015-02-16ls: fix year 9999 bug :)Denys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-02-27ls: make "ls -s DIR" show total too. Clases 4946Denys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2013-01-14whitespace fixes. no code changesDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-08-10randomconfig fixesDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-06-21ls: fix HAVE_STRVERSCMP check; add check for older uclibc versionsDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-06-21Add HAVE_STRVERSCMP, guard the only usage of strverscmp with #ifdefDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-06-13ls: fix comment about -p (it's compatible now)Denys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-06-13ls: make -v and -X actually work as intendedDenys Vlasenko
function old new delta strverscmp - 236 +236 sortcmp 186 254 +68 static.result_type - 60 +60 static.next_state 12 16 +4 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-06-05*: remove "Options:" string from help textsDenys Vlasenko
function old new delta packed_usage 28706 28623 -83 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-05-13ls: code shrinkDenys Vlasenko
function old new delta sort_and_display_files - 427 +427 scan_and_display_dirs_recur 497 488 -9 ls_main 765 735 -30 display_files 422 - -422 ------------------------------------------------------------------------------ (add/remove: 1/1 grow/shrink: 0/2 up/down: 427/-461) Total: -34 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-05-13ls: reorder and rename functions. No code changesDenys Vlasenko
function old new delta display_single - 931 +931 scan_and_display_dirs_recur - 497 +497 display_files - 422 +422 showfiles 422 - -422 showdirs 497 - -497 list_single 931 - -931 ------------------------------------------------------------------------------ (add/remove: 3/3 grow/shrink: 0/0 up/down: 1850/-1850) Total: 0 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-05-13ls: reduce memory consumption and speed up (don't do redundant [l]stat)Denys Vlasenko
function old new delta my_stat 110 278 +168 splitdnarray 120 118 -2 ls_main 769 765 -4 list_single 961 931 -30 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 1/3 up/down: 168/-36) Total: 132 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-05-13ls: avoid forward declaration. No code changesDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-05-13ls: code shrinkDenys Vlasenko
function old new delta list_single 990 961 -29 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-05-12ls: fix help text: -w N is optionalDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-05-12ls: fix -p help text, improve comments and define namesDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-04-03ls: better help text for -a and -ADenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-03-12ls: fix handling of symlinks by option -1Denys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-03-01ls: widen -s (1k blocks) column from 4 to 6Denys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-02-28ls: -g implies -lDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-02-28ls: fix bits for -T, -w and --color; make -n imply -l; fix commentsDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-02-27ls: fix one-bit-off which caused -H to behave as -hDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-12-20ls: remove redundant constants LIST_FILENAME and LIST_SHORTJames Youngman
LIST_FILENAME is always true and LIST_SHORT affects nothing. Signed-off-by: James Youngman <jay@gnu.org> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-12-19ls: add support for -HDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>