From 88a72857d93404b78081f9247cb1d1ef76e030c5 Mon Sep 17 00:00:00 2001 From: Otto Moerbeek Date: Tue, 30 Sep 2003 18:27:02 +0000 Subject: Flush stdout after P operator. Improves interaction with bc(1). --- usr.bin/dc/bcode.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/usr.bin/dc/bcode.c b/usr.bin/dc/bcode.c index 8948abfd780..e3c34d48850 100644 --- a/usr.bin/dc/bcode.c +++ b/usr.bin/dc/bcode.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bcode.c,v 1.6 2003/09/28 19:15:53 otto Exp $ */ +/* $OpenBSD: bcode.c,v 1.7 2003/09/30 18:27:01 otto Exp $ */ /* * Copyright (c) 2003, Otto Moerbeek @@ -17,7 +17,7 @@ */ #ifndef lint -static const char rcsid[] = "$OpenBSD: bcode.c,v 1.6 2003/09/28 19:15:53 otto Exp $"; +static const char rcsid[] = "$OpenBSD: bcode.c,v 1.7 2003/09/30 18:27:01 otto Exp $"; #endif /* not lint */ #include @@ -452,9 +452,11 @@ pop_print(void) case BCODE_NUMBER: normalize(value->u.num, 0); print_ascii(stdout, value->u.num); + fflush(stdout); break; case BCODE_STRING: - printf("%s", value->u.string); + fputs(value->u.string, stdout); + fflush(stdout); break; } stack_free_value(value); -- cgit v1.2.3