File: upstream-c0666e580a-fix-makeinfo-dash-input

package info (click to toggle)
texinfo 6.8-6
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 87,432 kB
  • sloc: perl: 965,271; ansic: 73,778; sh: 15,687; xml: 6,964; makefile: 3,391; awk: 2,190; javascript: 1,870; lisp: 213; sed: 78; pascal: 63
file content (33 lines) | stat: -rw-r--r-- 804 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
Description: Fix for makeinfo reading from - (stdin).
Origin: Gavin Smith <gavinsmith0123@gmail.com>
Forwarded: No. Comes from upstream.
Author: Gavin Smith <gavinsmith0123@gmail.com>
Last-Update: 20210706

---
 tp/Texinfo/XS/parsetexi/input.c |   13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

--- a/tp/Texinfo/XS/parsetexi/input.c
+++ b/tp/Texinfo/XS/parsetexi/input.c
@@ -560,11 +560,16 @@ locate_include_file (char *filename)
 int
 input_push_file (char *filename)
 {
-  FILE *stream;
+  FILE *stream = 0;
 
-  stream = fopen (filename, "r");
-  if (!stream)
-    return errno;
+  if (!strcmp (filename, "-"))
+    stream = stdin;
+  else
+    {
+      stream = fopen (filename, "r");
+      if (!stream)
+        return errno;
+    }
 
   if (input_number == input_space)
     {