summaryrefslogtreecommitdiff
path: root/util/cbmem
diff options
context:
space:
mode:
authorKonrad Adamczyk <konrada@google.com>2023-04-24 10:06:30 +0000
committerJulius Werner <jwerner@chromium.org>2023-04-27 00:39:12 +0000
commit8120cb41667c1ec0547904d41bd0841f96aa28bd (patch)
tree921941ebc32e65e4c92270dbc3854c473cb3c221 /util/cbmem
parent6b6872bdd5f0d73f8ea53e306d100cbe132c9937 (diff)
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> Reviewed-on: https://review.coreboot.org/c/coreboot/+/74742 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Raul Rangel <rrangel@chromium.org> Reviewed-by: Julius Werner <jwerner@chromium.org>
Diffstat (limited to 'util/cbmem')
-rw-r--r--util/cbmem/cbmem.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/util/cbmem/cbmem.c b/util/cbmem/cbmem.c
index c0b39ea6d0..060f88c3f4 100644
--- a/util/cbmem/cbmem.c
+++ b/util/cbmem/cbmem.c
@@ -1001,7 +1001,7 @@ static void dump_console(enum console_print_type type, int max_loglevel, int pri
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. */