freebsd-src/usr.bin/patch
Martin Tournoij 25696725b6 patch: 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
69099ba2ec), and there's been some previous patches (ee3ca711a8
8c98e6b1a7 1a2a4fc8ce) 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
2024-04-19 15:52:22 -06:00
..
tests patch: Support long context lines. 2024-02-12 19:26:13 +01:00
backupfile.c Remove $FreeBSD$: one-line .h pattern 2023-08-16 11:54:23 -06:00
backupfile.h Remove $FreeBSD$: one-line .h pattern 2023-08-16 11:54:23 -06:00
common.h Remove $FreeBSD$: one-line .h pattern 2023-08-16 11:54:23 -06:00
inp.c patch: use getline() instead of fgetln() 2024-04-19 15:52:22 -06:00
inp.h Remove $FreeBSD$: one-line .h pattern 2023-08-16 11:54:23 -06:00
Makefile Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
Makefile.depend Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
mkpath.c Remove $FreeBSD$: one-line .h pattern 2023-08-16 11:54:23 -06:00
patch.1 Remove $FreeBSD$: one-line nroff pattern 2023-08-16 11:55:15 -06:00
patch.c patch: Support long context lines. 2024-02-12 19:26:13 +01:00
pathnames.h Remove $FreeBSD$: one-line .h pattern 2023-08-16 11:54:23 -06:00
pch.c patch: use getline() instead of fgetln() 2024-04-19 15:52:22 -06:00
pch.h patch: Support long context lines. 2024-02-12 19:26:13 +01:00
util.c Remove $FreeBSD$: one-line .h pattern 2023-08-16 11:54:23 -06:00
util.h Remove $FreeBSD$: one-line .h pattern 2023-08-16 11:54:23 -06:00