[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Info reader fails to find cross-references to anchors
From: |
Gavin Smith |
Subject: |
Re: Info reader fails to find cross-references to anchors |
Date: |
Sat, 18 Jul 2015 16:41:10 +0100 |
On 18 July 2015 at 09:57, Eli Zaretskii <address@hidden> wrote:
> There was one more problem with this in Texinfo 6.0, which seems to be
> specific to MS-Windows: find_node_from_tag unconditionally overwrites
> the nodelen value of tags for anchors with -1, thus losing the only
> indication it has that the tag entry is an anchor. This caused any
> cross-reference to an anchor to fail.
>
> I fixed this in Texinfo 6.0 like this:
>
> - (*t)->nodelen = -1;
> + /* NODELEN zero means this is an anchor, so this value
> + doesn't need to be adjusted, and we shouldn't lose it, as
> + it's the only indication of an anchor. */
> + if ((*t)->nodelen != 0)
> + (*t)->nodelen = -1;
>
> The current trunk introduced a cache, and does that for the cached
> entry, but I believe a similar change is still due, i.e. n->nodelen
> should only be set to -1 for non-anchor tag entries.
You mean like this?
I think this is right, the fact that more data is being shared between
nodes displayed in windows and in window histories doesn't change the
point that much.
The property of being an anchor should probably be expressed through a
flag instead of reusing the nodelen field.
Index: info/nodes.c
===================================================================
--- info/nodes.c (revision 6436)
+++ info/nodes.c (working copy)
@@ -1204,13 +1204,15 @@ find_node_from_tag (FILE_BUFFER *parent, FILE_BUFF
if (!FILENAME_CMP ((*t)->filename, fb->fullpath))
{
NODE *n = &(*t)->cache;
+ int is_anchor = n->nodelen == 0;
(*t)->nodestart_adjusted = -1;
if (n->flags & N_WasRewritten)
free (n->contents);
info_free_references (n->references);
free (n->next); free (n->prev); free (n->up);
memset (n, 0, sizeof (NODE));
- n->nodelen = -1;
+ if (!is_anchor)
+ n->nodelen = -1;
}
}
- Info reader fails to find cross-references to anchors, Eli Zaretskii, 2015/07/18
- Re: Info reader fails to find cross-references to anchors,
Gavin Smith <=
- Re: Info reader fails to find cross-references to anchors, Eli Zaretskii, 2015/07/18
- Re: Info reader fails to find cross-references to anchors, Gavin Smith, 2015/07/18
- Re: Info reader fails to find cross-references to anchors, Eli Zaretskii, 2015/07/18
- Re: Info reader fails to find cross-references to anchors, Gavin Smith, 2015/07/18
- Re: Info reader fails to find cross-references to anchors, Eli Zaretskii, 2015/07/18
- Re: Info reader fails to find cross-references to anchors, Gavin Smith, 2015/07/18
- Re: Info reader fails to find cross-references to anchors, Eli Zaretskii, 2015/07/19