diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2015-01-11 16:41:54 +0100 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2015-01-11 16:41:54 +0100 |
commit | 39f017293a047ac1063c84263d4d855b86c62ba1 (patch) | |
tree | 688381313ce2ba8db50ee58e8d5007462fa9e9c4 /editors | |
parent | 70f4320b40b7af83525cebabab2bc437a22c41d2 (diff) | |
download | busybox-w32-39f017293a047ac1063c84263d4d855b86c62ba1.tar.gz busybox-w32-39f017293a047ac1063c84263d4d855b86c62ba1.tar.bz2 busybox-w32-39f017293a047ac1063c84263d4d855b86c62ba1.zip |
diff: fix a bug in diffing against stdin. Closes 7784
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'editors')
-rw-r--r-- | editors/diff.c | 3 |
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]) | |||
740 | unlink(name); | 740 | unlink(name); |
741 | if (bb_copyfd_eof(fd, fd_tmp) < 0) | 741 | if (bb_copyfd_eof(fd, fd_tmp) < 0) |
742 | xfunc_die(); | 742 | xfunc_die(); |
743 | if (fd) /* Prevents closing of stdin */ | 743 | if (fd != STDIN_FILENO) |
744 | close(fd); | 744 | close(fd); |
745 | fd = fd_tmp; | 745 | fd = fd_tmp; |
746 | xlseek(fd, 0, SEEK_SET); | ||
746 | } | 747 | } |
747 | fp[i] = fdopen(fd, "r"); | 748 | fp[i] = fdopen(fd, "r"); |
748 | } | 749 | } |