Skip to content

Commit

Permalink
Nathan Weeks raised an issue with Aharon Robbins, pointing out that B…
Browse files Browse the repository at this point in the history
…WK awk

accepts an empty string or no parameters to denote flush-all-output.  Aharon
cc'd me for response.  I'd not known this, but discovered mawk does that too.
However mawk didn't propagate an inadvertant I/O error from a real fflush up.
It did an error exit.  For consistency with gawk/BWK, I got rid of the exit
and propagated the error up.
  • Loading branch information
ThomasDickey committed Nov 29, 2012
1 parent d0ef2b3 commit 204a00c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 5 additions & 1 deletion CHANGES
@@ -1,8 +1,12 @@
-- $MawkId: CHANGES,v 1.162 2012/11/28 20:44:12 tom Exp $
-- $MawkId: CHANGES,v 1.163 2012/11/29 00:55:33 tom Exp $

Changes by Thomas E Dickey <dickey@invisible-island.net>

20121129
+ change behavior if internal fflush call fails: rather than exiting
with an error, propagate the return value to the script as -1, for
consistency with gawk and BWK (discussion with Aharon Robbins and
Nathan Weeks).
+ add special case for forward reference to a function using an array
parameter, updating the function's parameter type so that the array
is passed properly.
Expand Down
6 changes: 3 additions & 3 deletions files.h
@@ -1,6 +1,6 @@
/********************************************
files.h
copyright 2009,2010, Thomas E. Dickey
copyright 2009-2010,2012 Thomas E. Dickey
copyright 1991-1994,1996, Michael D. Brennan
This is a source file for mawk, an implementation of
Expand All @@ -11,7 +11,7 @@ the GNU General Public License, version 2, 1991.
********************************************/

/*
* $MawkId: files.h,v 1.11 2010/12/10 17:00:00 tom Exp $
* $MawkId: files.h,v 1.12 2012/11/29 00:56:19 tom Exp $
* @Log: files.h,v @
* Revision 1.3 1996/01/14 17:14:11 mike
* flush_all_output()
Expand Down Expand Up @@ -50,7 +50,7 @@ extern const char *shell; /* for pipes and system() */
extern PTR file_find(STRING *, int);
extern int file_close(STRING *);
extern int file_flush(STRING *);
extern void flush_all_output(void);
extern int flush_all_output(void);
extern PTR get_pipe(char *, int, int *);
extern int wait_for(int);
extern void close_out_pipes(void);
Expand Down

0 comments on commit 204a00c

Please sign in to comment.