version 1.7, 2009/02/22 14:31:08 |
version 1.8, 2009/02/22 15:50:45 |
Line 82 flushln(struct termp *p) |
|
Line 82 flushln(struct termp *p) |
|
for (j = 0; j < p->offset; j++) |
for (j = 0; j < p->offset; j++) |
putchar(' '); |
putchar(' '); |
|
|
|
/* |
|
* If we're literal, print out verbatim. |
|
*/ |
|
if (p->flags & TERMP_LITERAL) { |
|
/* FIXME: count non-printing chars. */ |
|
for (i = 0; i < p->col; i++) |
|
putchar(p->buf[i]); |
|
putchar('\n'); |
|
p->col = 0; |
|
return; |
|
} |
|
|
for (i = 0; i < p->col; i++) { |
for (i = 0; i < p->col; i++) { |
/* |
/* |
* Count up visible word characters. Control sequences |
* Count up visible word characters. Control sequences |
Line 267 pword(struct termp *p, const char *word, size_t len) |
|
Line 279 pword(struct termp *p, const char *word, size_t len) |
|
{ |
{ |
size_t i; |
size_t i; |
|
|
assert(len > 0); |
/*assert(len > 0);*/ /* Can be, if literal. */ |
|
|
if ( ! (p->flags & TERMP_NOSPACE)) |
if ( ! (p->flags & TERMP_NOSPACE) && |
|
! (p->flags & TERMP_LITERAL)) |
chara(p, ' '); |
chara(p, ' '); |
|
|
p->flags &= ~TERMP_NOSPACE; |
p->flags &= ~TERMP_NOSPACE; |
Line 298 word(struct termp *p, const char *word) |
|
Line 311 word(struct termp *p, const char *word) |
|
{ |
{ |
size_t i, j, len; |
size_t i, j, len; |
|
|
if (mdoc_isdelim(word)) |
if (p->flags & TERMP_LITERAL) { |
p->flags |= TERMP_NOSPACE; |
pword(p, word, strlen(word)); |
|
return; |
|
} |
|
|
len = strlen(word); |
len = strlen(word); |
assert(len > 0); |
assert(len > 0); |
|
|
|
if (mdoc_isdelim(word)) |
|
p->flags |= TERMP_NOSPACE; |
|
|
/* LINTED */ |
/* LINTED */ |
for (j = i = 0; i < len; i++) { |
for (j = i = 0; i < len; i++) { |