version 1.322, 2017/07/13 15:13:18 |
version 1.324, 2017/07/14 17:16:16 |
Line 1127 roff_res(struct roff *r, struct buf *buf, int ln, int |
|
Line 1127 roff_res(struct roff *r, struct buf *buf, int ln, int |
|
size_t maxl; /* expected length of the escape name */ |
size_t maxl; /* expected length of the escape name */ |
size_t naml; /* actual length of the escape name */ |
size_t naml; /* actual length of the escape name */ |
enum mandoc_esc esc; /* type of the escape sequence */ |
enum mandoc_esc esc; /* type of the escape sequence */ |
enum mandoc_os os_e; /* kind of RCS id seen */ |
|
int inaml; /* length returned from mandoc_escape() */ |
int inaml; /* length returned from mandoc_escape() */ |
int expand_count; /* to avoid infinite loops */ |
int expand_count; /* to avoid infinite loops */ |
int npos; /* position in numeric expression */ |
int npos; /* position in numeric expression */ |
int arg_complete; /* argument not interrupted by eol */ |
int arg_complete; /* argument not interrupted by eol */ |
int done; /* no more input available */ |
int done; /* no more input available */ |
int deftype; /* type of definition to paste */ |
int deftype; /* type of definition to paste */ |
|
int rcsid; /* kind of RCS id seen */ |
char term; /* character terminating the escape */ |
char term; /* character terminating the escape */ |
|
|
/* Search forward for comments. */ |
/* Search forward for comments. */ |
Line 1149 roff_res(struct roff *r, struct buf *buf, int ln, int |
|
Line 1149 roff_res(struct roff *r, struct buf *buf, int ln, int |
|
|
|
/* Comment found, look for RCS id. */ |
/* Comment found, look for RCS id. */ |
|
|
|
rcsid = 0; |
if ((cp = strstr(stesc, "$" "OpenBSD")) != NULL) { |
if ((cp = strstr(stesc, "$" "OpenBSD")) != NULL) { |
os_e = MANDOC_OS_OPENBSD; |
rcsid = 1 << MANDOC_OS_OPENBSD; |
cp += 8; |
cp += 8; |
} else if ((cp = strstr(stesc, "$" "NetBSD")) != NULL) { |
} else if ((cp = strstr(stesc, "$" "NetBSD")) != NULL) { |
os_e = MANDOC_OS_NETBSD; |
rcsid = 1 << MANDOC_OS_NETBSD; |
cp += 7; |
cp += 7; |
} |
} |
if (cp != NULL && |
if (cp != NULL && |
isalnum((unsigned char)*cp) == 0 && |
isalnum((unsigned char)*cp) == 0 && |
strchr(cp, '$') != NULL) { |
strchr(cp, '$') != NULL) { |
if (r->man->meta.rcsids & (1 << os_e)) |
if (r->man->meta.rcsids & rcsid) |
mandoc_msg(MANDOCERR_RCS_REP, r->parse, |
mandoc_msg(MANDOCERR_RCS_REP, r->parse, |
ln, stesc + 1 - buf->buf, stesc + 1); |
ln, stesc + 1 - buf->buf, stesc + 1); |
r->man->meta.rcsids |= 1 << os_e; |
r->man->meta.rcsids |= rcsid; |
} |
} |
|
|
/* Handle trailing whitespace. */ |
/* Handle trailing whitespace. */ |
Line 1558 roff_parseln(struct roff *r, int ln, struct buf *buf, |
|
Line 1559 roff_parseln(struct roff *r, int ln, struct buf *buf, |
|
/* For now, let high level macros abort .ce mode. */ |
/* For now, let high level macros abort .ce mode. */ |
|
|
if (ctl && roffce_node != NULL && |
if (ctl && roffce_node != NULL && |
(t == TOKEN_NONE || t == ROFF_EQ || t == ROFF_TS)) { |
(t == TOKEN_NONE || t == ROFF_Dd || t == ROFF_EQ || |
|
t == ROFF_TH || t == ROFF_TS)) { |
r->man->last = roffce_node; |
r->man->last = roffce_node; |
r->man->next = ROFF_NEXT_SIBLING; |
r->man->next = ROFF_NEXT_SIBLING; |
roffce_lines = 0; |
roffce_lines = 0; |