| | 279 | |
| | 280 | /* for compatibility with metamail */ |
| | 281 | static int is_mmnoask (const char *buf) |
| | 282 | { |
| | 283 | char tmp[LONG_STRING], *p, *q; |
| | 284 | int lng; |
| | 285 | |
| | 286 | if ((p = getenv ("MM_NOASK")) != NULL && *p) |
| | 287 | { |
| | 288 | if (mutt_strcmp (p, "1") == 0) |
| | 289 | return (1); |
| | 290 | |
| | 291 | strfcpy (tmp, p, sizeof (tmp)); |
| | 292 | p = tmp; |
| | 293 | |
| | 294 | while ((p = strtok (p, ",")) != NULL) |
| | 295 | { |
| | 296 | if ((q = strrchr (p, '/')) != NULL) |
| | 297 | { |
| | 298 | if (*(q+1) == '*') |
| | 299 | { |
| | 300 | if (mutt_strncasecmp (buf, p, q-p) == 0) |
| | 301 | return (1); |
| | 302 | } |
| | 303 | else |
| | 304 | { |
| | 305 | if (mutt_strcasecmp (buf, p) == 0) |
| | 306 | return (1); |
| | 307 | } |
| | 308 | } |
| | 309 | else |
| | 310 | { |
| | 311 | lng = mutt_strlen (p); |
| | 312 | if (buf[lng] == '/' && mutt_strncasecmp (buf, p, lng) == 0) |
| | 313 | return (1); |
| | 314 | } |
| | 315 | |
| | 316 | p = NULL; |
| | 317 | } |
| | 318 | } |
| | 319 | |
| | 320 | return (0); |
| | 321 | } |
| | 322 | |