patch: handle NULs in lines
commit235b06458a4e60a61dced04eccef13dfe62c270e
authorOmar Polo <op@omarpolo.com>
Mon, 23 Oct 2023 09:51:25 +0000 (23 09:51 +0000)
committerThomas Adam <thomas@xteddy.org>
Sat, 28 Oct 2023 11:32:53 +0000 (28 12:32 +0100)
treedbd12d2e2fc191bd6a9414ba8907416ff355b7c8
parentd50c8991ddc68e92266707a26186b792429d767f
patch: handle NULs in lines

got patch assumes that lines can be encoded as strings, so embedded
NUL bytes truncates what got sees of the line.

While here, add some minor semplification to the logic by splitting
the type out of the line string and change linecmp into lines_eq
(name suggested by stsp@)

ok stsp@
lib/patch.c
libexec/got-read-patch/got-read-patch.c