Blame texinfo-6.4-info-fix-possible-incorrect-selection-of-already-loaded-file.patch

0a4c5e3
diff -up texinfo-6.4/info/nodes.c.orig texinfo-6.4/info/nodes.c
0a4c5e3
--- texinfo-6.4/info/nodes.c.orig	2017-06-18 14:50:42.000000000 +0200
0a4c5e3
+++ texinfo-6.4/info/nodes.c	2017-07-10 09:39:10.195209219 +0200
0a4c5e3
@@ -678,6 +678,7 @@ info_find_subfile (char *fullpath)
0a4c5e3
   char *with_extension = 0;
0a4c5e3
   int i;
0a4c5e3
   FILE_BUFFER *file_buffer = 0;
0a4c5e3
+  int fullpath_len = strlen (fullpath);
0a4c5e3
 
0a4c5e3
   /* First try to find the file in our list of already loaded files. */
0a4c5e3
   if (info_loaded_files)
0a4c5e3
@@ -685,7 +686,9 @@ info_find_subfile (char *fullpath)
0a4c5e3
       for (i = 0; (file_buffer = info_loaded_files[i]); i++)
0a4c5e3
         /* Check if fullpath starts the name of the recorded file (extra
0a4c5e3
            extensions like ".info.gz" could be added.) */
0a4c5e3
-        if (!strncmp (file_buffer->fullpath, fullpath, strlen (fullpath)))
0a4c5e3
+        if (!strncmp (file_buffer->fullpath, fullpath, fullpath_len)
0a4c5e3
+            && (file_buffer->fullpath[fullpath_len] == '\0'
0a4c5e3
+                || file_buffer->fullpath[fullpath_len] == '.'))
0a4c5e3
           {
0a4c5e3
             struct stat new_info, *old_info;
0a4c5e3