On Sat, 26 Feb 2000, Horst von Brand wrote:

> Yes, I just tried with the stock texinfo version from GNU, compiled with -g
> using gcc-2.95.2. The same problem happens when compiled with egcs-1.1.2-24
> or egcs-20000221; and also for the RH texinfo versions 4.0-4 and
> 3.12h-2. Problem turned out to be a leftover dir.info file which ends just
> after the "* Menu:" line, with an existing (and correct) dir file.

The patch below prevents Info from crashing in the case where
there's both `dir' and `dir.info' file in the same directory.

Btw, there seems to be some inconsistency in the way Info looks for
DIR files: it uses the general-purpose function info_find_file, but
then adds some special search loop on top of that.  (See the function
maybe_build_dir_node in dir.c, for details.)  That special loop
doesn't try all the extensions and compression suffixes as with normal
Info files.  This has some surprising consequences.  For example,
`dir.gz' is only supported if it happens to be in the first directory
in INFOPATH.  Also, if the first directory has both `dir.info' and
`dir.gz', the latter won't be picked up.

It seems like we need a special-purpose function to look for DIR
files, because that search is different from normal files (we want ALL
the DIR files, not just the first one).  Do you agree?

If you do agree, then the next question is: do we want all the DIR
files in each directory on INFOPATH, or just one file in each
directory?  For example, if some directory has `dir', `dir.gz', and
`dir.info', do we want to load them all?



2000-03-21  Eli Zaretskii  <[EMAIL PROTECTED]>

        * info/nodes.c (info_find_file_internal): If file_buffer has its
        CannotGC flag set, treat it as a DIR node.

--- info/nodes.c~0      Sun Aug 15 13:18:08 1999
+++ info/nodes.c        Tue Mar 21 19:17:14 2000
@@ -232,7 +232,11 @@ info_find_file_internal (filename, get_t
 
             /* This file is loaded.  If the filename that we want is
                specifically "dir", then simply return the file buffer. */
-            if (is_dir_name (filename_non_directory (filename)))
+            if (is_dir_name (filename_non_directory (filename))
+               /* This additional clause makes sure that we don't miss
+                  a DIR node just because it has some funny file name,
+                  like "dir.info", scribbled on it.  */
+               || (file_buffer->flags & N_CannotGC) != 0)
               return file_buffer;
 
 #if defined (HANDLE_MAN_PAGES)

Reply via email to