version 1.214, 2013/12/25 00:39:31 |
version 1.216, 2014/01/22 20:58:39 |
|
|
/* $Id$ */ |
/* $Id$ */ |
/* |
/* |
* Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv> |
* Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv> |
* Copyright (c) 2010, 2011, 2012, 2013 Ingo Schwarze <schwarze@openbsd.org> |
* Copyright (c) 2010-2014 Ingo Schwarze <schwarze@openbsd.org> |
* |
* |
* Permission to use, copy, modify, and distribute this software for any |
* Permission to use, copy, modify, and distribute this software for any |
* purpose with or without fee is hereby granted, provided that the above |
* purpose with or without fee is hereby granted, provided that the above |
Line 179 term_flushln(struct termp *p) |
|
Line 179 term_flushln(struct termp *p) |
|
/* Regular word. */ |
/* Regular word. */ |
/* Break at the hyphen point if we overrun. */ |
/* Break at the hyphen point if we overrun. */ |
if (vend > vis && vend < bp && |
if (vend > vis && vend < bp && |
ASCII_HYPH == p->buf[j]) |
(ASCII_HYPH == p->buf[j] || |
|
ASCII_BREAK == p->buf[j])) |
jhy = j; |
jhy = j; |
|
|
vend += (*p->width)(p, p->buf[j]); |
vend += (*p->width)(p, p->buf[j]); |
Line 233 term_flushln(struct termp *p) |
|
Line 234 term_flushln(struct termp *p) |
|
vbl += (*p->width)(p, ' '); |
vbl += (*p->width)(p, ' '); |
continue; |
continue; |
} |
} |
|
if (ASCII_BREAK == p->buf[i]) |
|
continue; |
|
|
/* |
/* |
* Now we definitely know there will be |
* Now we definitely know there will be |
Line 644 term_strlen(const struct termp *p, const char *cp) |
|
Line 647 term_strlen(const struct termp *p, const char *cp) |
|
int ssz, skip, c; |
int ssz, skip, c; |
const char *seq, *rhs; |
const char *seq, *rhs; |
enum mandoc_esc esc; |
enum mandoc_esc esc; |
static const char rej[] = { '\\', ASCII_HYPH, ASCII_NBRSP, '\0' }; |
static const char rej[] = { '\\', ASCII_NBRSP, ASCII_HYPH, |
|
ASCII_BREAK, '\0' }; |
|
|
/* |
/* |
* Account for escaped sequences within string length |
* Account for escaped sequences within string length |
Line 659 term_strlen(const struct termp *p, const char *cp) |
|
Line 663 term_strlen(const struct termp *p, const char *cp) |
|
for (i = 0; i < rsz; i++) |
for (i = 0; i < rsz; i++) |
sz += cond_width(p, *cp++, &skip); |
sz += cond_width(p, *cp++, &skip); |
|
|
c = 0; |
|
switch (*cp) { |
switch (*cp) { |
case ('\\'): |
case ('\\'): |
cp++; |
cp++; |
Line 733 term_strlen(const struct termp *p, const char *cp) |
|
Line 736 term_strlen(const struct termp *p, const char *cp) |
|
case (ASCII_HYPH): |
case (ASCII_HYPH): |
sz += cond_width(p, '-', &skip); |
sz += cond_width(p, '-', &skip); |
cp++; |
cp++; |
|
/* FALLTHROUGH */ |
|
case (ASCII_BREAK): |
break; |
break; |
default: |
default: |
break; |
break; |