diff options
-rw-r--r-- | man/mshow.1 | 14 | ||||
-rw-r--r-- | mshow.c | 4 |
2 files changed, 9 insertions, 9 deletions
diff --git a/man/mshow.1 b/man/mshow.1 index cf44a2a..5f9a7fe 100644 --- a/man/mshow.1 +++ b/man/mshow.1 @@ -53,15 +53,13 @@ from the message .Ar msg into files. .Ar parts -can be specified by number or file name. +can be specified by number, file name or +.Xr fnmatch 3 +pattern. .It Fl O Ar msg -Switch to extraction mode: extract -.Ar parts -from the message -.Ar msg -to standard output. -.Ar parts -can be specified by number or file name. +Like +.Fl x +but extract to standard output. .It Fl t Switch to list mode: list all MIME parts of each diff --git a/mshow.c b/mshow.c index fbe1683..a5c078c 100644 --- a/mshow.c +++ b/mshow.c @@ -4,6 +4,7 @@ #include <ctype.h> #include <errno.h> #include <fcntl.h> +#include <fnmatch.h> #include <iconv.h> #include <stdio.h> #include <stdlib.h> @@ -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); |