Subject: Re: HEADS UP: texinfo-4.7 imported
To: enami tsugutomo <enami@but-b.or.jp>
From: Thomas Klausner <wiz@NetBSD.org>
List: current-users
Date: 07/14/2004 00:04:43
--9jxsPFA5p3P2qPhR
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

On Wed, Jul 14, 2004 at 05:22:30AM +0900, enami tsugutomo wrote:
> > 1) fix makeinfo to not do that (I've mailed bugs-texinfo about it)
> 
> IMHO find_and_load() called from handle_delayed_writes() should not
> use include path at all.

The attached patch follows your idea and seems to fix the problem.
Thank you!

Should I commit this?
 Thomas

--9jxsPFA5p3P2qPhR
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="find_file_in_path.diff"

Index: cmds.c
===================================================================
RCS file: /cvsroot/src/gnu/dist/texinfo/makeinfo/cmds.c,v
retrieving revision 1.1.1.5
diff -u -r1.1.1.5 cmds.c
--- cmds.c	12 Jul 2004 23:26:51 -0000	1.1.1.5
+++ cmds.c	13 Jul 2004 22:00:32 -0000
@@ -1634,7 +1634,7 @@
       fflush (stdout);
     }
 
-  if (!find_and_load (filename))
+  if (!find_and_load (filename, 1))
     {
       popfile ();
       line_number--;
Index: files.c
===================================================================
RCS file: /cvsroot/src/gnu/dist/texinfo/makeinfo/files.c,v
retrieving revision 1.6
diff -u -r1.6 files.c
--- files.c	12 Jul 2004 23:41:53 -0000	1.6
+++ files.c	13 Jul 2004 22:00:32 -0000
@@ -187,7 +187,7 @@
 /* Find and load the file named FILENAME.  Return a pointer to
    the loaded file, or NULL if it can't be loaded. */
 char *
-find_and_load (char *filename)
+find_and_load (char *filename, int use_path)
 {
   struct stat fileinfo;
   long file_size;
@@ -197,7 +197,10 @@
 
   result = fullpath = NULL;
 
-  fullpath = get_file_info_in_path (filename, include_files_path, &fileinfo);
+  if (use_path)
+    fullpath = get_file_info_in_path (filename, include_files_path, &fileinfo);
+  else
+    fullpath = get_file_info_in_path (filename, NULL, &fileinfo);
 
   if (!fullpath)
     goto error_exit;
@@ -684,7 +687,7 @@
 
   while (temp)
     {
-      delayed_buf = find_and_load (temp->filename);
+      delayed_buf = find_and_load (temp->filename, 0);
 
       if (output_paragraph_offset > 0)
         {
Index: files.h
===================================================================
RCS file: /cvsroot/src/gnu/dist/texinfo/makeinfo/files.h,v
retrieving revision 1.1.1.4
diff -u -r1.1.1.4 files.h
--- files.h	12 Jul 2004 23:26:51 -0000	1.1.1.4
+++ files.h	13 Jul 2004 22:00:32 -0000
@@ -41,7 +41,7 @@
 extern void flush_file_stack (void);
 extern char *get_file_info_in_path (char *filename, char *path,
     struct stat *finfo);
-extern char *find_and_load (char *filename);
+extern char *find_and_load (char *filename, int use_path);
 extern char *output_name_from_input_name (char *name);
 extern char *expand_filename (char *filename, char *input_name);
 extern char *filename_part (char *filename);
Index: makeinfo.c
===================================================================
RCS file: /cvsroot/src/gnu/dist/texinfo/makeinfo/makeinfo.c,v
retrieving revision 1.11
diff -u -r1.11 makeinfo.c
--- makeinfo.c	12 Jul 2004 23:41:53 -0000	1.11
+++ makeinfo.c	13 Jul 2004 22:00:33 -0000
@@ -1338,7 +1338,7 @@
       strcpy (filename, name);
       strcat (filename, suffixes[i]);
 
-      if (find_and_load (filename))
+      if (find_and_load (filename, 1))
         break;
 
       if (!suffixes[i][0] && strrchr (filename, '.'))
@@ -3934,7 +3934,7 @@
 
   /* If insertion stack level changes during execution, that means a multiline
      command is used inside braces or @section ... kind of commands.  */
-  if (insertion_level_at_start != insertion_level)
+  if (insertion_level_at_start != insertion_level && !executing_macro)
     {
       line_error (_("Multiline command %c%s used improperly"),
           COMMAND_PREFIX,
Index: node.c
===================================================================
RCS file: /cvsroot/src/gnu/dist/texinfo/makeinfo/node.c,v
retrieving revision 1.1.1.5
diff -u -r1.1.1.5 node.c
--- node.c	12 Jul 2004 23:26:49 -0000	1.1.1.5
+++ node.c	13 Jul 2004 22:00:33 -0000
@@ -1717,7 +1717,7 @@
     return;
   file_size = (long) fileinfo.st_size;
 
-  the_file = find_and_load (filename);
+  the_file = find_and_load (filename, 1);
   if (!the_file)
     return;
 

--9jxsPFA5p3P2qPhR--