summaryrefslogtreecommitdiff
path: root/gnu/usr.bin/cvs/diff/diff3.c
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/usr.bin/cvs/diff/diff3.c')
-rw-r--r--gnu/usr.bin/cvs/diff/diff3.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/gnu/usr.bin/cvs/diff/diff3.c b/gnu/usr.bin/cvs/diff/diff3.c
index 65b783b3e67..e3be1503e86 100644
--- a/gnu/usr.bin/cvs/diff/diff3.c
+++ b/gnu/usr.bin/cvs/diff/diff3.c
@@ -457,13 +457,15 @@ diff3_run (argc, argv, out, callbacks_arg)
tag_strings[0], tag_strings[1], tag_strings[2]);
else if (merge)
{
- if (! freopen (file[rev_mapping[FILE0]], "r", stdin))
+ FILE *mfp = fopen (file[rev_mapping[FILE0]], "r");
+ if (! mfp)
diff3_perror_with_exit (file[rev_mapping[FILE0]]);
- conflicts_found
- = output_diff3_merge (stdin, diff3, mapping, rev_mapping,
+ conflicts_found = output_diff3_merge (mfp, diff3, mapping, rev_mapping,
tag_strings[0], tag_strings[1], tag_strings[2]);
- if (ferror (stdin))
+ if (ferror (mfp))
diff3_fatal ("read error");
+ if (fclose(mfp) != 0)
+ perror_with_name (file[rev_mapping[FILE0]]);
}
else
{