Break check_for_miscased_genative() out
authorali <ali@juiblex.co.uk>
Sun May 26 19:55:11 2013 +0100 (2013-05-26)
changeset 5911c6d93eebd9
parent 58 b3385bfb28ac
child 60 5d1e411a5400
Break check_for_miscased_genative() out
bookloupe/bookloupe.c
     1.1 --- a/bookloupe/bookloupe.c	Sun May 26 19:32:40 2013 +0100
     1.2 +++ b/bookloupe/bookloupe.c	Sun May 26 19:55:11 2013 +0100
     1.3 @@ -2136,6 +2136,31 @@
     1.4  }
     1.5  
     1.6  /*
     1.7 + * check_for_miscased_genative:
     1.8 + *
     1.9 + * Check special case of 'S instead of 's at end of word.
    1.10 + */
    1.11 +void check_for_miscased_genative(const char *aline)
    1.12 +{
    1.13 +    const char *s;
    1.14 +    s=aline+1;
    1.15 +    while (*s)
    1.16 +    {
    1.17 +	if (*s==CHAR_SQUOTE && s[1]=='S' && s[-1]>='a' && s[-1]<='z')
    1.18 +	{
    1.19 +	    if (pswit[ECHO_SWITCH])
    1.20 +		printf("\n%s\n",aline);
    1.21 +	    if (!pswit[OVERVIEW_SWITCH])
    1.22 +		printf("    Line %ld column %d - Capital \"S\"?\n",
    1.23 +		  linecnt,(int)(s-aline+2));
    1.24 +	    else
    1.25 +		cnt_punct++;
    1.26 +	}
    1.27 +	s++;
    1.28 +    }
    1.29 +}
    1.30 +
    1.31 +/*
    1.32   * procfile:
    1.33   *
    1.34   * Process one file.
    1.35 @@ -2378,22 +2403,7 @@
    1.36  	check_for_misspaced_punctuation(aline,&parities,isemptyline);
    1.37  	check_for_double_punctuation(aline,warnings);
    1.38  	check_for_spaced_quotes(aline);
    1.39 -        /* check special case of 'S instead of 's at end of word */
    1.40 -        s=aline+1;
    1.41 -        while (*s)
    1.42 -	{
    1.43 -            if (*s==CHAR_SQUOTE && s[1]=='S' && s[-1]>='a' && s[-1]<='z')
    1.44 -	    {
    1.45 -                if (pswit[ECHO_SWITCH])
    1.46 -		    printf("\n%s\n",aline);
    1.47 -                if (!pswit[OVERVIEW_SWITCH])
    1.48 -                    printf("    Line %ld column %d - Capital \"S\"?\n",
    1.49 -		      linecnt,(int)(s-aline+2));
    1.50 -                else
    1.51 -                    cnt_punct++;
    1.52 -	    }
    1.53 -            s++;
    1.54 -	}
    1.55 +	check_for_miscased_genative(aline);
    1.56          /*
    1.57  	 * Now check special cases - start and end of line -
    1.58           * for single and double quotes. Start is sometimes [sic]