History log of /freebsd-current/usr.bin/join/join.c
Revision Date Author Comments
# d3643c9e 19-Apr-2024 Martin Tournoij <martin@arp242.net>

join: use getline() instead of fgetln()

This replaces fgetln() with getline(). The main reason for this is
portability, making things easier for people who want to compile these
tools on non-FreeBSD systems.

I appreciate that's probably not the top concern for FreeBSD base tools,
but fgetln() is impossible to port to most platforms, as concurrent
access is essentially impossible to implement fully correct without the
line buffer on the FILE struct. Other than this, many generic FreeBSD
tools compile fairly cleanly on Linux with a few small changes.

Most uses of fgetln() pre-date getline() support (added in 2009 with
69099ba2ec8b), and there's been some previous patches (ee3ca711a898
8c98e6b1a7f3 1a2a4fc8ce1b) for other tools.

Obtained from: https://github.com/dcantrell/bsdutils and
https://github.com/chimera-linux/chimerautils
Signed-off-by: Martin Tournoij <martin@arp242.net>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/893


# 95bf7589 22-Jan-2024 Tijl Coosemans <tijl@FreeBSD.org>

join(1): Fix ordering in case of missing fields

The comparison function had the ordering reversed causing join(1) to
miss some matching lines.

PR: 232405
Submitted by: Martijn van Duren <martijn@openbsd.org>
MFC after: 1 week


# 0b8224d1 24-Nov-2023 Warner Losh <imp@FreeBSD.org>

Remove copyright strings ifdef'd out

We've ifdef'd out the copyright strings for some time now. Go ahead and
remove the ifdefs. Plus whatever other detritis was left over from other
recent removals. These copyright strings are present in the comments and
are largely from CSRG's attempt at adding their copyright to every
binary file (which modern interpretations of the license doesn't
require).

Sponsored by: Netflix


# bdcbfde3 23-Nov-2023 Warner Losh <imp@FreeBSD.org>

usr.bin: Remove ancient SCCS tags.

Remove ancient SCCS tags from the tree, automated scripting, with two
minor fixup to keep things compiling. All the common forms in the tree
were removed with a perl script.

Sponsored by: Netflix


# 1d386b48 16-Aug-2023 Warner Losh <imp@FreeBSD.org>

Remove $FreeBSD$: one-line .c pattern

Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/


# a1b6427a 07-Jul-2023 Alfonso Gregory <gfunni234@gmail.com>

Mark usage function as __dead2 in programs where it does not return

In most cases, usage does not return, so mark them as __dead2. For the
cases where they do return, they have not been marked __dead2.

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/735


# 8a16b7a1 20-Nov-2017 Pedro F. Giffuni <pfg@FreeBSD.org>

General further adoption of SPDX licensing ID tags.

Mainly focus on files that use BSD 3-Clause license.

The Software Package Data Exchange (SPDX) group provides a specification
to make it easier for automated tools to detect and summarize well known
opensource licenses. We are gradually adopting the specification, noting
that the tags are considered only advisory and do not, in any way,
superceed or replace the license texts.

Special thanks to Wind River for providing access to "The Duke of
Highlander" tool: an older (2014) run over FreeBSD tree was useful as a
starting point.


# 34525108 21-Jun-2017 Conrad Meyer <cem@FreeBSD.org>

join(1): Fix field ordering for -v output

Per POSIX, join(1) (in modes other than -o) is a concatenation of selected
character fields. The joined field is first, followed by fields in the
order they occurred in the input files.

Our join(1) utility previously handled this correctly for lines with a match
in the other file. But it failed to order output fields correctly for
unmatched lines, printed in -a and -v modes.

A simple test case is:

$ touch a
$ echo "2 1" > b
$ join -v2 -2 2 a b
1 2

PR: 217711
Reported by: alt.j2-4o4s2yon at yopmail.com
Sponsored by: Dell EMC Isilon


# fbbd9655 28-Feb-2017 Warner Losh <imp@FreeBSD.org>

Renumber copyright clause 4

Renumber cluase 4 to 3, per what everybody else did when BSD granted
them permission to remove clause 3. My insistance on keeping the same
numbering for legal reasons is too pedantic, so give up on that point.

Submitted by: Jan Schaumann <jschauma@stevens.edu>
Pull Request: https://github.com/freebsd/freebsd/pull/96


# 3306f972 04-Feb-2013 Andrew Turner <andrew@FreeBSD.org>

Cast *tabchar, a wchar_t, to a wint_t as it is the type the %lc printf
format string expects. This is only an issue on ARM EABI where wint_t is
different to wchar_t.


# 6c9f9615 06-Nov-2011 Ed Schouten <ed@FreeBSD.org>

Add missing static keywords to join(1)


# da52b4ca 11-Dec-2010 Joel Dahl <joel@FreeBSD.org>

Remove the advertising clause from UCB copyrighted files in usr.bin. This
is in accordance with the information provided at
ftp://ftp.cs.berkeley.edu/pub/4bsd/README.Impt.License.Change

Also add $FreeBSD$ to a few files to keep svn happy.

Discussed with: imp, rwatson


# a7d5f7eb 19-Oct-2010 Jamie Gritton <jamie@FreeBSD.org>

A new jail(8) with a configuration file, to replace the work currently done
by /etc/rc.d/jail.


# fe0506d7 09-Mar-2010 Marcel Moolenaar <marcel@FreeBSD.org>

Create the altix project branch. The altix project will add support
for the SGI Altix 350 to FreeBSD/ia64. The hardware used for porting
is a two-module system, consisting of a base compute module and a
CPU expansion module. SGI's NUMAFlex architecture can be an excellent
platform to test CPU affinity and NUMA-aware features in FreeBSD.


# d7f03759 19-Oct-2008 Ulf Lilleengen <lulf@FreeBSD.org>

- Import the HEAD csup code which is the basis for the cvsmode work.


# 9d455d45 26-Aug-2004 Maxim Konovalov <maxim@FreeBSD.org>

Backout recent -j changes, the flags is deprecated.

Requested by: tjr


# 64215f65 25-Aug-2004 Maxim Konovalov <maxim@FreeBSD.org>

Add -j flag to usage() and the man page synopsis.

Inspired by: DragonFlyBSD


# 8160bf78 05-Jul-2004 Tim J. Robbins <tjr@FreeBSD.org>

Add support for multibyte characters.


# f4ac32de 04-Sep-2002 David Malone <dwmalone@FreeBSD.org>

ANSIify function definitions.
Add some constness to avoid some warnings.
Remove use register keyword.
Deal with missing/unneeded extern/prototypes.
Some minor type changes/casts to avoid warnings.

Reviewed by: md5


# e026a48c 29-Jun-2002 David E. O'Brien <obrien@FreeBSD.org>

Consistently use FBSDID


# 60d1fdaa 28-Apr-2002 Mark Murray <markm@FreeBSD.org>

Easy warns fixes; sort out some types and me them a bit more consistent;
fix initialisers.


# d969f833 19-Apr-2002 Andrey A. Chernov <ache@FreeBSD.org>

Remove <ctype.h> - not needed


# fcb11314 19-Apr-2002 Tim J. Robbins <tjr@FreeBSD.org>

Allow space between -a and its argument. Honour locale collating order
by using strcoll() instead of strcmp().

PR: 36270
Reviewed by: mike


# dcd587c9 25-Mar-2002 Juli Mallett <jmallett@FreeBSD.org>

Support -o 0 in join(1) as per SUS.

PR: 36072
Submitted by: Tim J. Robbins <tim@robbins.dropbear.id.au>
Reviewed by: mike


# f1bb2cd2 21-Mar-2002 Warner Losh <imp@FreeBSD.org>

remove __P


# c3aac50f 27-Aug-1999 Peter Wemm <peter@FreeBSD.org>

$Id$ -> $FreeBSD$


# 9ef5c48b 04-Jul-1999 Bill Fumerola <billf@FreeBSD.org>

Clean up some ambiguous nested if/elses.


# faba086b 19-Aug-1997 Jonathan Lemon <jlemon@FreeBSD.org>

Require all compatability options to begin with '-'.

PR: 4145


# 21a3d165 15-Jul-1997 Philippe Charnier <charnier@FreeBSD.org>

Cosmetic in usage string.


# 1c8af878 28-Mar-1997 Warner Losh <imp@FreeBSD.org>

compare return value from getopt against -1 rather than EOF, per the final
posix standard on the topic.


# 6f0a860f 11-Mar-1997 Peter Wemm <peter@FreeBSD.org>

Merge from Lite2 (note: needs checking by somebody who understands join)


# 0da30e9a 11-Mar-1997 Peter Wemm <peter@FreeBSD.org>

Import some parts of CSRG 4.4BSD-Lite2 usr.bin sources to fix tree build.


# cefe4f6f 17-Jan-1997 Joerg Wunsch <joerg@FreeBSD.org>

Fix a genuine off-by-one error that caused join to dump core when
trying to use field numbers tha weren't present in the input data.


# bf6570c4 21-Oct-1996 Poul-Henning Kamp <phk@FreeBSD.org>

Don't access stuff we have realloc()'ed using the old pointer.

This is a sample of a new class of malloc usage errors that the
Junk option to phkmalloc will expose.

Found by: phkmalloc.


# 7799f52a 30-May-1995 Rodney W. Grimes <rgrimes@FreeBSD.org>

Remove trailing whitespace.


# 9b50d902 26-May-1994 Rodney W. Grimes <rgrimes@FreeBSD.org>

BSD 4.4 Lite Usr.bin Sources