summaryrefslogtreecommitdiff
path: root/usr.bin/file
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2016-05-01 10:34:31 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2016-05-01 10:34:31 +0000
commit45ab3de1d571df48ba8affbe822f5adf4a2810c5 (patch)
treeba2db32b1ae3e1d6b037cb16a03f10bed4706fec /usr.bin/file
parent66fdf263f1037797446dc5c1fe75832dd63638d8 (diff)
Trim = prefix from regex (it a noop).
Diffstat (limited to 'usr.bin/file')
-rw-r--r--usr.bin/file/magic-load.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/usr.bin/file/magic-load.c b/usr.bin/file/magic-load.c
index 00640cdf0b1..cb6397a50d3 100644
--- a/usr.bin/file/magic-load.c
+++ b/usr.bin/file/magic-load.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: magic-load.c,v 1.20 2016/05/01 08:48:39 nicm Exp $ */
+/* $OpenBSD: magic-load.c,v 1.21 2016/05/01 10:34:30 nicm Exp $ */
/*
* Copyright (c) 2015 Nicholas Marriott <nicm@openbsd.org>
@@ -862,6 +862,8 @@ magic_parse_value(struct magic_line *ml, char **line)
}
/* FALLTHROUGH */
case MAGIC_TYPE_REGEX:
+ if (**line == '=')
+ (*line)++;
copy = s = xmalloc(strlen(*line) + 1);
if (magic_get_string(line, s, &slen) != 0) {
magic_warn(ml, "can't parse string");