version 1.20, 2009/12/24 02:08:14 |
version 1.21, 2010/03/02 00:38:59 |
|
|
break; |
break; |
else if (8 == p->buf[j]) |
else if (8 == p->buf[j]) |
vsz--; |
vsz--; |
else |
else if (ASCII_EOS != p->buf[j]) |
vsz++; |
vsz++; |
} |
} |
|
|
/* |
/* |
|
* Skip empty words. This happens due to the ASCII_EOS |
|
* after the end of the final sentence of a paragraph. |
|
*/ |
|
if (vsz == 0 && j == (int)p->col) |
|
break; |
|
|
|
/* |
* Choose the number of blanks to prepend: no blank at the |
* Choose the number of blanks to prepend: no blank at the |
* beginning of a line, one between words -- but do not |
* beginning of a line, one between words -- but do not |
* actually write them yet. |
* actually write them yet. |
*/ |
*/ |
vbl = (size_t)(0 == vis ? 0 : 1); |
vbl = (size_t)(ASCII_EOS == p->buf[i] ? 2 : |
|
(0 == vis ? 0 : 1)); |
|
|
/* |
/* |
* Find out whether we would exceed the right margin. |
* Find out whether we would exceed the right margin. |
|
|
for ( ; i < (int)p->col; i++) { |
for ( ; i < (int)p->col; i++) { |
if (' ' == p->buf[i]) |
if (' ' == p->buf[i]) |
break; |
break; |
|
if (ASCII_NBRSP == p->buf[i]) |
/* The unit sep. is a non-breaking space. */ |
|
if (31 == p->buf[i]) |
|
putchar(' '); |
putchar(' '); |
else |
else if (ASCII_EOS != p->buf[i]) |
putchar(p->buf[i]); |
putchar(p->buf[i]); |
} |
} |
vis += vsz; |
vis += vsz; |