Re: info utility: buggy resolution of cross references

Vincent Lefevre <[email protected]>
Newsgroups gmane.comp.tex.texinfo.bugs
Message-ID <[email protected]>
On 2026-02-23 20:46:15 +0000, Gavin Smith wrote:
> I tested this with a directory that contained just info-stnd.info 
> and an empty file called "texinfo", with the link from info-stnd.info
> to the "texinfo" manual.  (I don't have info.info on my system as
> this file is distributed with Emacs and I am not an Emacs user.)

Sorry, I got confused. I've just noticed that when I type
"info info", I actually get "info-stnd.info" instead of
"info.info". If order to get "info.info", I need to type
"info info.info". This implicit ".info" is really misleading.

Moreover, after just typing "info", I get a menu with

[...]
Texinfo documentation system
* Info: (info).                 How to use the documentation browsing system.
* Texinfo: (texinfo).           The GNU documentation format.
* info stand-alone: (info-stnd).
                                Read Info documents without Emacs.
[...]

and here, "info" corresponds to "info.info" as expected.

And the fact that "info.info" comes from Emacs is also misleading
(perhaps they should change that).

So I actually intended to copy "/usr/share/info/info-stnd.info.gz".

> In Texinfo 7.2, the call is made to info_find_file with the argument
> "./texinfo", which then calls info_load_file, which fails and returns
> a null argument.  The calling code in info_get_node_with_defaults
> then searches for the file with the search path as usual, which leads
> the file to be found in the Info installation directory.
> 
> In the development code (and 7.2.92) the code has been moved around
> somewhat and info_find_file and info_load_file aren't called.
> 
> If you can check the following works in your testing, we can commit
> it and include it in the next release (hopefully in the next few
> days).
> 
> diff --git a/info/session-cmd.c b/info/session-cmd.c
> index 20821d194c..d090b7a156 100644
> --- a/info/session-cmd.c
> +++ b/info/session-cmd.c
> @@ -1144,7 +1144,13 @@ filename_for_xref (char *filename_in, NODE *defaults)
>                                         defaults->fullpath, 0);
>                    *p = saved_char;
>                    if (file_in_same_dir)
> -                    filename = file_in_same_dir;
> +                    {
> +                      /* Ensure file can be loaded and at least looks
> +                         like an Info file. */
> +                      FILE_BUFFER *fb2 = info_find_file (file_in_same_dir);
> +                      if (fb2)
> +                        filename = file_in_same_dir;
> +                    }
>                  }
>              }
>          }

This works. Thanks.

-- 
Vincent Lefèvre <[email protected]> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / Pascaline project (LIP, ENS-Lyon)
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.