If the first character of the text file is not a `=', the code also assumes:
-2. Reference targets begin with a `:' at the left margin and are bounded
+2. Reference text may not begin with whitespace, single- or double-quote, nor
+ end with a semicolon.
+
+3. Reference targets begin with a `:' at the left margin and are bounded
on the right by another `:' (an optional second `:' may follow that).
-This second rule is useful for filtering out false hits from the index.
+These rules are useful for filtering out false hits from the index.
.SH FILES
A copy of vh called `foo' would require the following:
.TP 3.5i
long lnum = 1;
char refbuf[LNSZ + 1], *refpt = refbuf;
int c, len = 0, depth = 0;
+ bool goforit = FALSE;
/* time for consistency check */
initbrowse(name);
ungetc(c = fgetc(vht->fp), vht->fp);
if (isprint(c))
++depth;
+ goforit = (c != '"' && c != '\'' && !isspace(c));
}
else if (depth > 0 && c == RTAG)
{
++len;
--depth;
- if (depth == 0 && refpt != refbuf)
+ if (depth == 0 && refpt != refbuf && goforit && refpt[-1] != ';')
{
*refpt = '\0';
if (xlocate(refbuf) < 0)
(void) printf(DANGLING, name, TXT, lnum, refbuf);
- refpt = refbuf;
}
+ refpt = refbuf;
}
else if (depth != 0)
{