Break check_for_mta_from() out
authorali <ali@juiblex.co.uk>
Sat May 25 23:43:48 2013 +0100 (2013-05-25)
changeset 501b646720d4a7
parent 49 8a53979c0d65
child 51 0d08cd5055d5
Break check_for_mta_from() out
bookloupe/bookloupe.c
     1.1 --- a/bookloupe/bookloupe.c	Sat May 25 20:47:50 2013 +0100
     1.2 +++ b/bookloupe/bookloupe.c	Sat May 25 23:43:48 2013 +0100
     1.3 @@ -1346,6 +1346,28 @@
     1.4  }
     1.5  
     1.6  /*
     1.7 + * check_for_mta_from:
     1.8 + *
     1.9 + * Special case - angled bracket in front of "From" placed there by an
    1.10 + * MTA when sending an e-mail.
    1.11 + */
    1.12 +void check_for_mta_from(const char *aline)
    1.13 +{
    1.14 +    const char *s;
    1.15 +    s=strstr(aline,">From");
    1.16 +    if (s)
    1.17 +    {
    1.18 +	if (pswit[ECHO_SWITCH])
    1.19 +	    printf("\n%s\n",aline);
    1.20 +	if (!pswit[OVERVIEW_SWITCH])
    1.21 +	    printf("    Line %ld column %d - Query angled bracket with From\n",
    1.22 +	      linecnt,(int)(s-aline)+1);
    1.23 +	else
    1.24 +	    cnt_punct++;
    1.25 +    }
    1.26 +}
    1.27 +
    1.28 +/*
    1.29   * procfile:
    1.30   *
    1.31   * Process one file.
    1.32 @@ -1593,21 +1615,7 @@
    1.33  	}
    1.34  	check_for_unmarked_paragraphs(aline);
    1.35  	check_for_jeebies(aline);
    1.36 -        /*
    1.37 -	 * Special case - angled bracket in front of "From" placed there by an
    1.38 -	 * MTA when sending an e-mail.
    1.39 -	 */
    1.40 -        if (strstr(aline,">From"))
    1.41 -	{
    1.42 -            if (pswit[ECHO_SWITCH])
    1.43 -		printf("\n%s\n",aline);
    1.44 -            if (!pswit[OVERVIEW_SWITCH])
    1.45 -                printf("    Line %ld column %d - "
    1.46 -		  "Query angled bracket with From\n",
    1.47 -		  linecnt,(int)(strstr(aline,">From")-aline)+1);
    1.48 -            else
    1.49 -                cnt_punct++;
    1.50 -	}
    1.51 +	check_for_mta_from(aline);
    1.52          /*
    1.53  	 * Check for a single character line -
    1.54  	 * often an overflow from bad wrapping.