summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornicm <nicm@openbsd.org>2015-08-11 23:17:17 +0000
committernicm <nicm@openbsd.org>2015-08-11 23:17:17 +0000
commitf1123c49b21e10bbdee7543d2ae5d68796a80205 (patch)
treeb3015ab4b46303d706fcb2ad16868bbd3a5a50a4
parentWhen an exact string match is found, only print the test string, not up (diff)
downloadwireguard-openbsd-f1123c49b21e10bbdee7543d2ae5d68796a80205.tar.xz
wireguard-openbsd-f1123c49b21e10bbdee7543d2ae5d68796a80205.zip
Only warn about [bl]estring16 when they are used, like the other
unsupported types.
-rw-r--r--usr.bin/file/magic-load.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/usr.bin/file/magic-load.c b/usr.bin/file/magic-load.c
index ee371f8be5a..c40cbbecc68 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.16 2015/08/11 22:48:09 nicm Exp $ */
+/* $OpenBSD: magic-load.c,v 1.17 2015/08/11 23:17:17 nicm Exp $ */
/*
* Copyright (c) 2015 Nicholas Marriott <nicm@openbsd.org>
@@ -192,6 +192,8 @@ magic_set_result(struct magic_line *ml, const char *s)
switch (ml->type) {
case MAGIC_TYPE_NONE:
case MAGIC_TYPE_DEFAULT:
+ case MAGIC_TYPE_BESTRING16:
+ case MAGIC_TYPE_LESTRING16:
return (0); /* don't use result */
case MAGIC_TYPE_BYTE:
case MAGIC_TYPE_UBYTE:
@@ -260,10 +262,6 @@ magic_set_result(struct magic_line *ml, const char *s)
case MAGIC_TYPE_SEARCH:
re = &ml->root->format_string;
break;
- case MAGIC_TYPE_BESTRING16:
- case MAGIC_TYPE_LESTRING16:
- magic_warn(ml, "unsupported type: %s", ml->type_string);
- return (-1);
}
}