Konrad Adamczyk has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/74742 )
Change subject: util/cbmem: Add REG_NEWLINE flag to fix matching pattern ......................................................................
util/cbmem: Add REG_NEWLINE flag to fix matching pattern
Match-any-character operators (eg. ".*") shall not match newline characters for BANNER_REGEX, since given regular expression matches newline explicitly.
Add REG_NEWLINE flag to `regcomp` call.
BUG=b:278718871 TEST=Boot firmware on skyrim, reboot. Run `cbmem -2`. `cbmem -2` returns second-to-last boot log.
Change-Id: I9e924349ead0fa7eea8b9ad5161138a4c4946ade Signed-off-by: Konrad Adamczyk konrada@google.com --- M util/cbmem/cbmem.c 1 file changed, 22 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/42/74742/1
diff --git a/util/cbmem/cbmem.c b/util/cbmem/cbmem.c index c0b39ea..060f88c 100644 --- a/util/cbmem/cbmem.c +++ b/util/cbmem/cbmem.c @@ -1001,7 +1001,7 @@ for (size_t i = 0; !cursor && i < ARRAY_SIZE(regex); i++) { regex_t re; regmatch_t match; - int res = regcomp(&re, regex[i], REG_EXTENDED); + int res = regcomp(&re, regex[i], REG_EXTENDED | REG_NEWLINE); assert(res == 0);
/* Keep looking for matches so we find the last one. */