summaryrefslogtreecommitdiff
path: root/usr.bin/patch/patch.c
diff options
context:
space:
mode:
authorRay Lai <ray@cvs.openbsd.org>2010-07-24 01:10:13 +0000
committerRay Lai <ray@cvs.openbsd.org>2010-07-24 01:10:13 +0000
commit4ff122cabee18c69a6023687a3824b28bb688472 (patch)
tree6d82735d85be4f281444431c8d192e3f0f6c427f /usr.bin/patch/patch.c
parentc971356bce47316681a8d3748dba7d6aba972df9 (diff)
Send normal output to stdout instead of everything to stderr. This
is currently done in the latest versions of GNU patch. Please watch out for output appearing out-of-order. Discussed with millert and deraadt. OK deraadt
Diffstat (limited to 'usr.bin/patch/patch.c')
-rw-r--r--usr.bin/patch/patch.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/usr.bin/patch/patch.c b/usr.bin/patch/patch.c
index d95f5c05007..19e41c42295 100644
--- a/usr.bin/patch/patch.c
+++ b/usr.bin/patch/patch.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: patch.c,v 1.48 2009/10/27 23:59:41 deraadt Exp $ */
+/* $OpenBSD: patch.c,v 1.49 2010/07/24 01:10:12 ray Exp $ */
/*
* patch - a program to apply diffs to original files
@@ -109,9 +109,6 @@ static bool reverse_flag_specified = false;
/* buffer holding the name of the rejected patch file. */
static char rejname[NAME_MAX + 1];
-/* buffer for stderr */
-static char serrbuf[BUFSIZ];
-
/* how many input lines have been irretractibly output */
static LINENUM last_frozen_line = 0;
@@ -150,7 +147,8 @@ main(int argc, char *argv[])
const char *tmpdir;
char *v;
- setbuf(stderr, serrbuf);
+ setlinebuf(stdout);
+ setlinebuf(stderr);
for (i = 0; i < MAXFILEC; i++)
filearg[i] = NULL;