Julius Werner has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/74742 )
Change subject: util/cbmem: Add REG_NEWLINE flag to fix matching pattern ......................................................................
Patch Set 2:
(2 comments)
Commit Message:
https://review.coreboot.org/c/coreboot/+/74742/comment/28e46812_f2ea045c PS1, Line 13: REG_NEWLINE
The only real issue is that the `.?` introduced may match a newline […]
Sure, if you have the time to fix it up please go ahead.
File util/cbmem/cbmem.c:
https://review.coreboot.org/c/coreboot/+/74742/comment/9f778e4d_2d880732 PS2, Line 1010: match.rm_so + 1;
Never mind. […]
Yeah, the `cursor` variable basically servers double duty between tracking where we need to start scanning for the next pattern and where we want to start printing if we found what we're looking for. The `rm_so + 1` was just an easy way to make it fit both requirements (it will cut off the first `\n` when printing but that doesn't matter in practice). You could split it into two separate tracking variables and then start scanning from `rm_eo` instead, but it didn't seem worth the effort.