-/* $Id: mdocterm.c,v 1.31 2009/03/04 14:13:05 kristaps Exp $ */
+/* $Id: mdocterm.c,v 1.33 2009/03/05 13:12:12 kristaps Exp $ */
/*
* Copyright (c) 2008 Kristaps Dzonsons <kristaps@kth.se>
*
/* LINTED */
for (j = i, vsz = 0; j < p->col; j++) {
- if (isspace((int)p->buf[j]))
+ if (isspace((u_char)p->buf[j]))
break;
else if (27 == p->buf[j]) {
assert(j + 4 <= p->col);
*/
for ( ; i < p->col; i++) {
- if (isspace((int)p->buf[i]))
+ if (isspace((u_char)p->buf[i]))
break;
putchar(p->buf[i]);
}
*/
if ((TERMP_NOBREAK & p->flags) && vis >= maxvis) {
- putchar('\n');
- for (i = 0; i < p->rmargin; i++)
- putchar(' ');
+ if ( ! (TERMP_NONOBREAK & p->flags)) {
+ putchar('\n');
+ for (i = 0; i < p->rmargin; i++)
+ putchar(' ');
+ }
p->col = 0;
return;
}
* pad to the right margin and stay off.
*/
- if (p->flags & TERMP_NOBREAK)
- for ( ; vis < maxvis; vis++)
- putchar(' ');
- else
+ if (p->flags & TERMP_NOBREAK) {
+ if ( ! (TERMP_NONOBREAK & p->flags))
+ for ( ; vis < maxvis; vis++)
+ putchar(' ');
+ } else
putchar('\n');
p->col = 0;
/* LINTED */
for (j = i = 0; i < len; i++) {
- if ( ! isspace((int)word[i])) {
+ if ( ! isspace((u_char)word[i])) {
j++;
continue;
}
/* Escaped spaces don't delimit... */
- if (i > 0 && isspace((int)word[i]) &&
+ if (i > 0 && isspace((u_char)word[i]) &&
'\\' == word[i - 1]) {
j++;
continue;
meta->title, pp ? pp : "");
for (bufp = title; *bufp; bufp++)
- *bufp = toupper(*bufp);
+ *bufp = toupper((u_char)*bufp);
p->offset = 0;
p->rmargin = (p->maxrmargin - strlen(buf)) / 2;