version 1.86, 2009/07/15 15:37:48 |
version 1.90, 2009/07/19 21:26:27 |
Line 204 term_isopendelim(const char *p) |
|
Line 204 term_isopendelim(const char *p) |
|
* possible). |
* possible). |
* |
* |
* FIXME: newline breaks occur (in groff) also occur when a single |
* FIXME: newline breaks occur (in groff) also occur when a single |
* space follows a NOBREAK! |
* space follows a NOBREAK (try `Bl -tag') |
|
* |
|
* FIXME: there's a newline error where a `Bl -diag' will have a |
|
* trailing newline if the line is exactly 73 chars long. |
*/ |
*/ |
void |
void |
term_flushln(struct termp *p) |
term_flushln(struct termp *p) |
Line 252 term_flushln(struct termp *p) |
|
Line 255 term_flushln(struct termp *p) |
|
|
|
/* LINTED */ |
/* LINTED */ |
for (j = i, vsz = 0; j < (int)p->col; j++) { |
for (j = i, vsz = 0; j < (int)p->col; j++) { |
if (' ' == p->buf[j]) |
if (' ' == p->buf[j]) |
break; |
break; |
else if (8 == p->buf[j]) |
else if (8 == p->buf[j]) |
j += 1; |
vsz--; |
else |
else |
vsz++; |
vsz++; |
} |
} |
Line 495 term_pescape(struct termp *p, const char **word) |
|
Line 498 term_pescape(struct termp *p, const char **word) |
|
void |
void |
term_word(struct termp *p, const char *word) |
term_word(struct termp *p, const char *word) |
{ |
{ |
|
const char *sv; |
|
|
assert(*word); |
|
if (term_isclosedelim(word)) |
if (term_isclosedelim(word)) |
if ( ! (TERMP_IGNDELIM & p->flags)) |
if ( ! (TERMP_IGNDELIM & p->flags)) |
p->flags |= TERMP_NOSPACE; |
p->flags |= TERMP_NOSPACE; |
Line 512 term_word(struct termp *p, const char *word) |
|
Line 515 term_word(struct termp *p, const char *word) |
|
* before the word. |
* before the word. |
*/ |
*/ |
|
|
for ( ; *word; word++) |
for (sv = word; *word; word++) |
if ('\\' != *word) |
if ('\\' != *word) |
term_encodea(p, *word); |
term_encodea(p, *word); |
else |
else |
term_pescape(p, &word); |
term_pescape(p, &word); |
|
|
if (term_isopendelim(word)) |
if (term_isopendelim(sv)) |
p->flags |= TERMP_NOSPACE; |
p->flags |= TERMP_NOSPACE; |
} |
} |
|
|
Line 549 term_chara(struct termp *p, char c) |
|
Line 552 term_chara(struct termp *p, char c) |
|
static void |
static void |
term_encodea(struct termp *p, char c) |
term_encodea(struct termp *p, char c) |
{ |
{ |
|
|
if (TERMP_STYLE & p->flags) { |
if (' ' != c && TERMP_STYLE & p->flags) { |
if (TERMP_BOLD & p->flags) { |
if (TERMP_BOLD & p->flags) { |
term_chara(p, c); |
term_chara(p, c); |
term_chara(p, 8); |
term_chara(p, 8); |