# HG changeset patch # User ali # Date 1369600429 -3600 # Node ID 0a4f8d73b27f21ece9ddc3f3c9ec85b90032c8f4 # Parent d4a66d961a6956a9a87ea04e9140081a22a9a187 Break check_for_html_tag() out diff -r d4a66d961a69 -r 0a4f8d73b27f bookloupe/bookloupe.c --- a/bookloupe/bookloupe.c Sun May 26 21:27:50 2013 +0100 +++ b/bookloupe/bookloupe.c Sun May 26 21:33:49 2013 +0100 @@ -2267,6 +2267,41 @@ } /* + * check_for_html_tag: + * + * Check for . + * + * If there is a < in the line, followed at some point + * by a > then we suspect HTML. + */ +void check_for_html_tag(const char *aline) +{ + int i; + const char *open,*close; + open=strstr(aline,"<"); + if (open) + { + close=strstr(aline,">"); + if (close) + { + i=(signed int)(close-open+1); + if (i>0) + { + strncpy(wrk,open,i); + wrk[i]=0; + if (pswit[ECHO_SWITCH]) + printf("\n%s\n",aline); + if (!pswit[OVERVIEW_SWITCH]) + printf(" Line %ld column %d - HTML Tag? %s \n", + linecnt,(int)(open-aline)+1,wrk); + else + cnt_html++; + } + } + } +} + +/* * procfile: * * Process one file. @@ -2514,27 +2549,7 @@ check_for_unspaced_bracket(aline); if (warnings->endquote) check_for_unpunctuated_endquote(aline); - /* - * Check for . - * If there is a < in the line, followed at some point - * by a > then we suspect HTML. - */ - if (strstr(aline,"<") && strstr(aline,">")) - { - i=(signed int)(strstr(aline,">")-strstr(aline,"<")+1); - if (i>0) - { - strncpy(wrk,strstr(aline,"<"),i); - wrk[i]=0; - if (pswit[ECHO_SWITCH]) - printf("\n%s\n",aline); - if (!pswit[OVERVIEW_SWITCH]) - printf(" Line %ld column %d - HTML Tag? %s \n", - linecnt,(int)(strstr(aline,"<")-aline)+1,wrk); - else - cnt_html++; - } - } + check_for_html_tag(aline); /* * Check for &symbol; HTML. * If there is a & in the line, followed at