version 1.22, 2010/03/05 20:46:48 |
version 1.23, 2010/03/06 11:27:55 |
|
|
int j; /* temporary loop index */ |
int j; /* temporary loop index */ |
int jhy; /* last hyphen before line overflow */ |
int jhy; /* last hyphen before line overflow */ |
size_t maxvis, mmax; |
size_t maxvis, mmax; |
|
static int line_started = 0; |
static int overstep = 0; |
static int overstep = 0; |
|
|
/* |
/* |
|
|
* breaking the line. |
* breaking the line. |
*/ |
*/ |
|
|
/* |
|
* If in the standard case (left-justified), then begin with our |
|
* indentation, otherwise (columns, etc.) just start spitting |
|
* out text. |
|
*/ |
|
|
|
if ( ! (p->flags & TERMP_NOLPAD)) |
|
/* LINTED */ |
|
for (j = 0; j < (int)p->offset; j++) |
|
putchar(' '); |
|
|
|
vis = vend = i = 0; |
vis = vend = i = 0; |
while (i < (int)p->col) { |
while (i < (int)p->col) { |
|
|
|
|
break; |
break; |
|
|
/* |
/* |
|
* Usually, indent the first line of each paragraph. |
|
*/ |
|
if (0 == i && ! (p->flags & TERMP_NOLPAD)) |
|
/* LINTED */ |
|
for (j = 0; j < (int)p->offset; j++) |
|
putchar(' '); |
|
line_started = 1; |
|
|
|
/* |
* Find out whether we would exceed the right margin. |
* Find out whether we would exceed the right margin. |
* If so, break to the next line. (TODO: hyphenate) |
* If so, break to the next line. (TODO: hyphenate) |
* Otherwise, write the chosen number of blanks now. |
* Otherwise, write the chosen number of blanks now. |
|
|
overstep = 0; |
overstep = 0; |
|
|
if ( ! (TERMP_NOBREAK & p->flags)) { |
if ( ! (TERMP_NOBREAK & p->flags)) { |
putchar('\n'); |
if (line_started) { |
|
putchar('\n'); |
|
line_started = 0; |
|
} |
return; |
return; |
} |
} |
|
|