From 3ed3878b2b01a301687e13ce95049c0c67c98cc2 Mon Sep 17 00:00:00 2001 From: Christian Neukirchen Date: Sat, 23 Jul 2016 00:46:48 +0200 Subject: mshow: use fnmatch for extraction --- mshow.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'mshow.c') diff --git a/mshow.c b/mshow.c index fbe1683..a5c078c 100644 --- a/mshow.c +++ b/mshow.c @@ -4,6 +4,7 @@ #include #include #include +#include #include #include #include @@ -402,7 +403,8 @@ extract_mime(int depth, struct message *msg, char *body, size_t bodylen) printf("%s\n", bufptr); writefile(bufptr, body, bodylen); } - } else if (filename && strcmp(a, filename) == 0) { + } else if (filename && + fnmatch(a, filename, FNM_PATHNAME) == 0) { // extract by name if (extract_stdout) { fwrite(body, 1, bodylen, stdout); -- cgit 1.4.1