=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/mandoc/roff.c,v retrieving revision 1.194 retrieving revision 1.195 diff -c -r1.194 -r1.195 *** src/usr.bin/mandoc/roff.c 2017/07/13 15:12:47 1.194 --- src/usr.bin/mandoc/roff.c 2017/07/14 16:49:16 1.195 *************** *** 1,4 **** ! /* $OpenBSD: roff.c,v 1.194 2017/07/13 15:12:47 schwarze Exp $ */ /* * Copyright (c) 2008-2012, 2014 Kristaps Dzonsons * Copyright (c) 2010-2015, 2017 Ingo Schwarze --- 1,4 ---- ! /* $OpenBSD: roff.c,v 1.195 2017/07/14 16:49:16 schwarze Exp $ */ /* * Copyright (c) 2008-2012, 2014 Kristaps Dzonsons * Copyright (c) 2010-2015, 2017 Ingo Schwarze *************** *** 1125,1137 **** size_t maxl; /* expected 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_os os_e; /* kind of RCS id seen */ int inaml; /* length returned from mandoc_escape() */ int expand_count; /* to avoid infinite loops */ int npos; /* position in numeric expression */ int arg_complete; /* argument not interrupted by eol */ int done; /* no more input available */ int deftype; /* type of definition to paste */ char term; /* character terminating the escape */ /* Search forward for comments. */ --- 1125,1137 ---- size_t maxl; /* expected length of the escape name */ size_t naml; /* actual length of the escape name */ enum mandoc_esc esc; /* type of the escape sequence */ int inaml; /* length returned from mandoc_escape() */ int expand_count; /* to avoid infinite loops */ int npos; /* position in numeric expression */ int arg_complete; /* argument not interrupted by eol */ int done; /* no more input available */ int deftype; /* type of definition to paste */ + int rcsid; /* kind of RCS id seen */ char term; /* character terminating the escape */ /* Search forward for comments. */ *************** *** 1147,1166 **** /* Comment found, look for RCS id. */ if ((cp = strstr(stesc, "$" "OpenBSD")) != NULL) { ! os_e = MANDOC_OS_OPENBSD; cp += 8; } else if ((cp = strstr(stesc, "$" "NetBSD")) != NULL) { ! os_e = MANDOC_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. */ --- 1147,1167 ---- /* Comment found, look for RCS id. */ + rcsid = 0; if ((cp = strstr(stesc, "$" "OpenBSD")) != NULL) { ! rcsid = 1 << MANDOC_OS_OPENBSD; cp += 8; } else if ((cp = strstr(stesc, "$" "NetBSD")) != NULL) { ! rcsid = 1 << MANDOC_OS_NETBSD; cp += 7; } if (cp != NULL && isalnum((unsigned char)*cp) == 0 && strchr(cp, '$') != NULL) { ! if (r->man->meta.rcsids & rcsid) mandoc_msg(MANDOCERR_RCS_REP, r->parse, ln, stesc + 1 - buf->buf, stesc + 1); ! r->man->meta.rcsids |= rcsid; } /* Handle trailing whitespace. */