~ubuntu-branches/ubuntu/vivid/tin/vivid

« back to all changes in this revision

Viewing changes to src/config.c

  • Committer: Package Import Robot
  • Author(s): Marco d'Itri
  • Date: 2012-01-06 15:04:11 UTC
  • mfrom: (1.2.17)
  • Revision ID: package-import@ubuntu.com-20120106150411-vftxaked1sscxt1t
Tags: 1:2.1.0-1
New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
6
6
 *  Updated   : 2011-04-17
7
7
 *  Notes     : Configuration file routines
8
8
 *
9
 
 * Copyright (c) 1991-2011 Iain Lea <iain@bricbrac.de>
 
9
 * Copyright (c) 1991-2012 Iain Lea <iain@bricbrac.de>
10
10
 * All rights reserved.
11
11
 *
12
12
 * Redistribution and use in source and binary forms, with or without
264
264
                        if (match_color(buf, "col_markstroke=", &tinrc.col_markstroke, MAX_COLOR))
265
265
                                break;
266
266
#endif /* HAVE_COLOR */
267
 
                        if (match_list(buf, "confirm_choice=", txt_confirm_choices, NUM_CONFIRM_CHOICES, &tinrc.confirm_choice))
 
267
                        if (match_list(buf, "confirm_choice=", txt_confirm_choices, &tinrc.confirm_choice))
268
268
                                break;
269
269
 
270
270
                        break;
436
436
                        if (match_string(buf, "mailer_format=", tinrc.mailer_format, sizeof(tinrc.mailer_format)))
437
437
                                break;
438
438
 
439
 
                        if (match_list(buf, "mail_mime_encoding=", txt_mime_encodings, NUM_MIME_ENCODINGS, &tinrc.mail_mime_encoding))
 
439
                        if (match_list(buf, "mail_mime_encoding=", txt_mime_encodings, &tinrc.mail_mime_encoding))
440
440
                                break;
441
441
 
442
442
                        if (match_boolean(buf, "mail_8bit_header=", &tinrc.mail_8bit_header))
446
446
                        if (match_string(buf, "mm_charset=", tinrc.mm_charset, sizeof(tinrc.mm_charset)))
447
447
                                break;
448
448
#else
449
 
                        if (match_list(buf, "mm_charset=", txt_mime_charsets, NUM_MIME_CHARSETS, &tinrc.mm_network_charset))
 
449
                        if (match_list(buf, "mm_charset=", txt_mime_charsets, &tinrc.mm_network_charset))
450
450
                                break;
451
 
                        if (match_list(buf, "mm_network_charset=", txt_mime_charsets, NUM_MIME_CHARSETS, &tinrc.mm_network_charset))
 
451
                        if (match_list(buf, "mm_network_charset=", txt_mime_charsets, &tinrc.mm_network_charset))
452
452
                                break;
453
453
#       ifdef NO_LOCALE
454
454
                        if (match_string(buf, "mm_local_charset=", tinrc.mm_local_charset, sizeof(tinrc.mm_local_charset)))
468
468
                        if (match_string(buf, "mail_quote_format=", tinrc.mail_quote_format, sizeof(tinrc.mail_quote_format)))
469
469
                                break;
470
470
 
471
 
                        if (match_list(buf, "mailbox_format=", txt_mailbox_formats, NUM_MAILBOX_FORMATS, &tinrc.mailbox_format))
 
471
                        if (match_list(buf, "mailbox_format=", txt_mailbox_formats, &tinrc.mailbox_format))
472
472
                                break;
473
473
 
474
474
                        if (match_string(buf, "metamail_prog=", tinrc.metamail_prog, sizeof(tinrc.metamail_prog)))
505
505
                        if (match_string(buf, "news_quote_format=", tinrc.news_quote_format, sizeof(tinrc.news_quote_format)))
506
506
                                break;
507
507
 
 
508
#if defined(HAVE_ALARM) && defined(SIGALRM)
 
509
                        /* the number of seconds is limited on some systems (e.g. Free/OpenBSD: 100000000) */
 
510
                        if (match_integer(buf, "nntp_read_timeout_secs=", &tinrc.nntp_read_timeout_secs, 16383))
 
511
                                break;
 
512
#endif /* HAVE_ALARM && SIGALRM */
 
513
 
508
514
#ifdef HAVE_UNICODE_NORMALIZATION
509
515
#       ifdef HAVE_LIBICUUC
510
516
                        if (match_integer(buf, "normalization_form=", &tinrc.normalization_form, NORMALIZE_NFD))
520
526
                        break;
521
527
 
522
528
                case 'p':
523
 
                        if (match_list(buf, "post_mime_encoding=", txt_mime_encodings, NUM_MIME_ENCODINGS, &tinrc.post_mime_encoding))
 
529
                        if (match_list(buf, "post_mime_encoding=", txt_mime_encodings, &tinrc.post_mime_encoding))
524
530
                                break;
525
531
 
526
532
                        if (match_boolean(buf, "post_8bit_header=", &tinrc.post_8bit_header))
813
819
         * or a 8bit charset but a !8bit encoding, update encoding if needed
814
820
         */
815
821
        is_7bit = FALSE;
816
 
        for (i = 0; *txt_mime_7bit_charsets[i]; i++) {
 
822
        for (i = 0; txt_mime_7bit_charsets[i] != NULL; i++) {
817
823
                if (!strcasecmp(txt_mime_charsets[tinrc.mm_network_charset], txt_mime_7bit_charsets[i])) {
818
824
                        is_7bit = TRUE;
819
825
                        break;
1035
1041
        fprintf(fp, "%s", _(txt_reread_active_file_secs.tinrc));
1036
1042
        fprintf(fp, "reread_active_file_secs=%d\n\n", tinrc.reread_active_file_secs);
1037
1043
 
 
1044
#if defined(HAVE_ALARM) && defined(SIGALRM)
 
1045
        fprintf(fp, "%s", _(txt_nntp_read_timeout_secs.tinrc));
 
1046
        fprintf(fp, "nntp_read_timeout_secs=%d\n\n", tinrc.nntp_read_timeout_secs);
 
1047
#endif /* HAVE_ALARM && SIGALRM */
 
1048
 
1038
1049
        fprintf(fp, "%s", _(txt_quote_chars.tinrc));
1039
1050
        fprintf(fp, "quote_chars=%s\n\n", quote_space_to_dash(tinrc.quote_chars));
1040
1051
 
1524
1535
        char *line,
1525
1536
        constext *pat,
1526
1537
        constext *const *table,
1527
 
        size_t tablelen,
1528
1538
        int *dst)
1529
1539
{
1530
1540
        size_t patlen = strlen(pat);
1535
1545
 
1536
1546
                line += patlen;
1537
1547
                *dst = 0;       /* default, if no match */
1538
 
                for (n = 0; n < tablelen; n++) {
 
1548
                for (n = 0; table[n] != NULL; n++) {
1539
1549
                        if (match_item(line, table[n], temp, sizeof(temp))) {
1540
1550
                                *dst = (int) n;
1541
1551
                                break;