[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[no subject]
From: |
Gavin D. Smith |
Date: |
Tue, 15 Oct 2024 11:37:36 -0400 (EDT) |
branch: master
commit bbde7b23cf28b2aa8a880014700e01c1d8f866e3
Author: Gavin Smith <gavinsmith0123@gmail.com>
AuthorDate: Tue Oct 15 12:30:09 2024 +0100
* install-info/install-info.c (open_possibly_compressed_file):
Correct check of return value of freopen.
Report from Vitezslav Crhonek <vcrhonek@redhat.com>.
---
ChangeLog | 7 +++++++
install-info/install-info.c | 6 ++----
2 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 23dcbac94f..aa135ef00e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2024-10-15 Gavin Smith <gavinsmith0123@gmail.com>
+
+ * install-info/install-info.c (open_possibly_compressed_file):
+ Correct check of return value of freopen.
+
+ Report from Vitezslav Crhonek <vcrhonek@redhat.com>.
+
2024-10-13 Patrice Dumas <pertusus@free.fr>
* tp/Texinfo/XS/configure.ac (HAVE_USABLE_GETENV_IN_XS): redirect
diff --git a/install-info/install-info.c b/install-info/install-info.c
index 9cd909434f..adbe461442 100644
--- a/install-info/install-info.c
+++ b/install-info/install-info.c
@@ -826,15 +826,13 @@ determine_file_type:
/* Redirect stdin to the file and fork the decompression process
reading from stdin. This allows shell metacharacters in filenames. */
char *command = concat (*compression_program, " -d", "");
- FILE *f2;
if (fclose (f) < 0)
return 0;
- f2 = freopen (*opened_filename, FOPEN_RBIN, stdin);
- if (!f)
+ if (!freopen (*opened_filename, FOPEN_RBIN, stdin))
return 0;
f = popen (command, "r");
- fclose (f2);
+ fclose (stdin);
if (!f)
{
/* Used for error message in calling code. */