2017-10-19         Arnold D. Robbins     <arnold@skeeve.com>

	* 4.2.0: Release tar ball made.

2017-10-17         Andrew J. Schorr      <aschorr@telemetry-investments.com>

	* NEWS: Actually, isarray is not deprecated in this release.
	* builtin.c (do_isarray): Remove lint warning deprecating isarray.

2017-10-14         Arnold D. Robbins     <arnold@skeeve.com>

	* field.c (do_split): Simplify the lint warnings.
	Based on suggested code by Eric Pruitt <eric.pruitt@gmail.com>.

2017-10-08         Arnold D. Robbins     <arnold@skeeve.com>

	* command.y: Fix the FSF's address.

2017-10-08         Arnold D. Robbins     <arnold@skeeve.com>

	* NEWS: Rationalized with respect to stuff on the API.
	Also rationalized with respect to the pretty printer changes.

2017-10-04         Andrew J. Schorr      <aschorr@telemetry-investments.com>

	* README: Fix grammar by removing a stray word.

2017-10-04         Arnold D. Robbins     <arnold@skeeve.com>

	* NEWS: Add a note about OS/2 not working.

2017-10-02         Arnold D. Robbins     <arnold@skeeve.com>

	* config.guess, config.sub: Updated.

2017-09-28         Arnold D. Robbins     <arnold@skeeve.com>

	* io.c (devopen): Move declaration of `cp' to where it's first used.

2017-09-18         Arnold D. Robbins     <arnold@skeeve.com>

	* README: Update required version of texinfo.tex.
	* compile, config.guess, config.sub, depcomp: Updated.

2017-09-17         Arnold D. Robbins     <arnold@skeeve.com>

	* gawkapi.h: Small changes to make it usable with C++.

2017-09-13         Arnold D. Robbins     <arnold@skeeve.com>

	* Makefile.am (command.c): Don't need the dependency on awkgram.c
	anymore.
	* bisonfix.awk: Removed.
	* README: Revised to describe use of Bison exclusively.

2017-09-13         Andrew J. Schorr      <aschorr@telemetry-investments.com>

	* Makefile.am (awkgram.c): Use -o option to bison. Get rid of
	messing with y.tab.h, that was obsolete.
	(EXTRA_DIST): Don't need bisonfix.awk anymore.

2017-09-12         Petr Ovtchenkov       <ptr@void-ptr.info>
		   Andrew J. Schorr      <aschorr@telemetry-investments.com>

	* Makefile.am (command.c): Make dependant on awkgram.c so
	that bison is run serially with make -j.  Use -o option so
	that we no longer need bisonfix.awk in this rule.

2017-08-28         Arnold D. Robbins     <arnold@skeeve.com>

	* interpret.h (r_interpret): Add some casts to avoid warning
	messages in printf statements.

	Unrelated:

	* configure.ac: Add check for gai_strerror.
	* io.c (socketopen): Use gai_strerror to add more information
	if getaddrinfo fails.

2017-08-25         Pat Rankin            <r.pat.rankin@gmail.com>

	* builtin.c (TYPE_MINIMUM): Use type uintmax_t for the calculation,
	deferring the cast to the target type until the final result.

2017-08-27         Juan Manuel Guerrero  <juan.guerrero@gmx.de>

	* mbsupport.h [__DJGPP_]: Provide multi-byte specific declarations
	and definitions for DJGPP.

2017-08-23         Arnold D. Robbins     <arnold@skeeve.com>

	* README.git: Minor edits to make build steps clearer.

2017-08-21         Daniel Richard G.     <skunk@iSKUNK.ORG>

	* awk.h (c_func): Renamed to c_function to avoid conflict.
	with z/OS headers.
	* ext.c, interpret.h: Ditto.
	* configure: Regenerated after update to m4/arch.m4.

2017-08-18         Arnold D. Robbins     <arnold@skeeve.com>

	* debug.c (do_set_var): Fix typos in error messages.
	Thanks to Jean-Philippe Guerard
	<jean-philippe.guerard@xn--tigreray-i1a.org> for the report.

2017-08-17         Arnold D. Robbins     <arnold@skeeve.com>

	* field.c (rebuild_record): Set new fields valref to 1 if
	original field's valref was > 1. Update the comment. Found
	by running chem.
	* mpfr.c (do_mpfr_compl): Fix typo in warning message.
	Thanks to Jean-Philippe Guerard
	<jean-philippe.guerard@xn--tigreray-i1a.org> for the report.
	* NEWS: Mention the Italian translation of the manual.

2017-08-16         Arnold D. Robbins     <arnold@skeeve.com>

	* gawkapi.c (assign_number): Clean up the code a bit.
	(api_get_mpfr, api_get_mpz): Add return NULL in non-MPFR case
	to avoid compiler warnings.

2017-08-16         Arnold D. Robbins     <arnold@skeeve.com>

	* config.guess: Update from GNULIB.
	* NEWS, README: Updated in preparation for release.

2017-08-16         Andrew J. Schorr     <aschorr@telemetry-investments.com>

	* gawkapi.c (assign_number): Add 'ifdef HAVE_MPFR' tests to get this
	to build in the absence of MPFR.

2017-08-13         Arnold D. Robbins     <arnold@skeeve.com>

	* gawkapi.h (gawk_api_major_version): Reset to 2 after merging
	in feature/api-mpfr branch.
	* NEWS: `intdiv' is not built-in; remove the entry for up and update
	numbering. Add note about API supporting GMP and MPFR values.

2017-08-09         Arnold D. Robbins     <arnold@skeeve.com>

	* gawkapi.h (check_mpfr_versions): Define differently based on if
	MPFR version macro is defined. Enhance body to use do/while(0).
	(dl_load): Call check_mpfr_versions unconditionally.

2017-08-09         Arnold D. Robbins     <arnold@skeeve.com>

	* main.c (usage): Add URL for Bug reporting info to the help message.

	Unrelated:

	* str_array.c (str_lookup): Make a copy of the string if it
	came from Nnull_string or a null field.  Thanks to
	Daniel Pettet for the report.

2017-08-04         Arnold D. Robbins     <arnold@skeeve.com>

	* array.c, awk.h, awkgram.y, builtin.c, cint_array.c,
	cmd.h, debug.c, eval.c, ext.c, field.c, gawkapi.c, gawkmisc.c,
	gettext.h, int_array.c, main.c, mpfr.c, msg.c, node.c, profile.c,
	re.c, str_array.c, symbol.c: Update copyright years.

2017-08-04         Arnold D. Robbins     <arnold@skeeve.com>

	* config.guess, mkinstalldirs: Updated from GNULIB.

2017-08-01         Juan Manuel Guerrero  <juan.guerrero@gmx.de>

	Bring DJGPP support up to speed.

	* awk.h: Add DJGPP in #if for include of nonposix.h
	* nonposix.h (btowc, putwc): Add declarations for DJGPP.

2017-07-17         Arnold D. Robbins     <arnold@skeeve.com>

	* awkgram.y [non_post_simp_exp]: Merge LEX_BUILTIN and
	LEX_LENGTH expansions.
	(lookup_builtin): Move MPFR test to after test for sub builtin.

	* awkgram.y [non_post_simp_exp]: Unmerge LEX_BUILTIN and
	LEX_LENGTH expansions. This introduced a reduce/reduce
	conflict, and those are bad.  I don't know why I didn't
	notice this earlier. Sigh.

2017-07-15         Arnold D. Robbins     <arnold@skeeve.com>

	Revert change of 2016-07-24 that always runs the dfa
	matcher. Based on a bug report from Alexandre Oliva
	<lxoliva@fsfla.org>, DFA can cause gawk to hang, even
	in the C locale.

	* re.c (research): Don't use dfa if need_start is true.

2017-07-11         Arnold D. Robbins     <arnold@skeeve.com>

	* awk.h (is_letter): Add declaration.
	* ext.c (is_valid_identifier): New function.
	(make_builtin): Use is_valid_identifier instead of inline code.
	(is_letter): Moved from here ...
	* awkgram.y (is_letter): ... to here.
	(yylex): Use is_letter instead of a test.
	* command.y (yylex): Ditto.
	* main.c (arg_assign): Ditto.

2017-07-07         Arnold D. Robbins     <arnold@skeeve.com>

	Remove warnings from GCC 7.1 compilation.

	* awk.h (fatal_tag_valid): Change type to int.
	* awkgram.y (yylex): Set did_newline to true instead of using ++.
	* builtin.c (format_tree): Set lj to true instead of using ++.
	* cmd.h (pager_quit_tag_valid): Change type to int.
	* debug.c (pager_quit_tag_valid): Change type to int.
	(do_clear): Make bp_found an int, change uses.
	(do_run): Treat fatal_tag_valid as an int.
	* msg.c (fatal_tag_valid): Change type to int.

2017-07-07         Arnold D. Robbins     <arnold@skeeve.com>

	* gawapi.h: Bring descriptive comments up to date, minor edits.
	* io.c: Add some initial comments to functions where they were missing.

2017-07-03         Arnold D. Robbins     <arnold@skeeve.com>

	* gawkapi.h, gawkapi.c: Typo fixes in comments.

2017-06-26         Arnold D. Robbins     <arnold@skeeve.com>

	* configure.ac: Turn a tab into a space in AC_DEFINE(SUPPLY_INTDIV).

2017-06-25         Andrew J. Schorr     <aschorr@telemetry-investments.com>

	* gawkmisc.c (xmalloc): Remove function now in support/xalloc.h.

2017-06-22         Arnold D. Robbins     <arnold@skeeve.com>

	Make pretty-printing include parentheses that were explicitly
	in the source code. Thanks to Hermann Peifer for the bug report.

	* awk.h (OPCODE): Add Op_parens.
	* awkgram.y [Grammar]: If pretty-printing, add Op_parens ot end of
	list for parenthesized expression.
	* eval.c (optypetab): Add Op_parens.
	* interpret.h (r_interpret): Ditto.
	* profile.c (pprint): Ditto.  For ?:, don't parenthesize it.
	(pp_parenthesize): If string starts with left paren, return early.
	(parenthesize): Don't call div_on_left_mul_on_right.
	(div_on_left_mul_on_right): Remove function.
	(pp_concat): Don't add parentheses if expressions already have them.
	* NEWS: Updated.

2017-06-21         Andrew J. Schorr     <aschorr@telemetry-investments.com>

	Replace malloc/memset combinations with calloc by using the new ezalloc
	macro.
	* awkgram.y (yyerror, do_add_srcfile, funcuse): Replace emalloc+memset
	with ezalloc.
	* cint_array.c (cint_lookup, cint_copy, tree_lookup, tree_copy,
	leaf_lookup, leaf_copy): Ditto.
	* command.y (mk_cmdarg): Ditto.
	* debug.c (add_item): Ditto.
	* eval.c (setup_frame): Ditto.
	* field.c (set_record): Ditto.
	* gawkapi.c (api_flatten_array_typed): Ditto.
	* int_array.c (int_copy, grow_int_table): Ditto.
	* io.c (init_awkpath, iop_alloc): Ditto.
	* node.c (str2wstr): Ditto.
	* re.c (make_regexp): Ditto.
	* str_array.c (str_copy, grow_table): Ditto.
	* symbol.c (make_params, new_context): Ditto.

2017-06-19         Andrew J. Schorr     <aschorr@telemetry-investments.com>

	* awk.h (ezalloc): Add new macro to allocate memory initialized to zero.
	(ezalloc_real): New inline function to call calloc.
	* gawkapi.h (ezalloc): Add new API macro to allocate memory initialized
	to zero.

2017-06-18         Arnold D. Robbins     <arnold@skeeve.com>

	* builtin.c (mbc_char_count): Fix code to correctly traverse
	the string. Thanks to Hermann Peifer for the bug report.
	* config.guess, config.sub: Update to latest from GNULIB.
	* gettext.h: Pull in a few nice changes from GNULIB version.

2017-05-30         Arnold D. Robbins     <arnold@skeeve.com>

	* NEWS: Mention PROCINFO["argv"].

2017-05-24         Andrew J. Schorr     <aschorr@telemetry-investments.com>

	* field.c (set_FIELDWIDTHS): Add check to protect against blank
	characters after a `:' skip separator. 
	Fix field number in error message, thanks to a bug report
	from Michal Jaegermann.

2017-05-23         Andrew J. Schorr     <aschorr@telemetry-investments.com>

	* field.c (set_FIELDWIDTHS): Simplify the logic and consistentify
	use of UINT_MAX.  Make sure that negative value after : is caught.

2017-05-23         Arnold D. Robbins     <arnold@skeeve.com>

	* field.c (fw_parse_field): Stop upon hitting the end of the
	record; this enables correct counting of the number of fields.
	(set_FIELDWIDTHS): Add `*' at end as meaning ``all the rest
	of the data on the line.'' Allow skip:* as well.
	* NEWS: Update information about FIELDWIDTHS.

2017-05-20         Arnold D. Robbins     <arnold@skeeve.com>

	* awkgram.y (add_lint): Make ``no effect'' check smarter about
	reporting line numbers.

2017-05-01         Arnold D. Robbins     <arnold@skeeve.com>

	* awkgram.y (nextc): Fix to change of 2017-04-24 such that
	@include works in multibyte locales. Thanks to Hermann
	Peifer for the bug report.

2017-04-26         Andrew J. Schorr     <aschorr@telemetry-investments.com>

	* awkgram.y (make_regnode): Fix bug -- we should not set valref to 1
	when creating a node of type Node_regex, since valref is appropriate
	only for Node_val nodes. This fixes a bug introduced in commit
	687e6594. Also, add an assert to make it clear that this function
	supports only Node_regex and Node_dynregex.
	* awk.h (NODE): Restore sref to the `val' subportion, since it is not
	really needed for Node_regex, now that the bug in make_regnode has
	been fixed.
	(valref): Restore macro definition.

2017-04-24         Arnold D. Robbins     <arnold@skeeve.com>

	* awk.h (NODE): Additional cleanups. Removed `aq' and `param_list'
	elements from various unions and removed 'nextp' and
	`a_opaque' defines. None of these were in use.
	Rework the comment for valref, per suggestion from
	Andrew Schorr.

2017-04-23         Arnold D. Robbins     <arnold@skeeve.com>

	* awkgram.y (nextc): Adjust so that 3.1.x behavior is restored
	whereby --source arguments are concatenated. Thanks to
	"Neil R. Ormos" <ormos-gnulists17@ormos.org> for the report.

2017-04-21         Arnold D. Robbins     <arnold@skeeve.com>

	* awk.h (NODE): Put the `val' subportion back the way it
	was and move valref (formerly sref) out of the unions
	entirely. This was the real problem. Rework the corresponding
	commentary.
	[valref]: Removed the macro definition.

2017-04-20         Arnold D. Robbins     <arnold@skeeve.com>

	* configure.ac: Make letter case usage in the various
	AC_ARG_ENABLE messages consistent with the rest of configure
	output.
	(--disable-mpfr): Add this option to make it easier
	to check compiles without MPFR. Motivated by:
	* awk.h (NODE): Rearrange the layout of the 'val' subportion
	of the union to fix alignment problems when compiling without
	MPFR.  The problem only happened on 64-bit compiles, not
	32-bit compiles.

2017-04-16         Arnold D. Robbins     <arnold@skeeve.com>

	Rename intdiv it intdiv0 and require enabling at configure time.

	* awkgram.y (tokentab): Bracket intdiv0 in #ifdef SUPPLY_INTDIV.
	(snode): Similar.
	* builtin.c (do_intdiv): Bracket in #ifdef SUPPLY_INTDIV.
	* mpfr.c (do_mpfr_intdiv): Bracket in #ifdef SUPPLY_INTDIV.
	* configure.ac: Add --enable-builtin-intdiv0 option. If enabled,
	also revise doc/gawktexi.in.

2017-04-16         Arnold D. Robbins     <arnold@skeeve.com>

	* builtin.c (do_intdiv): Use DEREF on the arguments.
	Thanks to Andrew Schorr for finding the problem.
	* mpfr.c (do_mpfr_intdiv): Return -1 if numerator or denominator
	are not valid numbers.  Unref various bits first.

2017-04-13         Arnold D. Robbins     <arnold@skeeve.com>

	* awk.h (make_number_node): Simplify.
	* mpfr.c (mpg_node): Change parameter name to `flags'.

2017-04-12         Arnold D. Robbins     <arnold@skeeve.com>

	* mpfr.c (mpg_format_val): Set STRCUR flag when we're done.
	Fixes a memory leak. Thanks to valgrind for the report.

	* builtin.c (do_dcgettext): Move declaration of reslen to
	outside the ifdefs. Thanks to Hermann Peifer for the report.

	* gawkapi.c (awk_value_to_node): Initialize ext_ret_val to NULL
	to avoid compiler warnings.

2017-04-12         Manuel Collado        <m-collado@users.sourceforge.net>

	Fix the FPAT bug reported by Ed Morton in the gawk-bug mailing list.

	* awk.h (Regexp): Remove the non_empty flag.
	* field.c (fpat_parse_field): Restructure the code to reduce complexity
	and document the new structure.

	* field.c (fpat_parse_field): Further restructuring to avoid
	invalid reads as reported by valgrind.

2017-04-10         Andrew J. Schorr     <aschorr@telemetry-investments.com>

	* awk.h (enum opcodeval): For the avoidance of doubt, specify that
	Op_illegal must equal zero.
	* symbol.c (bcfree): Improve clarity by setting opcode to Op_illegal
	instead of 0.
	(free_bc_mempool): Improve clarity by comparing opcode to Op_illegal
	instead of to 0.

	* field.c (set_FIELDWIDTHS): Set use_chars to awk_true, since its
	type is awk_bool_t.

2017-04-10         Arnold D. Robbins     <arnold@skeeve.com>

	* symbol.c (free_bc_mempool): Change `first' from int to bool.

2017-04-09         Andrew J. Schorr     <aschorr@telemetry-investments.com>

	* field.c (fw_parse_field): Edit comment about resetting shift state.
	* gawkapi.h (awk_fieldwidth_info_t): Make white space more uniform.

2017-04-08  Eli Zaretskii  <eliz@gnu.org>

	* main.c (usage, copyleft) [__MINGW32__]:
	* io.c (non_fatal_flush_std_file, close_io) [__MINGW32__]: Call
	w32_maybe_set_errno to correctly set errno to EPIPE when appropriate.

	* awk.h (die_via_sigpipe) [__MINGW32__]: MinGW-specific definition.

2017-04-07         Andrew J. Schorr     <aschorr@telemetry-investments.com>

	* awk.h (INSTRUCTION_POOL): Redefine as an array of structures so we
	can track allocated blocks.
	* symbol.c (pools): Make it a pointer to avoid copying.
	(struct instruction_block): Define structure to hold a block of
	allocated instructions.
	(bcfree): Update to use new INSTRUCTION_POOL definition.
	(bcalloc): Allocate an instruction by searching first on the free
	list, second for free space in the current block, or third by
	allocating a new block.
	(set_context): Update to reflect that pools is now a pointer.
	(free_bc_mempool): New helper function to free a pool of a certain size.
	(fre_bcpool): Call free_bc_mempool for each pool.

2017-04-04         Arnold D. Robbins     <arnold@skeeve.com>

	* awk.h (INSTRUCTION): Add pool_size member.
	[MAX_INSTRUCTION_ALLOC]: New macro.
	(INSTRUCTION_POOL): New type.
	(struct context): Use INSTRUCTION_POOL.
	* array.c (assoc_list): Reorg the code a bit to make sure
	to always free the INSTRUCTIONs allocated for calling a
	user-supplied sorting function. Based on code by
	Andrew Schorr.
	* symbol.c (free_bcpool): Rework to use an INSTRUCTION_POOL.
	(bcfree, bcalloc): Rework to use separate chains in
	the instruction pool.
	(set_context): Update appropriately.

2017-03-27         Arnold D. Robbins     <arnold@skeeve.com>

	* field.c (parse_field_func_t): New typedef. Used as needed.
	(fw_parse_field): Edit comment about resetting shift state.
	(set_parser): Fix leading comment's style and type of argument.
	(set_FIELDWIDTHS): Improve the fatal error message.
	* gawkapi.h: Minor edits in some comments.

2017-03-27         Arnold D. Robbins     <arnold@skeeve.com>

	Cause EPIPE errors to stdout to generate a real SIGPIPE.

	* awk.h (die_via_sigpipe): New macro.
	* builtin.c (efwrite): Use it.
	* io.c (non_fatal_flush_std_file): Ditto.
	* main.c (usage): Ditto.

2017-03-25         Arnold D. Robbins     <arnold@skeeve.com>

	* io.c (flush_io): Use r_fatal and r_warning for messagefunc
	in the loop.

2017-03-24         Arnold D. Robbins     <arnold@skeeve.com>

	* builtin.c (efwrite): Exit successfully upon EPIPE, as SIGPIPE
	done. Improve error messages upon failure to write.
	(do_fflush): Update ERRNO for non-fatal flush failures.
	* io.c (non_fatal_flush_std_file): Update ERRNO when flush is
	non-fatal.
	(flush_io): If a redirect is marked non-fatal, only warning,
	not fatal message.

2017-03-23         Arnold D. Robbins     <arnold@skeeve.com>

	* config.sub: Updated again.

2017-03-22         Andrew J. Schorr     <aschorr@telemetry-investments.com>

	* NEWS: Document new PROCINFO["FS"] value of "API".

2017-03-22         Andrew J. Schorr     <aschorr@telemetry-investments.com>

	* NEWS: Document new FIELDWIDTHS skip capability and API input parser
	field parsing enhancement.

2017-03-22         Andrew J. Schorr     <aschorr@telemetry-investments.com>

	* gawkapi.h (awk_input_buf_t): Update get_record comment regarding the
	new field_width argument.

2017-03-21         Andrew J. Schorr     <aschorr@telemetry-investments.com>

	* gawkapi.h (awk_fieldwidth_info_t): Define new structure to contain
	API field parsing info, replacing the previous awk_input_field_info_t
	array.
	(awk_fieldwidth_info_size): Define macro to calculate size of the
	variable-length awk_fieldwidth_info_t structure.
	(awk_input_buf_t): Update get_record prototype to update the type
	of the final field_width argument from 'const awk_input_field_info_t **'
	to 'const awk_fieldwidth_info_t **'.
	* awk.h (set_record): Change 3rd argument from
	'const awk_input_field_info_t *' to 'const awk_fieldwidth_info_t *'.
	* io.c (inrec, do_getline_redir, do_getline): Change field_width type
	from 'const awk_input_field_info_t *' to
	'const awk_fieldwidth_info_t *'.
	(get_a_record): Change field_width argument type from
	'const awk_input_field_info_t **' to 'const awk_fieldwidth_info_t **'.
	* field.c (api_parser_override): Define new boolean to track whether
	API parsing is currently overriding default parsing behavior.
	(api_fw): Change type from 'const awk_input_field_info_t *'
	to 'const awk_fieldwidth_info_t *'.
	(FIELDWIDTHS): Change type from 'int *' to 'awk_fieldwidth_info_t *'.
	(set_record): Use new boolean api_parser_override to track whether
	API parsing override is in effect, since we can no longer discern
	this from the value of parse_field -- FIELDWIDTHS parsing uses the
	same function.
	(calc_mbslen): New function to calculate the length of a multi-byte 
	string.
	(fw_parse_field): Enhance to support the awk_fieldwidth_info_t 
	structure instead of simply using an array of integer field widths.
	(api_parse_field): Remove function no longer needed since fw_parse_field
	now supports both FIELDWIDTHS and API parsing.
	(set_parser): Use api_parser_override instead of comparing parse_field
	to api_parse_field.
	(set_FIELDWIDTHS): Enhance to use new awk_fieldwidth_info_t structure
	and parse new skip prefix for each field.
	(current_field_sep): Use api_parser_override flag instead of comparing
	to api_parse_field.
	(current_field_sep_str): Ditto.

2017-03-20         Arnold D. Robbins     <arnold@skeeve.com>

	Improve handling of EPIPE. Problems reported by
	Alexandre Ferrieux <alexandre.ferrieux@orange.com>
	and David Kerns <david.t.kerns@gmail.com>.

	* awk.h (ignore_sigpipe, set_sigpipe_to_default,
	non_fatal_flush_std): Declare new functions.
	(ignore_sigpipe, set_sigpipe_to_default,
	non_fatal_flush_std): New macros.
	* builtin.c (do_fflush): When nonfatal not in force, flush
	of stdout/stderr and EPIPE exits, simulating SIGPIPE, as
	in nawk/mawk. Flush of other redirections with EPIPE now
	also fatals.
	(do_system): Use ignore_sipipe and set_sigpipe_to_default
	instead of uglier inline ifdefed code.
	* main.c (main): Ditto.
	* io.c (redirect_string, two_way_open, gawk_popen): Ditto.
	(flush_io): Use non_fatal_flush_std for stdout and stderr.

	Unrelated:

	* config.guess, config.rpath, config.sub, install-sh:
	Sync with GNULIB.

2017-03-16         Arnold D. Robbins     <arnold@skeeve.com>

	* configure.ac: Some cleanups.

2017-03-09         Andrew J. Schorr     <aschorr@telemetry-investments.com>

	* gawkapi.h (awk_input_field_info_t): Define new structure to contain
	API field parsing info.
	(awk_input_buf_t): Update get_record prototype to use an array of
	awk_input_field_info_t instead of integers.
	* awk.h (set_record): Change 3rd argument from 'const int *' to
	'const awk_input_field_info_t *'.
	* field.c (api_fw): Now points to an array of awk_input_field_info_t
	instead of integers.
	(set_record): Change 3rd argument to point to an array of
	awk_input_field_info_t.
	(api_parse_field): Update parsing logic to use awk_input_field_info_t
	structures instead of an array of integers.
	* io.c (inrec, do_getline_redir, do_getline): Change field_width type
	from 'const int *' to 'const awk_input_field_info_t *'.
	(get_a_record): Change field_width argument type from 'const int **'
	to 'const awk_input_field_info_t **'.

2017-03-09         Arnold D. Robbins     <arnold@skeeve.com>

	* field.c: Minor style edits.

2017-03-06         Andrew J. Schorr     <aschorr@telemetry-investments.com>

	* field.c (normal_parse_field): Renamed from save_parse_field to reflect
	better its purpose. Added a comment to explain more clearly what's
	going on.
	(set_record, set_parser): Rename save_parse_field to normal_parse_field.

2017-03-06         Andrew J. Schorr     <aschorr@telemetry-investments.com>

	* gawkapi.h (awk_input_buf_t): Remove field_width array and instead
	add it as a 6th argument to the get_record function. This should
	not break existing code, since it's fine to ignore the additional
	argument. Document the behavior of the field_width argument.
	* io.c (inrec): Pass pointer to field_width array to get_a_record,
	and then hand it off to set_record.
	(do_getline_redir): If not reading into a variable, pass pointer to
	field_width array to get_a_record and then hand it off to set_record.
	(do_getline): Ditto.
	(get_a_record): Add a 4th field_width argument to pass through to
	the API get_record method.

2017-03-05         Andrew J. Schorr     <aschorr@telemetry-investments.com>

	* awk.h (set_record): Add a new argument containing a field-width
	array returned by an API parser.
	(field_sep_type): Add new enum value Using_API.
	(current_field_sep_str): Declare new function.
	* field.c (save_parse_field): New static variable to save the
	parse_field value in cases where it's overridden by API parsing.
	(api_fw): New static variable to hold pointer to API parser fieldwidth
	array.
	(set_record): Add new field-width array argument. If present, API
	parsing will override the default parsing mechanism.
	(api_parse_field): New field parser using field widths supplied by the
	API. This is very similar to the existing fw_parse_field function.
	(get_field): Fix typo in comment.
	(set_parser): New function to set default parser and check whether
	there's an API parser override in effect. Update PROCINFO["FS"] if
	something has changed.
	(set_FIELDWIDTHS): Use set_parser and stop updating PROCINFO["FS"].
	(set_FS): Ditto.
	(set_FPAT): Ditto.
	(current_field_sep): Return Using_API when using the API field parsing
	widths.
	(current_field_sep_str): New function to return the proper string
	value for PROCINFO["FS"].
	* gawkapi.h (awk_input_buf_t): Add field_width array to enable the
	parser get_record function to supply field widths to override the
	default gawk field parsing mechanism.
	* io.c (inrec): Pass iop->public.field_width to set_record as the
	3rd argument to enable API field parsing overrides.
	(do_getline_redir, do_getline): Ditto.
	* main.c (load_procinfo): Use new current_field_sep_str function
	instead of switching on the return value from current_field_sep.

2017-02-23         Arnold D. Robbins     <arnold@skeeve.com>

	* awk.h (boolval): Return bool instead of int.
	* eval.c (eval_condition): Same.
	* io.c (pty_vs_pipe): Same
	Thanks to Andrew Schorr for pointing these out.

2017-02-21         Andrew J. Schorr     <aschorr@telemetry-investments.com>

	* NEWS: Document that mktime now takes an optional utc-flag argument.
	* awkgram.y (tokentab): Modify mktime entry to indicate that it may
	accept two arguments.
	* builtin.c (mktime_tz): New function to run mktime in an arbitrary
	time zone. Code was copied from the Linux timegm man page.
	(do_mktime): Add support for new optional 2nd argument utc-flag by
	using the new mktime_tz function.
	(do_strftime): Change do_gmt type from int to bool.

2017-02-17         Arnold D. Robbins     <arnold@skeeve.com>

	* builtin.c (do_typeof): Handle arguments that have
	the NULL_FIELD flag set.

2017-02-03         Andrew J. Schorr     <aschorr@telemetry-investments.com>

	* awkgram.y (set_profile_text): Improve code clarity by using emalloc
	to allocate the string instead of abusing estrdup.

2017-02-02         Arnold D. Robbins     <arnold@skeeve.com>

	* awkgram.y (set_profile_next): Allocate an extra byte at the
	end for the NUL in case we add a sign. Thanks to Andrew Schorr
	for making me look at this code.

	And later in the same day:

	* awkgram.y (set_profile_next): Undo previous change, since estrdup
	handles it, but updated the comments.

2017-02-01         Arnold D. Robbins     <arnold@skeeve.com>

	* builtin.c (mbc_char_count): Remove spurious multiplies by
	gawk_mb_cur_max. Thanks to Andrew Schorr for making me look
	at this code.

	Unrelated:

	* awkgram.y (make_profile_number): Renamed to ...
	(set_profile_next): New function. All calls adjusted. Also improved
	use at MPFR number case.

2017-01-28         Andrew J. Schorr     <aschorr@telemetry-investments.com>

	* io.c (inetfile): Replace strncmp with memcmp in a few places, now
	that we are checking string length beforehand.

2017-01-27         Andrew J. Schorr     <aschorr@telemetry-investments.com>

	* io.c (redirect_string): Check explen positive before accessing *str.
	In lintwarn message, use explen string length. Pass length to inetfile.
	(devopen): Pass name length to inetfile.
	Stop assuming that remoteport is NUL-terminated.
	(two_way_open): Pass name length to inetfile.
	(inetfile): Stop assuming NUL string termination; add checks to avoid 
	string overrun.

2017-01-27         Andrew J. Schorr     <aschorr@telemetry-investments.com>

	* awk.h (str_terminate_f): New helper function for terminating a string
	NODE.
	(str_terminate): Macro wrapper to call str_terminate_f.
	(str_restore): New macro to restore the string.
	* builtin.c (do_strftime): Use str_terminate and str_restore.
	(do_dcgettext): Ditto, and remove saved_end flag since equivalent
	to testing (t2 != NULL). Fix overrun bug in calculating result
	length when !ENABLE_NLS.
	(do_dcngettext, do_bindtextdomain): Use str_terminate and str_restore.
	* interpret.h (Op_arrayfor_init, Op_indirect_func_call): Ditto.
	* str_array.c (env_remove): Ditto.

2017-01-27         Andrew J. Schorr     <aschorr@telemetry-investments.com>

	* interpret.h [UNFIELD]: Fix condition for assignment from
	value with valref == 1. Fixes problems introduced at gawk 4.1.2.

2017-01-27         Arnold D. Robbins     <arnold@skeeve.com>

	* interpret.h: Update copyright year.
	* debug.c (do_run): Rework error message to ease translation.
	Thanks to Rafael Fontenelle <rafaelff@gnome.org> and to
	Eli Zaretskii <eliz@gnu.org>.

2017-01-26         Andrew J. Schorr     <aschorr@telemetry-investments.com>

	* builtin.c (do_dcgettext): First argument also needs protection
	from string overrun.
	(do_dcngettext): Need to terminate string1 and string2 also,
	and replace strlen(the_result), which could overrun.
	(do_bindtextdomain): Terminate both string args, and eliminate
	saved_end boolean which is redundant with (t2 != NULL).

2017-01-26         Andrew J. Schorr     <aschorr@telemetry-investments.com>

	* interpret.h (Op_arrayfor_init): Protect against string overrun
	on sorting method.
	(Op_indirect_func_call): Terminate function name.

2017-01-26         Andrew J. Schorr     <aschorr@telemetry-investments.com>

	* str_array.c (env_remove): Terminate string before calling unsetenv.

2017-01-26         Andrew J. Schorr     <aschorr@telemetry-investments.com>

	* node.c (is_hex): Add a new argument pointing to the end of the string
	so we can check for string overrun.
	(r_force_number): Pass string end to is_hex.

2017-01-26         Andrew J. Schorr     <aschorr@telemetry-investments.com>

	* awk.h (get_numbase): Add string length argument so we can operate
	on unterminated strings.
	* awkgram.y: Call get_numbase with string length, and fix off-by-one
	error in length passed to nondec2awknum: should be strlen(tokstart)-1
	based on surrounding code.
	* builtin.c (do_strtonum): Pass string length to get_numbase.
	(nondec2awknum): Check string length before accessing characters.
	* mpfr.c (force_mpnum): Pass string length to get_numbase.
	* node.c (r_force_number): Pass string length to get_numbase.
	(get_numbase): Add string length argument and honor it.

2017-01-26         Andrew J. Schorr     <aschorr@telemetry-investments.com>

	* builtin.c (do_strftime): If format argument is passed, we need
	to terminate it in case it's a field variable.

2017-01-26         Andrew J. Schorr     <aschorr@telemetry-investments.com>

	* node.c (r_format_val): Before we free s->stptr, make sure that it
	was malloced.
	(wstr2str): Add comment explaining why it's safe to free n->stptr
	without doing any checks.
	* mpfr.c (mpg_format_val): Ditto. And no need to reset the STRCUR flag
	that we just checked.

2017-01-26         Andrew J. Schorr     <aschorr@telemetry-investments.com>

	* awk.h (enum block_id): Remove BLOCK_INVALID, since it serves no
	useful purpose and seems to slow things down a bit.
	* node.c (nextfree): Remove first invalid entry.

2017-01-25         Andrew J. Schorr     <aschorr@telemetry-investments.com>

	* awk.h (BLOCK): Remove typedef. BLOCK was used for 2 different
	purposes: to contain a block allocation list header, and to hold
	each individual allocated item. This was confusing, because the "size"
	field was set only in the header, but not in each element.
	(struct block_header): The block header contains a pointer to the first
	element and the element size.
	(struct block_item): Represent a single allocated item. This contains
	only a pointer to the next element. This reduces the minimum allocated
	item size from 2 pointers to 1 (16 bytes to 8 bytes on x86_64).
	(nextfree): Change array item type from BLOCK to struct block_header.
	(getblock, freeblock): Change cast from 'BLOCK' to 'struct block_item'.
	* node.c (nextfree): Now an array of 'struct block_header' instead of
	BLOCK. Switch the ordering to put the next pointer before the size.
	(more_blocks): Replace 'BLOCK' with 'struct block_item', and add
	an assert to ensure that the allocation size is at least as large
	as 'struct block_item', i.e. 1 pointer.

2017-01-22         Andrew J. Schorr     <aschorr@telemetry-investments.com>

	* awk.h (numtype_choose): New backend macro used to implement
	various macros whose calculations depend on how a number is
	actually represented. This improves readability and should give
	a small performance improvement when not using extended precision.
	(get_number_ui, get_number_si, get_number_d, get_number_uj, iszero):
	Rewrite using new numtype_choose macro.

2017-01-04         Arnold Robbins        <arnold@skeeve.com>

	Trade space for time for programs that toggle IGNORECASE a lot.
	Brings 25% to 39% speedup.  NODE does not actually grow in size.

	* awk.h (NODE::preg): Now an array of size two.
	[CASE]: Flag no longer needed, so removed.
	(IGNORECASE): Change type from int to bool.
	* awkgram.y (make_regnode): Build two copies of the compiled regexp,
	one without ignorecase, and one with.
	* io.c (RS_re): Array replacing RS_re_yes_case and RS_re_no_case.
	(set_RS): Use RS_re[IGNORECASE] as appropriate. Free and recompute
	as needed.
	* main.c (IGNORECASE): Change type from int to bool.
	* re.c (re_update): Simplify the code. No need to check CASE flag
	any longer. Recompute only if text of regexp changed.
	* symbol.c (free_bc_internal): Adjust to free both elements of
	m_re_reg.

2017-01-18         Andrew J. Schorr     <aschorr@telemetry-investments.com>

	* interpret.h (r_interpret): Increase robustness of the optimization
	logic in Op_assign_concat -- check that the node has MALLOC set,
	and make sure to wipe all flags other than MALLOC, STRING, STRCUR,
	and possibly WSTRCUR. Use STFMT_UNUSED define.

2017-01-15         Andrew J. Schorr     <aschorr@telemetry-investments.com>

	* interpret.h (r_interpret): Fix bug in Op_assign_concat reported
	on Cygwin mailing list. The string concatenation optimization was
	not updating the node correctly by setting STRING and STRCUR flags
	and setting stfmt.

2017-01-06         Andrew J. Schorr     <aschorr@telemetry-investments.com>

	Enhance API to support extended-precision arithmetic.
	* awk.h (enum block_id): Add new values BLOCK_MPFR and BLOCK_MPZ.
	(make_number_node): New inline function to reduce code duplication
	for creating numeric nodes.
	* gawkapi.h (gawk_api_major_version): Bump to 3.
	(awk_number_t): New typedef to represent numbers with varying internal
	representations.
	(awk_value_t): For numbers, replace double with awk_number_t.
	(num_value): Redefine.
	(num_type, num_ptr): New defines for awk_number_t union members.
	(gawk_api_t): Add constants for version checking: gmp_major_version,
	gmp_minor_version, mpfr_major_version, and mpfr_minor_version.
	Add functions api_get_mpfr and api_get_mpz to allocate memory for
	extended-precision numbers to hand to gawk.
	(get_mpfr_ptr, get_mpz_ptr): Helper macros to wrap api_get_mpfr and
	api_get_mpz.
	(make_number): Modify to populate awk_number_t correctly.
	(make_number_mpz, make_number_mpfr): New helper functions to create
	extended-precision numeric nodes.
	(check_mpfr_version): New macro to check GMP/MPFR version compatibility
	in extensions that want to support extended-precision math.
	* gawkapi.c (getmpfr, freempfr, getmpz, freempz): New macros to
	allocate and free memory blocks for extended-precision math.
	(awk_value_to_node): For AWK_NUMBER values, support three different
	kinds of internal numbers: double, mpz_t, and mpfr_t.
	(assign_number): New helper function to convert a numeric node to
	an awk_value_t.
	(node_to_awk_value): Use assign_number to pass numbers properly.
	(api_get_mpfr): Implement new api_get_mpfr hook.
	(api_get_mpfz): Implement new api_get_mpz hook.
	(api_impl): Add GMP & MPFR versions, api_get_mpfr, and api_get_mpz.
	* node.c (r_make_number): Use new make_number_node inline function
	to reduce code duplication.
	(nextfree): Add block allocators for mpfr_t and mpz_t.
	(more_blocks): Add an assert to protect against cases where the block
	size is too small to hold our structure.
	* mpfr.c (mpg_node): Use new make_number_node inline function
	to reduce code duplication.

2017-01-04         Arnold Robbins        <arnold@skeeve.com>

	* config.guess, config.sub, compile, depcomp: Sync from latest
	in GNULIB.

2016-12-27         Juergen Kahrs         <Juergen.Kahrs@googlemail.com>

	* CMakeLists.txt: Updated after adding support library.

2016-12-23         Arnold D. Robbins     <arnold@skeeve.com>

	* configure.ac (GNUPG_CHECK_MPFR): Don't call on PowerPC
	Macintosh.  C99 and the last version of MPFR that works on
	that platform don't get along. Sigh.

2016-12-22         Arnold D. Robbins     <arnold@skeeve.com>

	* dfa.c: Sync with GNULIB.
	* intprops.h: New file.
	* Makefile.am (base_sources): Add intprops.h.

	Unrelated.  Import GNULIB fix for regex: fix integer-overflow
	bug in never-used code.
	Problem reported by Clément Pit–Claudel in:
	http://lists.gnu.org/archive/html/emacs-devel/2016-12/msg00654.html
	Fix by Paul Eggert  <eggert@cs.ucla.edu>:

	* regex_internal.h: Include intprops.h.
	* regexec.c (re_search_2_stub): Use it to avoid undefined
	behavior on integer overflow.

	Unrelated. Set up a support directory for externally obtained
	support files.

	* Makefile.am (base_sources, EXTRA_DIST): Edit lists.
	(SUBDIRS): Get ordering right.
	(LDADD): Add support/libsupport.a.
	(DEFS): Add -I for support directory.
	* dfa.c, dfa.h, getopt.c, getopt.h, getopt1.c, getopt_int.h,
	intprops.h, localeinfo.c, localeinfo.h, random.c, random.h,
	regcomp.c, regex.c, regex.h, regex_internal.c, regex_internal.h,
	regexec.c, verify.h, xalloc.h: Moved to support.

	Unrelated: Totally break binary compatibility in the API
	after merging in API min/max changes and REGEX and STRNUM
	support in the API:

	* gawkapi.c (valtype2str): New function.
	(node_to_awk_value): Minor simplification in a switch.
	(api_flatten_array): Removed.
	(api_flatten_array_typed): Use valtype2str in error message.
	(api_impl): Reorder functions to group related ones together again.
	* gawkapi.h (awk_valtype_t): Reorder enum values.
	(struct gawk_api): Remove api_flatten_array field.  Reorder
	functions to group related ones together again.

2016-12-17         Arnold D. Robbins     <arnold@skeeve.com>

	* gawkapi.h (api_add_ext_func): Add comment about point to
	awk_ext_func_t not being const but gawk doesn't use it.
	* * interpret.h (Op_ext_builtin): Simplify code, check only
	if do_lint and ! f->suppress_lint and num_args > max_expected.

2016-12-16         Arnold D. Robbins     <arnold@skeeve.com>

	* gawkapi.h (awk_ext_func_t): Put max back before min. Restores
	source compatibility, although there will be compile warnings
	because of the 3rd argument for the C function being missing.
	* interpret.h (Op_ext_builtin): Used size_t instead of int for
	the various variables. Add a check that max expected > 0.

2016-12-14         Arnold D. Robbins     <arnold@skeeve.com>

	MAJOR BREAKING API CHANGE.

	* awk.h (INSTRUCTION): Update extension function pointer to
	take 3rd argument of pointer to struct awk_ext_func.
	* gawkapi.c (api_add_ext_func): Update third arg to not be const.
	* gawkapi.h (awk_ext_func_t): Put min before max. Add suppress_lint
	and data pointer.
	[gawk_api_major_version]: Update to 2.
