41 |
{ "folder", 'f', "FOLDER", 0, "Folder to use", 1 }, |
{ "folder", 'f', "FOLDER", 0, "Folder to use", 1 }, |
42 |
{ "no-header", 'n', 0, 0, "Exclude all headers", 1 }, |
{ "no-header", 'n', 0, 0, "Exclude all headers", 1 }, |
43 |
{ "form-feeds", 'p', 0, 0, "Output formfeeds between messages", 1 }, |
{ "form-feeds", 'p', 0, 0, "Output formfeeds between messages", 1 }, |
44 |
{ "show-all-match", 'a', "PATTERN", 0, |
{ "show-all-match", 'a', NULL, 0, |
45 |
"Print all messages matching PATTERN", 1 }, |
"Print all messages matching pattern, not just the first", 1 }, |
46 |
{0, 0, 0, 0} |
{0, 0, 0, 0} |
47 |
}; |
}; |
48 |
|
|
162 |
|
|
163 |
header_get_field_count (header, &count); |
header_get_field_count (header, &count); |
164 |
|
|
165 |
for (i = 1; i < count; i++) |
for (i = 1; i <= count; i++) |
166 |
{ |
{ |
167 |
char *name = NULL; |
char *name = NULL; |
168 |
char *value = NULL; |
char *value = NULL; |
169 |
char *token = strdup (weedlist); |
char *weedcopy = strdup (weedlist); |
170 |
char *p = token; |
char *token, *s; |
171 |
|
|
172 |
header_aget_field_name (header, i, &name); |
header_aget_field_name (header, i, &name); |
173 |
header_aget_field_value (header, i, &value); |
header_aget_field_value (header, i, &value); |
174 |
for (; (token = strtok (token, delim)) != NULL; token = NULL) |
for (token = strtok_r (weedcopy, delim, &s); token; |
175 |
|
token = strtok_r (NULL, delim, &s)) |
176 |
{ |
{ |
177 |
if (string_starts_with (name, token)) |
if (string_starts_with (name, token)) |
178 |
{ |
{ |
183 |
} |
} |
184 |
free (value); |
free (value); |
185 |
free (name); |
free (name); |
186 |
free (p); |
free (weedcopy); |
187 |
} |
} |
188 |
putchar ('\n'); |
putchar ('\n'); |
189 |
} |
} |
254 |
status = mailbox_open (mbox, MU_STREAM_READ); |
status = mailbox_open (mbox, MU_STREAM_READ); |
255 |
if (status != 0) |
if (status != 0) |
256 |
{ |
{ |
257 |
fprintf (stderr, "mailbox open - %s\n", mu_errstring(status)); |
url_t url = NULL; |
258 |
|
|
259 |
|
mailbox_get_url (mbox, &url); |
260 |
|
fprintf (stderr, "can't open mailbox %s: %s\n", |
261 |
|
url_to_string (url), |
262 |
|
mu_errstring(status)); |
263 |
exit (2); |
exit (2); |
264 |
} |
} |
265 |
|
|
267 |
weedlist = "Date To Cc Subject From Apparently-"; |
weedlist = "Date To Cc Subject From Apparently-"; |
268 |
|
|
269 |
/* Build an array containing the message number. */ |
/* Build an array containing the message number. */ |
270 |
argc -= optind; |
argc -= index; |
271 |
if (argc > 0) |
if (argc > 0) |
272 |
msglist (mbox, show_all, argc, &argv[index], &set, &n); |
msglist (mbox, show_all, argc, &argv[index], &set, &n); |
273 |
|
|