aboutsummaryrefslogtreecommitdiff
path: root/coreutils/join.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* join: code shrink (4)join2Ron Yorston2026-07-031-25/+26
| | | | | | | | | | The user supplies field numbers with the -o, -1 and -2 options. It feels more natural to convert these to 0-based field indices in the code. Saves 32-48 bytes. Signed-off-by: Ron Yorston <rmy@pobox.com>
* join: code shrink (3)Ron Yorston2026-07-031-22/+21
| | | | | | | | | | When splitting the fields of a line, keep the string allocated for the line and make the 'fields' array point into it rather than allocating a new string for each field. Saves 48 bytes. Signed-off-by: Ron Yorston <rmy@pobox.com>
* join: code shrink (2)Ron Yorston2026-07-031-42/+25
| | | | | | | | | | | | | | | Reduce the amount of duplicated code in readfields() by handling a pushed back line inside the main loop, with a flag to indicate the first pass through the loop. Replace some memcpy() calls with structure assignments. Fix a bug in the code to increase the size of the 'lines' array. It set the capacity to either 8 or 0. Saves 112-128 bytes. Signed-off-by: Ron Yorston <rmy@pobox.com>
* join: code shrinkRon Yorston2026-06-301-35/+17
| | | | | | | | | | | | | | | | Adopt some BusyBox idioms in join_main(). In particular: - The '-a' and '-v' options are mutually exclusive. Enforce this in getopt32() instead of by hand. Also, since they're mutually exclusive we don't need a distinct list for each. - Control some clean-up code with ENABLE_FEATURE_CLEAN_UP. There are also a few cosmetic changes. Saves 204-256 bytes. Signed-off-by: Ron Yorston <rmy@pobox.com>
* join: minor adjustmentsRon Yorston2026-01-021-2/+2
| | | | | | | | - Update the size estimate to follow upstream's methodology - Disable the applet by default until it's accepted upstream - Add a minimal test script, stealing an example from POSIX
* join: update docs and fix some omissionsmbartlett212026-01-021-30/+16
|
* join: new appletmbartlett212026-01-021-0/+583
Join joins two sorted input files on matching fields. It supports the options required by POSIX, including the combinatorial output for equal fields. Adds 3 KiB