You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When --delimiter (-d) is specified, and delimiter is to be printed before the matching record, tre-grep can print delim_len bytes of garbage, instead of the delimiter. This is because, just before printing the matching record, an adjustment is made to |record|, the start of the current record. delim_len is subtracted from record, it is not necessarily true that there are that many bytes in the buffer, buf, between buf and record. So, whatever bytes are just below buf get printed. My experience, so far, is that it just prints garbage, but the behavior is undefined, so it could be worse.
My test version has a test to ensure that record - buf >= delim_len.
The text was updated successfully, but these errors were encountered:
When --delimiter (-d) is specified, and delimiter is to be printed before the matching record, tre-grep can print
delim_len
bytes of garbage, instead of the delimiter. This is because, just before printing the matching record, an adjustment is made to |record|, the start of the current record.delim_len
is subtracted fromrecord
, it is not necessarily true that there are that many bytes in the buffer,buf
, betweenbuf
andrecord
. So, whatever bytes are just belowbuf
get printed. My experience, so far, is that it just prints garbage, but the behavior is undefined, so it could be worse.My test version has a test to ensure that
record - buf >= delim_len
.The text was updated successfully, but these errors were encountered: