diff options
author | Nicholas Marriott <nicm@cvs.openbsd.org> | 2019-01-15 09:25:00 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@cvs.openbsd.org> | 2019-01-15 09:25:00 +0000 |
commit | 0821c4d2e484c09ab9faa2de4cb0db0f920e3f4b (patch) | |
tree | 2acf163e1ff4a439a929cf6a42ed73d6019b6af0 /usr.bin | |
parent | 33e80c64be4268e7bdea11dcbe5473628e3d987b (diff) |
Regex flags should include REG_NEWLINE and REG_ICASE should actually be
used if specified.
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/file/magic-test.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.bin/file/magic-test.c b/usr.bin/file/magic-test.c index 037d3d19581..59bb960a25e 100644 --- a/usr.bin/file/magic-test.c +++ b/usr.bin/file/magic-test.c @@ -1,4 +1,4 @@ -/* $OpenBSD: magic-test.c,v 1.26 2018/06/14 19:51:11 nicm Exp $ */ +/* $OpenBSD: magic-test.c,v 1.27 2019/01/15 09:24:59 nicm Exp $ */ /* * Copyright (c) 2015 Nicholas Marriott <nicm@openbsd.org> @@ -1016,7 +1016,7 @@ magic_test_type_regex(struct magic_line *ml, struct magic_state *ms) } } - if (regcomp(&re, ml->test_string, REG_EXTENDED) != 0) + if (regcomp(&re, ml->test_string, REG_EXTENDED|REG_NEWLINE|flags) != 0) return (-1); m.rm_so = ms->offset; m.rm_eo = ms->size; |