aboutsummaryrefslogtreecommitdiff
path: root/libbb (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
| * libbb/sha1: shrink and speed up fully unrolled versionDenys Vlasenko2021-12-312-1/+23
| | | | | | | | | | | | | | function old new delta sha1_process_block64 4149 3950 -199 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * libbb/sha1: add config-selectable partially unrolled versionDenys Vlasenko2021-12-302-5/+98
| | | | | | | | | | | | | | | | | | | | function old new delta sha1_process_block64 364 732 +368 static.rconsts 16 - -16 ------------------------------------------------------------------------------ (add/remove: 0/1 grow/shrink: 1/0 up/down: 368/-16) Total: 352 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * libbb/sha1: add config-selectable fully unrolled version, closes 14391Denys Vlasenko2021-12-302-14/+95
| | | | | | | | | | | | | | | | | | | | function old new delta sha1_process_block64 364 4167 +3803 static.rconsts 16 - -16 ------------------------------------------------------------------------------ (add/remove: 0/1 grow/shrink: 1/0 up/down: 3803/-16) Total: 3787 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * libbb: cose shrink in sha1Denys Vlasenko2021-12-281-5/+2
| | | | | | | | | | | | | | function old new delta sha1_process_block64 356 342 -14 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Merge busybox into mergeRon Yorston2021-12-272-16/+15
|\| | | | | | | Fix merge conflict in coreutils/timeout.c.
| * libbb: code shrink in des encryption, in setup_salt()Denys Vlasenko2021-11-281-15/+14
| | | | | | | | | | | | | | | | | | | | | | function old new delta pw_encrypt 978 971 -7 .rodata 108208 108192 -16 des_crypt 1211 1181 -30 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 0/3 up/down: 0/-53) Total: -53 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | realpath: improved support for Windows pathsRon Yorston2021-10-132-7/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Upstream commit 94eb1c4dc (libbb: better coreutils compatibility for realpath) made some changes to xmalloc_realpath_coreutils(). This now needs to be updated to handle Windows paths. - Expose the macro is_unc_path() and part of the recent change to bb_get_last_path_component_nostrip() as a separate funtion, get_last_slash(); - Convert a couple of errors relating to network filesystems to ENOENT; - Adjust xmalloc_realpath_coreutils() to handle Windows directory separators, relative paths and UNC paths.
* | Merge branch 'busybox' into mergeRon Yorston2021-10-138-202/+210
|\|
| * config system: move some options closer to relevalnt tool subdirectoriesDenys Vlasenko2021-10-121-124/+61
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * shell: do not read user database for every prompt - only for those which need itDenys Vlasenko2021-10-111-27/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | function old new delta get_user_strings - 52 +52 get_homedir_or_NULL - 23 +23 parse_and_put_prompt 823 838 +15 null_str 1 - -1 complete_cmd_dir_file 814 812 -2 deinit_S 51 42 -9 read_line_input 3059 3015 -44 ------------------------------------------------------------------------------ (add/remove: 2/1 grow/shrink: 1/3 up/down: 90/-56) Total: 34 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * shell: fix script's comm field if ENABLE_FEATURE_PREFER_APPLETS=yDenys Vlasenko2021-10-112-2/+24
| | | | | | | | | | | | | | | | | | | | function old new delta re_execed_comm - 46 +46 main 72 86 +14 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 1/0 up/down: 60/0) Total: 60 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * *: add NOINLINEs where code noticeably shrinksDenys Vlasenko2021-10-101-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | function old new delta display 85 1463 +1378 -73 bytes select_and_cluster - 1088 +1088 -139 bytes parse_reply - 979 +979 -109 bytes zbc_num_sqrt - 632 +632 -191 bytes show_bridge_port - 585 +585 -56 bytes sp_256_proj_point_add_8 - 576 +576 -45 bytes encode_then_append_var_plusminus - 554 +554 -118 bytes read_mode_db - 537 +537 -47 bytes fbset_main 1331 747 -584 sp_256_ecc_mulmod_8 1157 536 -621 brctl_main 2189 1548 -641 expand_one_var 2544 1872 -672 zxc_vm_process 6412 5589 -823 send_queries 1813 725 -1088 recv_and_process_peer_pkt 2245 1018 -1227 bb_dump_dump 1531 80 -1451 ------------------------------------------------------------------------------ (add/remove: 7/0 grow/shrink: 1/8 up/down: 6329/-7107) Total: -778 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * Make const ptr assign as function call in clangYU Jincheng2021-10-094-2/+19
| | | | | | | | | | | | | | | | - This can act as memory barrier in clang to avoid read before assign of a const ptr Signed-off-by: LoveSy <shana@zju.edu.cn> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * libbb: better coreutils compatibility for realpathRon Yorston2021-10-091-30/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add some tests which coreutils realpath pass but BusyBox realpath fails (bar one). Adjust xmalloc_realpath_coreutils() so the tests pass: - Expand symbolic links before testing whether the last path component exists. - When the link target is a relative path canonicalize it by passing it through xmalloc_realpath_coreutils() as already happens for absolute paths. - Ignore trailing slashes when finding the last path component and correctly handle the case where the only slash is at the start of the path. This requires ignoring superfluous leading slashes. - Undo all changes to the path so error messages from the caller show the original filename. function old new delta xmalloc_realpath_coreutils 214 313 +99 Signed-off-by: Ron Yorston <rmy@pobox.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * *: generalize "const trick"YU Jincheng2021-10-072-5/+3
| | | | | | | | | | | | | | | | While at it, change all "__asm__" to "asm" Co-authored-by: canyie <31466456+canyie@users.noreply.github.com> Signed-off-by: YU Jincheng <shana@zju.edu.cn> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * libbb: code shrink in main() and scripted_main()Denys Vlasenko2021-09-281-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | function old new delta main 68 65 -3 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 0/1 up/down: 0/-3) Total: -3 bytes text data bss dec hex filename 1472 560 16 2048 800 busybox_old 1398 552 16 1966 7ae busybox_unstripped Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * libbb/lineedit: tweak #if indenting, no code changesDenys Vlasenko2021-09-251-8/+8
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | win32: fix bb_get_last_path_component_nostrip()Ron Yorston2021-10-131-5/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Finding the last component of a path didn't properly handle a mixture of slashes and backslashes, paths relative to another drive or bare UNC paths. The following were incorrect: $ basename /dir\\file dir\file $ basename c:file c:file $ basename //HOST/share share With this patch the results are now: $ basename /dir\\file file $ basename c:file file $ basename //HOST/share //HOST/share
* | win32: rename is_absolute_path()Ron Yorston2021-10-121-1/+1
| | | | | | | | | | As the comment pointed out is_absolute_path() was misnamed. Rename it to is_relative_path() and change the sense of all tests.
* | Merge branch 'busybox' into mergeRon Yorston2021-09-214-39/+34
|\|
| * libbb: code shrink parse_datestr (again)Ron Yorston2021-09-181-14/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit 9fe1548bb (date,touch: allow timezone offsets in dates) mentioned the similarity between '@' format dates and those with timezone offsets. It didn't notice that as a result there's common code which can be shared. function old new delta parse_datestr 730 687 -43 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 0/1 up/down: 0/-43) Total: -43 bytes Signed-off-by: Ron Yorston <rmy@pobox.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * libbb/lineedit: do not escape %^=+}]:, escape ~? in tab completionDenys Vlasenko2021-09-171-1/+10
| | | | | | | | | | | | | | function old new delta .rodata 104185 104180 -5 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * libbb: clarify what bb_mode_string() generatesDenys Vlasenko2021-09-171-11/+9
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * libbb: ensure mode_string is NUL terminatedRon Yorston2021-09-171-9/+3
| | | | | | | | | | | | | | | | | | | | | | If the mode_string array is no longer static we can't rely on it being NUL terminated. function old new delta bb_mode_string 115 118 +3 Signed-off-by: Ron Yorston <rmy@pobox.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * libbb: eliminate a static data array in bb_mode_string()Denys Vlasenko2021-09-171-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | function old new delta print_stat 861 869 +8 header_verbose_list_ar 73 77 +4 display_single 975 979 +4 header_verbose_list 237 239 +2 bb_mode_string 124 115 -9 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 4/1 up/down: 18/-9) Total: 9 bytes text data bss dec hex filename 1043136 559 5052 1048747 1000ab busybox_old 1043153 559 5020 1048732 10009c busybox_unstripped Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * libbb: code shrink bb_parse_modeDenys Vlasenko2021-09-171-2/+3
| | | | | | | | | | | | | | | | | | | | | | function old new delta bb_parse_mode 393 398 +5 static.who_mask 16 8 -8 static.perm_mask 24 12 -12 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 1/2 up/down: 5/-20) Total: -15 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | win32: changes to allow timezones in datesRon Yorston2021-09-171-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Create mingw_strptime() to return timezone offset as a separate argument (since Microsoft's struct tm doesn't have the required member). Import timegm() from musl. Update parse_datestr() to use mingw_strptime(). Enable FEATURE_TIMEZONE in the default configuration. GitHub issue #230.
* | Merge branch 'busybox' into mergeRon Yorston2021-09-172-13/+76
|\| | | | | | | Disable FEATURE_TIMEZONE for now.
| * date,touch: allow timezone offsets in datesRon Yorston2021-09-172-4/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Allow ISO 8601 style dates to include a timezone offset. Like the '@' format these dates aren't relative to the user's current timezone and shouldn't be subject to DST adjustment. - The implementation uses the strptime() '%z' format specifier. This an extension which may not be available so the use of timezones is a configuration option. - The 'touch' applet has been updated to respect whether DST adjustment is required, matching 'date'. function old new delta parse_datestr 624 730 +106 static.fmt_str 106 136 +30 touch_main 388 392 +4 date_main 818 819 +1 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 4/0 up/down: 141/0) Total: 141 bytes Signed-off-by: Ron Yorston <rmy@pobox.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * libbb: code shrink parse_datestrRon Yorston2021-09-151-11/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The default build uses strptime() in parse_datestr() to support the 'month_name d HH:MM:SS YYYY' format of GNU date. If we've linked with strptime() there's an advantage is using it for other formats too. There's no change to the non-default, non-DESKTOP build. function old new delta fmt_str - 106 +106 .rodata 99216 99145 -71 parse_datestr 948 624 -324 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 0/2 up/down: 106/-395) Total: -289 bytes Signed-off-by: Ron Yorston <rmy@pobox.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Merge branch 'busybox' into mergeRon Yorston2021-09-101-15/+7
|\|
| * libbb: reuse "bad port" error message stringDenys Vlasenko2021-09-101-1/+1
| | | | | | | | | | | | | | function old new delta .rodata 104251 104232 -19 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * libbb: make bb_lookup_port() abort on bad port namesDenys Vlasenko2021-09-091-14/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | Also, no need to preserve errno function old new delta .rodata 104247 104241 -6 bb_lookup_port 97 83 -14 nc_main 1039 1018 -21 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 0/3 up/down: 0/-41) Total: -41 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * busybox: fix "busybox --help busybox" not showing correct textDenys Vlasenko2021-08-161-1/+5
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | libbb: code shrink u_signal_names.cRon Yorston2021-09-031-1/+10
| | | | | | | | | | | | Reduce amount of wasted space in the signals[][] array. Saves 48 bytes.
* | busybox: bring help handling into line with upstreamRon Yorston2021-08-161-5/+5
| | | | | | | | | | Upstream has fixed a problem with 'busybox --help' so it's possible to remove another gratuitous divergence.
* | find_mount_point: code shrinkRon Yorston2021-08-121-8/+2
| | | | | | | | | | | | | | Use xrealloc_getcwd_or_warn() instead of a hand-rolled WIN32 equivalent. Saves 84 bytes.
* | win32: better handling of nested symlinksRon Yorston2021-08-121-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Our realpath(3) implementation uses xmalloc_follow_symlinks() to expand symlinks. This detects when symlinks are too deeply nested but didn't set errno, so anything calling realpath(3) was unable to say what had gone wrong. (For example, 'ls -L' or 'stat -L'.) Set errno to ELOOP. This then leads to the problem that Windows doesn't know about ELOOP so reports 'Unknown error'. Add a replacement for strerror(3) which returns a sensible message. Costs 96 bytes.
* | win32: more efficient tests for executablesRon Yorston2021-07-262-4/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | file_is_executable() calls access(2) and stat(2); in this case our WIN32 implementation also calls stat(2). Avoid this unnecessary duplication by copying the required test from the WIN32 access(2). In find_executable() it's possible to avoid calling file_is_executable() if add_win32_extension() returns TRUE as the latter will already have verified that the file is executable. Replace a call to file_is_executable() in the tab completion code with the equivalent tests, avoiding (up to) two calls to stat(2). These changes don't affect the size of the binary and should be faster.
* | ash, libbb: don't affect POSIX buildRon Yorston2021-07-131-1/+2
| | | | | | | | | | Tweak code to avoid contamination of the POSIX build. There weren't any adverse effects, but better safe than sorry.
* | Merge branch 'busybox' into mergeRon Yorston2021-06-284-25/+52
|\|
| * libbb: do not check closedir() in remove_file()Denys Vlasenko2021-06-241-5/+1
| | | | | | | | | | | | | | | | | | | | | | | | If it's needed, there has to be a comment why. There isn't. function old new delta .rodata 103686 103669 -17 remove_file 598 571 -27 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 0/2 up/down: 0/-44) Total: -44 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * move iterate_on_dir() from e2fsprogs to libbbDenys Vlasenko2021-06-241-0/+28
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * cp: implement -nDenys Vlasenko2021-06-221-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | function old new delta .rodata 103681 103722 +41 packed_usage 33698 33717 +19 copy_file 1678 1696 +18 cp_main 500 492 -8 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 3/1 up/down: 78/-8) Total: 70 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * xxd: implement -i "C style output"Denys Vlasenko2021-06-181-15/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | function old new delta xxd_main 710 888 +178 .rodata 103252 103331 +79 print_C_style - 78 +78 packed_usage 33639 33652 +13 next 276 278 +2 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 4/0 up/down: 350/0) Total: 350 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * xxd: do not try reading from closed stdin when non-existent file is givenDenys Vlasenko2021-06-181-0/+1
| | | | | | | | | | | | | | | | | | | | | | Was: xxd: FILE: No such file or directory xxd: FILE: Bad file descriptor function old new delta next 276 278 +2 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * xxd: implement -o DISPLAYOFFSETDenys Vlasenko2021-06-171-5/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | function old new delta xxd_main 680 710 +30 xstrtoll - 30 +30 bb_dump_dump 1511 1531 +20 rewrite 941 951 +10 packed_usage 33629 33639 +10 .rodata 103250 103252 +2 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 5/0 up/down: 102/0) Total: 102 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * hexdump: fix error messageDenys Vlasenko2021-06-171-1/+1
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | win32: changes to mntent implementationRon Yorston2021-06-271-15/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make the structure returned by getmntent(3) static so it persists after endmntent(3) closes the stream. No current caller in the WIN32 port needs this functionality but it's good to match the documented behaviour. Populate more fields of the mntent structure in find_mount_point(). This is required to support the df -t and -T flags recently added upstream. The static structures used here are allocated on demand. Separate static structures are used in each case because df iterates through mounts calling statfs(2) on each and the WIN32 implementation of statfs(2) calls find_mount_point().
* | Merge branch 'busybox' into mergeRon Yorston2021-06-073-5/+14
|\|