diff options
-rw-r--r-- | man2html/man2html.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/man2html/man2html.c b/man2html/man2html.c index eed6be2..f400ed8 100644 --- a/man2html/man2html.c +++ b/man2html/man2html.c @@ -2984,6 +2984,7 @@ scan_troff(char *c, int san, char **result) { /* san : stop at newline */ char *exbuffer; int exbuffpos, exbuffmax, exscaninbuff, exnewline_for_fun; int usenbsp = 0; + int escnl = 0; /* prevent eating newline after escape at end-of-line */ exbuffer = buffer; exbuffpos = buffpos; @@ -3008,8 +3009,12 @@ scan_troff(char *c, int san, char **result) { /* san : stop at newline */ while (*h && (!san || newline_for_fun || *h != '\n')) { if (*h == escapesym) { h++; + if ((ibp > 0 && !isspace(intbuff[ibp-1])) || !fillout) + escnl = 1; FLUSHIBP; h = scan_escape(h); + if (*h != '\n') + escnl = 0; } else if (*h == '\b') { intbuff[ibp++]=*h++; if (ibp>480) { FLUSHIBP; } @@ -3086,7 +3091,7 @@ scan_troff(char *c, int san, char **result) { /* san : stop at newline */ contained_tab=0; curpos=0; usenbsp=0; - if (ibp > 0 && !isspace(intbuff[ibp-1])) + if ((ibp > 0 && !isspace(intbuff[ibp-1])) || escnl) intbuff[ibp++]='\n'; break; case '\t': |