version 1.312, 2017/06/14 22:51:25 |
version 1.314, 2017/06/17 23:07:00 |
Line 1166 roff_res(struct roff *r, struct buf *buf, int ln, int |
|
Line 1166 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 mdoc_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 */ |
Line 1183 roff_res(struct roff *r, struct buf *buf, int ln, int |
|
Line 1184 roff_res(struct roff *r, struct buf *buf, int ln, int |
|
stesc++; |
stesc++; |
if (*stesc != '"' && *stesc != '#') |
if (*stesc != '"' && *stesc != '#') |
continue; |
continue; |
|
|
|
/* Comment found, look for RCS id. */ |
|
|
|
if ((cp = strstr(stesc, "$" "OpenBSD")) != NULL) { |
|
os_e = MDOC_OS_OPENBSD; |
|
cp += 8; |
|
} else if ((cp = strstr(stesc, "$" "NetBSD")) != NULL) { |
|
os_e = MDOC_OS_NETBSD; |
|
cp += 7; |
|
} |
|
if (cp != NULL && |
|
isalnum((unsigned char)*cp) == 0 && |
|
strchr(cp, '$') != NULL) { |
|
if (r->man->meta.rcsids & (1 << os_e)) |
|
mandoc_msg(MANDOCERR_RCS_REP, r->parse, |
|
ln, stesc + 1 - buf->buf, stesc + 1); |
|
r->man->meta.rcsids |= 1 << os_e; |
|
} |
|
|
|
/* Handle trailing whitespace. */ |
|
|
cp = strchr(stesc--, '\0') - 1; |
cp = strchr(stesc--, '\0') - 1; |
if (*cp == '\n') { |
if (*cp == '\n') { |
done = 1; |
done = 1; |