diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2008-06-07 05:19:31 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2008-06-07 05:19:31 +0000 |
commit | a05c0716c256a95861c01d06b5319f3149fca33a (patch) | |
tree | 0d877b4070cd8228e19146365a7888b7305bc6ff /editors/diff.c | |
parent | 401de648a797c5931df1ade02c26270c82c3a345 (diff) | |
download | busybox-w32-a05c0716c256a95861c01d06b5319f3149fca33a.tar.gz busybox-w32-a05c0716c256a95861c01d06b5319f3149fca33a.tar.bz2 busybox-w32-a05c0716c256a95861c01d06b5319f3149fca33a.zip |
grep: make "-f -" work (+ testsuite)
diff: small code shrink
function old new delta
grep_main 722 714 -8
diffreg 1825 1793 -32
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 0/2 up/down: 0/-40) Total: -40 bytes
Diffstat (limited to 'editors/diff.c')
-rw-r--r-- | editors/diff.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/editors/diff.c b/editors/diff.c index eac4b08c5..4e51f6f76 100644 --- a/editors/diff.c +++ b/editors/diff.c | |||
@@ -1021,11 +1021,12 @@ static unsigned diffreg(char *file1, char *file2, int flags) | |||
1021 | rval = D_SAME; | 1021 | rval = D_SAME; |
1022 | 1022 | ||
1023 | if (flags & D_EMPTY1) | 1023 | if (flags & D_EMPTY1) |
1024 | f1 = xfopen(bb_dev_null, "r"); | 1024 | /* can't be stdin, but xfopen_stdin() is smaller code */ |
1025 | f1 = xfopen_stdin(bb_dev_null); | ||
1025 | else | 1026 | else |
1026 | f1 = xfopen_stdin(file1); | 1027 | f1 = xfopen_stdin(file1); |
1027 | if (flags & D_EMPTY2) | 1028 | if (flags & D_EMPTY2) |
1028 | f2 = xfopen(bb_dev_null, "r"); | 1029 | f2 = xfopen_stdin(bb_dev_null); |
1029 | else | 1030 | else |
1030 | f2 = xfopen_stdin(file2); | 1031 | f2 = xfopen_stdin(file2); |
1031 | 1032 | ||