texinfo-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

branch master updated: * tp/Texinfo/XS/parsetexi/input.c (input_push_fil


From: Patrice Dumas
Subject: branch master updated: * tp/Texinfo/XS/parsetexi/input.c (input_push_file): use save_string if needed on input filename to store the path in input_file_path.
Date: Sat, 24 Feb 2024 11:10:49 -0500

This is an automated email from the git hooks/post-receive script.

pertusus pushed a commit to branch master
in repository texinfo.

The following commit(s) were added to refs/heads/master by this push:
     new f02b75d8eb * tp/Texinfo/XS/parsetexi/input.c (input_push_file): use 
save_string if needed on input filename to store the path in input_file_path.
f02b75d8eb is described below

commit f02b75d8ebb10dab54fd29a9f527cb64b0ded775
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Sat Feb 24 17:10:45 2024 +0100

    * tp/Texinfo/XS/parsetexi/input.c (input_push_file): use save_string
    if needed on input filename to store the path in input_file_path.
---
 ChangeLog                       |  5 +++++
 tp/Texinfo/XS/parsetexi/input.c | 13 ++++++++++---
 2 files changed, 15 insertions(+), 3 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 477a0198c4..80e2ad0003 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2024-02-24  Patrice Dumas  <pertusus@free.fr>
+
+       * tp/Texinfo/XS/parsetexi/input.c (input_push_file): use save_string
+       if needed on input filename to store the path in input_file_path.
+
 2024-02-24  Patrice Dumas  <pertusus@free.fr>
 
        Add const.
diff --git a/tp/Texinfo/XS/parsetexi/input.c b/tp/Texinfo/XS/parsetexi/input.c
index f3ed051f39..c706ad01ec 100644
--- a/tp/Texinfo/XS/parsetexi/input.c
+++ b/tp/Texinfo/XS/parsetexi/input.c
@@ -623,6 +623,7 @@ input_push_file (char *filename)
   FILE *stream = 0;
   char *p, *q;
   char *base_filename;
+  char *stored_file_path;
 
   if (!strcmp (filename, "-"))
     stream = stdin;
@@ -649,13 +650,19 @@ input_push_file (char *filename)
       q = strchr (q + 1, '/');
     }
   if (p)
-    base_filename = save_string (p+1);
+    {
+      base_filename = save_string (p+1);
+      stored_file_path = save_string (filename);
+    }
   else
-    base_filename = save_string (filename);
+    {
+      base_filename = save_string (filename);
+      stored_file_path = base_filename;
+    }
 
   input_stack[input_number].type = IN_file;
   input_stack[input_number].file = stream;
-  input_stack[input_number].input_file_path = filename;
+  input_stack[input_number].input_file_path = stored_file_path;
   input_stack[input_number].source_info.file_name = base_filename;
   input_stack[input_number].source_info.line_nr = 0;
   input_stack[input_number].source_info.macro = 0;



reply via email to

[Prev in Thread] Current Thread [Next in Thread]