From a05c0716c256a95861c01d06b5319f3149fca33a Mon Sep 17 00:00:00 2001 From: Denis Vlasenko Date: Sat, 7 Jun 2008 05:19:31 +0000 Subject: 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 --- editors/diff.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'editors') 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) rval = D_SAME; if (flags & D_EMPTY1) - f1 = xfopen(bb_dev_null, "r"); + /* can't be stdin, but xfopen_stdin() is smaller code */ + f1 = xfopen_stdin(bb_dev_null); else f1 = xfopen_stdin(file1); if (flags & D_EMPTY2) - f2 = xfopen(bb_dev_null, "r"); + f2 = xfopen_stdin(bb_dev_null); else f2 = xfopen_stdin(file2); -- cgit v1.2.3