bsdtar(1) line_reader.c interesting code part - partial patch

From: Adam PAPAI <wooh_at_wooh.hu>
Date: Fri, 19 Mar 2010 19:43:42 +0100
Hi,

Bug report sais:

http://www.freebsd.org/cgi/query-pr.cgi?pr=bin/144786

bsdtar(1) doesn't support multi line matching or it is broken.

This patch [1] should solve it but not sure about this line in the 
original code:

if (lr->nullSeparator) {
...
}

This is  constant '\n' so this code part was never reached. This is why 
the '\n' separated lines were handled as one long line.

The line_reader.c header comment sais:

  * Read lines from file and do something with each one.  If option_null
  * is set, lines are terminated with zero bytes; otherwise, they're
  * terminated with newlines.

But where is the switch to change between \n and zero bytes? :)

[1]: http://www.wooh.hu/freebsd/line_reader.c.patch.txt


-- 
Adam PAPAI
Received on Fri Mar 19 2010 - 18:12:42 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:01 UTC