# HG changeset patch # User ali # Date 1369506944 -3600 # Node ID aa45307a63289800a556d9ab73c9ca0df395a1f9 # Parent d48f66b0ad0d825522aa8a19d46570be07e21454 Break check_for_starting_punctuation() out diff -r d48f66b0ad0d -r aa45307a6328 bookloupe/bookloupe.c --- a/bookloupe/bookloupe.c Sat May 25 19:27:51 2013 +0100 +++ b/bookloupe/bookloupe.c Sat May 25 19:35:44 2013 +0100 @@ -1152,6 +1152,25 @@ } /* + * check_for_starting_punctuation: + * + * Look for punctuation other than full ellipses at start of line. + */ +void check_for_starting_punctuation(const char *aline) +{ + if (*aline && strchr(".?!,;:",aline[0]) && strncmp(". . .",aline,5)) + { + if (pswit[ECHO_SWITCH]) + printf("\n%s\n",aline); + if (!pswit[OVERVIEW_SWITCH]) + printf(" Line %ld column 1 - Begins with punctuation?\n", + linecnt); + else + cnt_punct++; + } +} + +/* * procfile: * * Process one file. @@ -1391,17 +1410,7 @@ last.blen=last.len; last.len=strlen(aline); last.start=aline[0]; - /* Look for punctuation other than full ellipses at start of line. */ - if (*aline && strchr(".?!,;:",aline[0]) && strncmp(". . .",aline,5)) - { - if (pswit[ECHO_SWITCH]) - printf("\n%s\n",aline); - if (!pswit[OVERVIEW_SWITCH]) - printf(" Line %ld column 1 - Begins with punctuation?\n", - linecnt); - else - cnt_punct++; - } + check_for_starting_punctuation(aline); /* * Check for spaced em-dashes. * We must check _all_ occurrences of "--" on the line