Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.busybox.net/busybox.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'editors')
-rw-r--r--editors/diff.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/editors/diff.c b/editors/diff.c
index a78a0ee28..c3ad31bf3 100644
--- a/editors/diff.c
+++ b/editors/diff.c
@@ -740,9 +740,10 @@ static int diffreg(char *file[2])
unlink(name);
if (bb_copyfd_eof(fd, fd_tmp) < 0)
xfunc_die();
- if (fd) /* Prevents closing of stdin */
+ if (fd != STDIN_FILENO)
close(fd);
fd = fd_tmp;
+ xlseek(fd, 0, SEEK_SET);
}
fp[i] = fdopen(fd, "r");
}