# HG changeset patch # User ali # Date 1369604625 -3600 # Node ID 8650633521467843eec6cb278103e9599084c10e # Parent a5ef278feb34b6b2b95b32ac79aabb06e9301edb Break check_for_control_characters() out diff -r a5ef278feb34 -r 865063352146 bookloupe/bookloupe.c --- a/bookloupe/bookloupe.c Sun May 26 22:37:16 2013 +0100 +++ b/bookloupe/bookloupe.c Sun May 26 22:43:45 2013 +0100 @@ -992,6 +992,34 @@ } /* + * check_for_control_characters: + * + * Check for invalid or questionable characters in the line + * Anything above 127 is invalid for plain ASCII, and + * non-printable control characters should also be flagged. + * Tabs should generally not be there. + */ +void check_for_control_characters(const char *aline) +{ + unsigned char c; + const char *s; + for (s=aline;*s;s++) + { + c=*(unsigned char *)s; + if (c=aline && *s=='-') enddash=1; - /* - * Check for invalid or questionable characters in the line - * Anything above 127 is invalid for plain ASCII, and - * non-printable control characters should also be flagged. - * Tabs should generally not be there. - */ - for (s=aline;*s;s++) - { - i=(unsigned char)*s; - if (ibin) check_for_odd_characters(aline,warnings,isemptyline); if (warnings->longline)