aboutsummaryrefslogtreecommitdiffstats
path: root/ChangeLog
diff options
context:
space:
mode:
Diffstat (limited to 'ChangeLog')
-rw-r--r--ChangeLog1063
1 files changed, 1062 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 6ccc7b8d..3cd1305a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,17 @@
* dfa.c: Sync with GNU grep.
+2016-07-03 Andrew J. Schorr <aschorr@telemetry-investments.com>
+
+ * field.c (rebuild_record): Revert warning message regarding flags,
+ since I'm not yet totally confident that it is invalid to have FIELD
+ and MALLOC set at the same time.
+
+2016-07-03 Andrew J. Schorr <aschorr@telemetry-investments.com>
+
+ * field.c (rebuild_record): Do not turn off the STRING flag when
+ copying a FIELD node, and issue a warning if MALLOC is enabled.
+
2016-07-01 Arnold D. Robbins <arnold@skeeve.com>
* array.c (value_info): Print something reasonable when stfmt
@@ -22,6 +33,86 @@
* awkgram.y (dump_vars): Allow "-" to mean print to stdout.
Thanks to Hermann Peifer for the reports.
+2016-06-30 Arnold D. Robbins <arnold@skeeve.com>
+
+ * node.c (r_force_number): Coding style change.
+
+2016-06-30 Andrew J. Schorr <aschorr@telemetry-investments.com>
+
+ * awk.h (STFMT_UNUSED): New define indicating that the string
+ representation does not depend on CONVFMT or OFMT.
+ (force_string): Use STFMT_UNUSED to improve code clarity.
+ * array.c (value_info): Fix stfmt logic.
+ * builtin.c (do_print): Use STFMT_UNUSED to improve code clarity.
+ * field.c (set_record): Ditto.
+ * gawkapi.c (api_sym_update_scalar): Ditto.
+ * int_array.c (is_integer): Check stfmt equals STFMT_UNUSED before
+ bothering to inspect the string.
+ * mpfr.c (mpg_format_val): Use STFMT_UNUSED to improve code clarity.
+ Remove buggy cast to char in stfmt assignment.
+ * node.c (r_format_val): Ditto.
+ * str_array.c (str_lookup): Use STFMT_UNUSED to improve code clarity.
+ * symbol.c (check_param_names): Ditto.
+
+2016-06-29 Andrew J. Schorr <aschorr@telemetry-investments.com>
+
+ * node.c (r_force_number): Optimize by trimming leading and trailing
+ white space before we inspect the string contents.
+ (get_ieee_magic_val): Must terminate the string with '\0' before
+ calling strtod.
+
+2016-06-27 Andrew J. Schorr <aschorr@telemetry-investments.com>
+
+ * gawkapi.h (awk_string): Add comment about the potential lack of
+ NUL-termination.
+
+2016-06-27 Andrew J. Schorr <aschorr@telemetry-investments.com>
+
+ * awk.h: Add a comment regarding the potential lack of NUL-termination
+ for Node_val strings.
+
+2016-06-27 Andrew J. Schorr <aschorr@telemetry-investments.com>
+
+ * node.c (r_format_val): Do not free stptr unless STRCUR is set.
+ This is safer than testing for non-NULL stptr, since, for example,
+ pp_number copies a node and calls r_format_val, but does not bother
+ to set stptr to NULL beforehand.
+
+2016-06-26 Andrew J. Schorr <aschorr@telemetry-investments.com>
+
+ * node.c (r_force_number): When checking for trailing spaces, protect
+ against running off the end of the string.
+ * mpfr.c (force_mpnum): Ditto.
+
+2016-06-26 Andrew J. Schorr <aschorr@telemetry-investments.com>
+
+ * builtin.c (do_print): There's actually no reason to test whether a
+ value is a number, since the STRCUR flag and stfmt value contain all
+ the necessary info, as in awk.h:force_string.
+
+2016-06-26 Andrew J. Schorr <aschorr@telemetry-investments.com>
+
+ * builtin.c (do_print): Do not use OFMT to print strnum values. We
+ accomplish this by calling format_val for a NUMBER only
+ if there is no string currently available, or if stfmt equals
+ neither -1 nor OFMTidx.
+
+2016-06-26 Arnold D. Robbins <arnold@skeeve.com>
+
+ * awk.h: Edit some comments. Add others. Minor coding style changes.
+ * builtin.c (format_tree): Restore a comment.
+ (do_mktime): Restore saving/restoring of byte after format string.
+ (do_sub): Coding style. Use %.*s in warning message.
+ (nondec2awknum): Restore saving/restoring of byte after string value
+ being converted.
+ * eval.c: Minor coding style edits.
+ * int_array.c (is_integer): Fix order of checks for not
+ updating string value: check length == 0 before testing values.
+ Coding style edits.
+ * mpfr.c (do_mpfr_strtonum): Coding style edits.
+ * node.c (r_force_number): Restore saving/restoring of byte after
+ string value being converted. Edit comments some.
+
2016-06-26 Arnold D. Robbins <arnold@skeeve.com>
Repair change of 2015-08-25 to handling of MAYBE_NUM.
@@ -32,6 +123,22 @@
Thanks to Andrew Schorr for reporting the problem.
A test case will eventually be merged into master.
+ Only in stable and master.
+
+2016-06-20 Andrew J. Schorr <aschorr@telemetry-investments.com>
+
+ * builtin.c (do_strftime): Call fixtype before checking flags for
+ STRING type.
+ (do_print): Call fixtype before checking whether argument is a NUMBER.
+ * eval.c (set_BINMODE): Call fixtype before checking value type.
+ No need to call force_number if the flags say it's a number.
+ (r_get_field): Fix lint check for non-numeric argument.
+ * io.c (redirect): Call fixtype before checking whether it's a string.
+
+2016-06-18 Andrew J. Schorr <aschorr@telemetry-investments.com>
+
+ * node.c (r_force_number): Fix typo in comment.
+
2016-06-16 Arnold D. Robbins <arnold@skeeve.com>
* awk.h: Add comment headers for several functions.
@@ -42,10 +149,110 @@
* config.sub: Update from GNULIB.
+2016-06-14 Andrew J. Schorr <aschorr@telemetry-investments.com>
+
+ * awk.h (boolval): New inline function to standardize testing whether
+ a node's value is true.
+ * builtin.c (do_strftime): Use boolval to handle 3rd argument.
+ * eval.c (set_IGNORECASE, eval_condition): Use new boolval function.
+ * io.c (pty_vs_pipe): Use new boolval function.
+
+2016-06-14 Andrew J. Schorr <aschorr@telemetry-investments.com>
+
+ * builtin.c (do_strftime): Fix handling of 3rd argument to work
+ as a standard boolean: non-null or non-zero.
+
+2016-06-14 Andrew J. Schorr <aschorr@telemetry-investments.com>
+
+ * gawkapi.c (node_to_awk_value): When caller requests AWK_SCALAR
+ or AWK_UNDEFINED, we need to call fixtype before we check the type.
+
+2016-06-13 Andrew J. Schorr <aschorr@telemetry-investments.com>
+
+ * awkgram.y: Eliminate STRCUR tests. Must use STRING to test whether
+ a scalar is a string.
+
+2016-06-12 Andrew J. Schorr <aschorr@telemetry-investments.com>
+
+ * awk.h: Improve comment about STRING and NUMBER type assignment.
+ (nondec2awknum): Add endptr argument.
+ (fixtype): New inline function to clarify a scalar's type.
+ * array.c (sort_up_value_type): Call fixtype before checking the value
+ types.
+ * awkgram.y (yylex): Pass NULL endptr argument to nondec2awknum.
+ (valinfo): Remove dead tests: either STRING or NUMBER or both
+ must be set, so there's no reason to continue with checks for NUMCUR or
+ STRCUR.
+ * builtin.c (do_exp, do_int, do_log, do_sqrt, do_sin, do_cos, do_srand):
+ Fix lint check for non-numeric argument.
+ (do_string): Fix lint check for 1st and 2nd args being strings.
+ (do_length): Fix assert to allow for Node_typedregex.
+ Fix lint check for non-string argument.
+ (format_tree): Fix type detection for '%c' arguments.
+ (do_strftime): Fix lint check for non-numeric 2nd argument and
+ lint check for non-string 1st argument.
+ (do_mktime): Fix lint check for non-string argument. Eliminate useless
+ logic to save and restore terminating NUL.
+ (do_system, do_tolower, do_toupper): Fix lint check for non-string
+ argument.
+ (do_atan2, do_lshift, do_rshift, do_and, do_or, do_xor, do_compl,
+ do_intdiv): Fix lint checks for non-numeric args.
+ (do_sub): Attempt to clean up treatment of 3rd argument to gensub
+ despite vague documentation of expected behavior.
+ (do_strnum): Fix bug in number detection logic, and pass new endptr
+ arg to nondec2awknum.
+ (nondec2awknum): Add endptr argument so caller can detect how much
+ of the string was consumed. Eliminate unnecessary logic to save
+ and restore terminating NUL char.
+ (do_typeof): Use a switch to specify which cases are supported, and
+ issue a warning message when a corrupt type is detected.
+ * debug.c (print_memory): At least one of NUMBER and STRING should
+ be set, so no need to check for NUMCUR or STRCUR in addition.
+ * eval.c (cmp_nodes): Use fixtype function to fix arg types.
+ (set_IGNORECASE): Fix logic for acting on value type. Note that
+ setting IGNORECASE to a string value of "0" with NUMCUR set now enables
+ ignorecase, so that's a subtle change in behavior that seems to match
+ the docs.
+ (set_LINT): Try to clean up configuration logic based on type.
+ * ext.c (get_argument): Remove unused variable pcount.
+ * gawkapi.c (node_to_awk_value): Remove pointless test for NUMCUR
+ after calling force_number. Similarly, no need to test for STRCUR
+ after calling force_string.
+ * int_array.c (is_integer): Reject cases where a string value is
+ present that will not be correctly regenerated from the integer;
+ in particular, this could happen where blank space padding is present,
+ leading zeroes are present, or for hex or octal values.
+ Also fix some bugs where a strnum was converted to a NUMBER without
+ turning off the STRING bit.
+ * io.c (redirect_string): Make lint warning message more accurate.
+ (redirect): Change not_string test to use STRING bit, not STRCUR.
+ (pty_vs_pipe): Use fixtype to correct logic for detecting whether a
+ value is anumber.
+ * mpfr.c (mpg_force_number): If NUMCUR is set, there's no need to
+ test is_mpg_number. If it's not, the NODE is corrupt and we've got
+ bigger problems. Fix flag manipulation logic. Always set NUMCUR and
+ clear MAYBE_NUM,
+ (set_PREC): Fix logic using fixtype function.
+ (do_mpfr_atan2, do_mpfr_intdiv): Fix lint check for non-numeric
+ arguments.
+ (do_mpfr_func, do_mpfr_int, do_mpfr_compl, get_intval, do_mpfr_srand):
+ Fix lint check for non-numeric argument.
+ (do_mpfr_strtonum): Use fixtype and stop testing for NUMCUR bit.
+ * node.c (r_force_number): Eliminate pointless save and restore of
+ terminating NUL char. Always set NUMCUR and clear MAYBE_NUM, and
+ convert STRING to NUMBER if appropriate, fixing bugs in flag
+ manipulations. For non-decimal data, need to consider whether there
+ is trailing non-numeric data in deciding whether a MAYBE_NUM should
+ be converted to a NUMBER, so take advantage of new endptr arg
+ to nondec2awknum.
+
2016-06-14 Arnold D. Robbins <arnold@skeeve.com>
* builtin.c (do_sub): Fix sub for long runs of backslashes.
Thanks to Mike Brennan for the report.
+
+ Unrelated:
+ * ext.c (get_argument): Remove unused variable pcount.
2016-06-10 Arnold D. Robbins <arnold@skeeve.com>
@@ -82,6 +289,16 @@
optional sign.
(r_force_number): Use it. Thanks to Mike Brennan for the report.
+2016-05-30 Andrew J. Schorr <aschorr@telemetry-investments.com>
+
+ * gawkapi.h (awk_ext_func_t): Rename num_expected_args to
+ max_expected_args, and explain in the comment that it doesn't really
+ matter.
+ * ext.c (make_builtin): Replace num_expected_args with
+ max_expected_args.
+ (get_argument): Do not check whether the argument number exceeds
+ the maximum expected by the function.
+
2016-05-30 Arnold D. Robbins <arnold@skeeve.com>
* main.c (arg_assign): Fully bracket ifdefs around call
@@ -130,6 +347,13 @@
(api_set_argument): Pass (NODE *) returned by get_argument to
get_array_argument.
+2016-05-25 Manuel Collado <mcollado2011@gmail.com>.
+
+ * gawkapi.c (api_nonfatal): New function.
+ (api_impl): Include it.
+ * gawkapi.h (struct gawk_api): Add api_nonfatal member.
+ (nonfatal): New macro.
+
2016-05-12 Arnold Robbins <arnold@skeeve.com>
* str_array.c (str_lookup): Remove MAYBE_NUM from subscript flags.
@@ -142,12 +366,20 @@
call to system.
* io.c (redirect, gawk_popen [PIPES_SIMULATED]): Same.
-
2016-05-12 Eli Zaretskii <eliz@gnu.org>
* nonposix.h: Add prototypes for Posix functions emulated in pc/*
files.
+2016-05-09 Andrew J. Schorr <aschorr@telemetry-investments.com>
+
+ * interpret.h (r_interpret): Op_ext_builtin. No need to test whether
+ op == Op_ext_builtin, since we wouldn't be here otherwise.
+
+2016-05-03 Andrew J. Schorr <aschorr@telemetry-investments.com>
+
+ * builtin.c (format_tree): Do not waste a byte at the end of a string.
+
2016-05-03 Andrew J. Schorr <aschorr@telemetry-investments.com>
* builtin.c (format_tree): After the string has been rendered, use
@@ -223,6 +455,15 @@
'system' differently under --traditional, as the low 8 bits are
the most interesting.
+2016-04-06 Arnold D. Robbins <arnold@skeeve.com>
+
+ * builtin.c (do_printf): Allow a write to the closed write-end of
+ a two-way pipe to be nonfatal if NONFATAL is set for it.
+ (do_print): Ditto.
+ (do_print_rec): Ditto.
+ * io.c (do_getline_redir): Same thing for reading from a closed
+ read end of a two-way pipe. Fatal error.
+
2016-04-04 Arnold D. Robbins <arnold@skeeve.com>
* builtin.c (do_fflush): Add warning for flush to two-way
@@ -240,12 +481,54 @@
read end of a two-way pipe. Fatal error.
* NEWS: Updated.
+2016-03-27 Stephen Davies <sdavies@sdc.com.au>
+
+ * awkgram.y (get_comment): Strip CRs from comment. Strip
+ off trailing newlines.
+
+2016-03-21 Arnold D. Robbins <arnold@skeeve.com>
+
+ * profile.c (pprint): Improve handling of comment after
+ and if statement without an else.
+
+2016-03-19 Arnold D. Robbins <arnold@skeeve.com>
+
+ Considerable improvements to handling of comments when pretty
+ printing, particularly for end-of-line comments.
+
+ * awkgram.y (prior_comment, comment_to_save): New variables.
+ (add_pending_comment): New function.
+ (grammar): Jump through lots more hoops to capture comments.
+ Due to shift-reduce parsing, there can be up to two comments
+ captured and waiting to be saved; be sure to get them both and
+ at the right times. This is difficult since comments have no
+ real syntactic exisitence. Call add_pending_comment on most of
+ the simple statements.
+ (get_comment): Save a pre-existing comment in prior_comment.
+ (split_comment): Use comment_to_save instead of `comment'.
+ * profile.c (end_line): Change to return the instruction after
+ the comment that gets printed; adjust return type.
+ (pprint): Add skip_comment static variable. Adjust logic for
+ skipping an end-of-line comment; only do it if skip_comment is
+ true. This is set to true in places where we can't use the
+ return value from end_line(). Call end_line() in many more places.
+ (pp_func): Handle end-of-line comments after a function header.
+
+2016-03-17 Arnold D. Robbins <arnold@skeeve.com>
+
+ * debug.c (print_instruction): For Op_comment, improve notation as
+ to whether it's a full comment or an end of line comment.
+
2016-03-14 Arnold D. Robbins <arnold@skeeve.com>
* io.c (socketopen): For SOCK_DGRAM, set read_len to sizeof
remote_addr. Makes UDP more or less work again.
Thanks to Juergen Kahrs for the fix.
+2016-03-11 Arnold D. Robbins <arnold@skeeve.com>
+
+ * debug.c (print_instruction): Normalize printing of comment dump.
+
2016-03-10 Arnold D. Robbins <arnold@skeeve.com>
* builtin.c (do_system): Further improvements. Catch core dump
@@ -277,6 +560,11 @@
* debug.c (print_instruction): Improvements in instruction dump
for if and else.
+2016-03-01 Arnold D. Robbins <arnold@skeeve.com>
+
+ * debug.c (print_instruction): For Op_comment, add notation as
+ to whether it's a full comment or an end of line comment.
+
2016-02-29 Arnold D. Robbins <arnold@skeeve.com>
* profile.c (pp_list): Handle the case of nargs equal to zero.
@@ -325,6 +613,43 @@
* README, NEWS: Updated to reflect use of Texinfo 6.1.
+ Unrelated:
+
+ * configure.ac: Switch to AC_PROG_CC_C99 to enable C99
+ compilation and features.
+ * dfa.c: Sync with GNU grep, go back to C99 style declarations
+ at point of use.
+
+2016-02-05 Arnold D. Robbins <arnold@skeeve.com>
+
+ Make optimization (constant folding and tail call recursion)
+ be on by default.
+
+ * awkgram.y (common_exp): Only do concatenation of two strings(!)
+ * main.c (do_optimize): Init to true.
+ (optab): Add new -s/--no-optimize option.
+ (usage): Update message to include it.
+ (parse_args): Parse it. Set do_optimize to false if pretty
+ printing or profiling.
+ * NEWS: Updated.
+
+2016-01-28 Arnold D. Robbins <arnold@skeeve.com>
+
+ * Makefile.am (SUBDIRS): Include extras. Otherwise dist does
+ doesn't work.
+
+2016-01-27 Arnold D. Robbins <arnold@skeeve.com>
+
+ * configure.ac (GAWK_AC_AIX_TWEAK): Remove call.
+ * configure: Regenerated.
+ * io.c (GAWK_AIX): Check _AIX instead.
+ * custom.h (_AIX): Add define of _XOPEN_SOURCE_EXTENDED.
+
+ Unrelated:
+
+ * configure.ac: Remove old stuff for ISC Unix, no longer needed.
+ * configure: Regenerated.
+
2016-01-25 John E. Malmberg <wb8tyw@qsl.net>
* io.c (redirect): Need to call close_one more than once after
@@ -386,6 +711,12 @@
* ChangeLog: Cleanup spurious extra whitespace.
+2016-01-03 Arnold D. Robbins <arnold@skeeve.com>
+
+ * configure.ac (GAWK_AC_LINUX_ALPHA): Remove call.
+ * configure: Regenerated.
+ * NEWS: Document removal of support for GNU/Linux on Alpha.
+
2016-01-02 Arnold D. Robbins <arnold@skeeve.com>
* dfa.c (add_utf8_anychar): Minor change in declaration of
@@ -398,6 +729,11 @@
empty else part for pretty printing. Bug report by
ziyunfei <446240525@qq.com>.
+2015-12-20 Arnold D. Robbins <arnold@skeeve.com>
+
+ * io.c (nonfatal): New static constant string.
+ * is_non_fatal, is_non_fatal_redirect: Use it.
+
2015-12-16 Arnold D. Robbins <arnold@skeeve.com>
* io.c (two_way_open): Remove unneeded close of slave in the
@@ -435,6 +771,12 @@
* dfa.c: Sync with GNU grep.
+2015-10-25 Arnold D. Robbins <arnold@skeeve.com>
+
+ * awkgram.y (yylex): Fix invalid write problems.
+ Reported by Hanno Boeck <hanno@hboeck.de>.
+ Only appeared in master. Harumph.
+
2015-10-16 Arnold D. Robbins <arnold@skeeve.com>
* Makefile.am (SUBDIRS): Fix ordering so that
@@ -561,6 +903,98 @@
* dfa.h, dfa.c: Sync with GNU grep.
+2015-06-29 Arnold D. Robbins <arnold@skeeve.com>
+
+ * awkgram.y (yylex): If gawk extension function is found as
+ a function in a user-defined function body, treat it normally.
+ Makes eval "print and(a, 1)" work in the debugger again.
+ Thanks, yet again, to Hermann Peifer.
+ * interpret.h (r_interpret): Op_subscript. UPREF if the
+ element value is a typed regexp. Thanks to Hermann Peifer.
+
+2015-06-28 Arnold D. Robbins <arnold@skeeve.com>
+
+ Improve memory tracking of typed regexps.
+
+ * awkgram.y (make_regnode): Set valref to 1.
+ * interpret.h (r_interpret): Have Op_push_re upref typed regexp.
+ * builtin.c (do_typeof): OK to deref typed regex.
+ * awk.h (force_string): Do dupnode on the regexp text.
+
+2015-06-26 Arnold D. Robbins <arnold@skeeve.com>
+
+ Remove support for old-style extensions.
+
+ * awk.h (Node_old_ext_func, Op_old_ext_func): Removed.
+ Remove all uses throughout the code.
+ (load_old_ext, make_old_builtin): Remove declarations.
+ * ext.c (load_old_ext, make_old_builtin): Removed.
+ * awkgram.y (tokentab): Remove "extension" entry.
+ * eval.c (Node_old_ext_funci, Op_old_ext_func): Remove from tables.
+ * interpret.h (interpret): Remove stuff for old extensions.
+
+ Unrelated:
+
+ * builtin.c (do_typeof): Add support for strnum, distinguish
+ untyped from unassigned, use "string" and "number". Thanks to
+ Hermann Peifer for suggesting inclusion of strnum.
+
+2015-06-25 Arnold D. Robbins <arnold@skeeve.com>
+
+ Further work straightening out memory management for typeof.
+
+ * awk.h (DEREF): Add an assert.
+ * builtin.c (do_typeof): Add comments, cases where not to deref.
+ * debug.c (print_instruction): Add Op_push_arg_untyped.
+ * interpret.h (r_interpret): Additional comments / tweaks for
+ Op_push_arg_untyped.
+
+ Unrelated. Make `x = @/foo/ ; print x' print something.
+
+ * builtin.c (do_print): Check for Node_typedregex and handle it.
+ Needed for adding test code.
+
+ Unrelated. Typo fix.
+
+ * debug.c (initialize_watch_item): Dupnode the right thing.
+
+2015-06-22 Arnold D. Robbins <arnold@skeeve.com>
+
+ * awkgram.y (snode): Make isarray not scalarize untyped parameters
+ also.
+ * profile.c (pprint): Add Op_push_arg_untyped.
+
+ Improve debugger support for typed regexps.
+ Thanks to Hermann Peifer for the bug report.
+
+ * awkgram.y (valinfo): Add support for Node_typedregex.
+ * debug.c (watchpoint_triggerred): Handle Node_typedregex.
+ (initialize_watch_item): Ditto.
+ (print_memory): Ditto.
+
+ Fix typeof to work on subarrays. Thanks, yet again, to
+ Hermann Peifer for the bug report.
+
+ * builtin.c (do_typeof): Don't deref Node_var_array.
+
+2015-06-21 Arnold D. Robbins <arnold@skeeve.com>
+
+ Fixes for typeof - Don't let typeof change an untyped variable
+ into a scalar.
+
+ * awk.h (opcodeval): Add Op_push_arg_untyped.
+ * awkgram.y (snode): Separate out case for do_typeof, use
+ Op_push_arg_untyped.
+ * builtin.c (do_typeof): Arg will be equal to Nnull_string
+ if it's untyped.
+ * eval.c (optypes): Add Op_push_arg_untyped.
+ * interpret.h (r_interpret): Add Op_push_arg_untyped handling.
+
+2015-06-19 Arnold D. Robbins <arnold@skeeve.com>
+
+ * builtin.c (do_isarray): Minor edit to lint warning.
+ * TODO: Updated.
+
2015-06-14 Arnold D. Robbins <arnold@skeeve.com>
* regcomp.c, regex_internal.h, regexec.c: Sync with GLIBC.
@@ -574,6 +1008,16 @@
* regex_internal.h: Clean up defines for non-GCC for attribute;
essentially sync it with GLIBC.
+2015-06-12 Arnold D. Robbins <arnold@skeeve.com>
+
+ * awkgram.y: Finish converting "hard" regex to "typed" regex.
+
+2015-05-31 Arnold D. Robbins <arnold@skeeve.com>
+
+ * field.c (posix_def_parse_field): Removed. It's no longer
+ needed after updates to the POSIX standard. Thanks to
+ Michael Klement <michael.klement@usa.net> for pointing this out.
+
2015-05-26 Paul Eggert <eggert@Penguin.CS.UCLA.EDU>
* floatcomp.c (count_trailing_zeros): New function.
@@ -598,6 +1042,17 @@
* symbol.c (load_symbols): Plug minor memory leak by calling unref(tmp)
on "identifiers" string after assoc_lookup is done with it.
+2015-05-15 Andrew J. Schorr <aschorr@telemetry-investments.com>
+
+ * main.c (load_procinfo_argv): New function to save argv array values
+ in PROCINFO["argv"][0..argc-1].
+ (load_procinfo): Call load_procinfo_argv.
+
+2015-05-11 Arnold D. Robbins <arnold@skeeve.com>
+
+ * awk.h, awkgram.y, builtin.c, eval.c profile.c, re.c:
+ Change Node_hardregex to Node_typedregex everywhere.
+
2015-05-05 Arnold D. Robbins <arnold@skeeve.com>
* awkgram.y (yylex): Yet Another Fix for parsing bracket
@@ -608,6 +1063,14 @@
* config.guess, config.sub: Get latest versions.
+ Make profiling for hard regexes work.
+
+ * profile.c (pp_string_or_hard_regex): Renamed from pp_string.
+ Add bool param for hard regex and add @ if so.
+ (pp_string): New function, calls pp_string_or_hard_regex.
+ (pp_hard_regex): New function, calls pp_string_or_hard_regex.
+ (pprint): Adjust to print a hard regex correctly.
+
2015-05-01 Arnold D. Robbins <arnold@skeeve.com>
* awkgram.y: Make sure values are not null in param list.
@@ -632,6 +1095,11 @@
2015-04-28 Arnold D. Robbins <arnold@skeeve.com>
+ * builtin.c (isarray): Add lint warning that isarray()
+ is deprecated.
+
+2015-04-28 Arnold D. Robbins <arnold@skeeve.com>
+
* awkgram.y (yylex): Rework the bracket handling from zero.
Thanks to Michal Jaegermann for yet another test case.
@@ -664,6 +1132,21 @@
2015-04-16 Arnold D. Robbins <arnold@skeeve.com>
+ Let parameter names shadow the names of gawk additional built-ins.
+ Make it actually work.
+
+ * awkgram.y (want_param_names): Now an enum, there are three states.
+ (grammar): Set states properly.
+ (yylex): Improve checking logic.
+
+2015-04-16 Arnold D. Robbins <arnold@skeeve.com>
+
+ * configure.ac: Updated by autoupdate.
+ * configure, aclocal.m4: Regenerated.
+ * io.c, main.c, profile.c: Removed use of RETSIGTYPE.
+
+2015-04-16 Arnold D. Robbins <arnold@skeeve.com>
+
* builtin.c (do_strftime): Use a double for the timestamp and
check that the value is within range for a time_t.
@@ -677,6 +1160,14 @@
* NEWS: Updated.
+2015-04-15 Arnold D. Robbins <arnold@skeeve.com>
+
+ Let parameter names shadow the names of gawk additional built-ins.
+
+ * awkgram.y (want_param_names): New variable.
+ (yylex): Check it before returning a built-in token.
+ (grammar): Set and clear it in the right places.
+
2015-04-14 Arnold D. Robbins <arnold@skeeve.com>
* builtin.c (do_strftime): Restore checking for negative result and
@@ -690,6 +1181,23 @@
Unrelated:
* builtin.c (call_sub): Fix for indirect gensub, 3 args now works.
+ Unrelated:
+
+ * builtin.c (do_sub): Improve some variable names for readability
+ and add / expand some comments.
+
+ Unrelated:
+
+ * builtin.c (call_sub, call_match, call_split_func): Allow for
+ regex to be Node_hardregex.
+
+2015-04-14 Andrew J. Schorr <aschorr@telemetry-investments.com>
+ Arnold D. Robbins <arnold@skeeve.com>
+
+ * builtin.c (do_sub): Make computations smarter; initial len
+ to malloc, test for final amount after all matches done and
+ need to copy in the final part of the original string.
+
2015-04-13 Arnold D. Robbins <arnold@skeeve.com>
* regcomp.c (analyze): Prevent malloc(0).
@@ -711,6 +1219,15 @@
* Makefile.am (efence): Make this link again.
Thanks to Michal Jaegermann for pointing out the problem.
+2015-04-09 Andrew J. Schorr <aschorr@telemetry-investments.com>
+
+ * awkgram.y (yyerror): Rationalize buffer size computations. Remove
+ old valgrind workarounds.
+ * debug.c (gprintf): Rationalize buffer size computations.
+ (serialize_subscript): Ditto.
+ * io.c (iop_finish): Rationalize buffer size computations.
+ * profile.c (pp_string): Correct space allocation computation.
+
2015-04-08 John E. Malmberg <wb8tyw@qsl.net>
* custom.h: VMS shares some code paths with ZOS_USS in
@@ -752,6 +1269,27 @@
Thanks to Andrew Schorr for finding the problem and supplying
initial code; I did it slightly differently.
+2015-04-03 Arnold D. Robbins <arnold@skeeve.com>
+
+ * awk.h (force_string): If hard_regex, return string text of the regex.
+ (force_string, force_number): If hard_regex, return Nnull_string.
+ * awkgram.y: Fix ~ and !~ with @/.../.
+ * eval.c (setup_frame): Handle a hard regex.
+ * re.c (avoid_dfa): Ditto.
+
+2015-04-02 Andrew J. Schorr <aschorr@telemetry-investments.com>
+
+ * NEWS: Rename div to intdiv.
+
+2015-04-02 Arnold D. Robbins <arnold@skeeve.com>
+
+ Rename div() to intdiv().
+
+ * builtin.c (do_intdiv): Renamed from do_div.
+ * mfpr.c (do_mpfr_intdiv): Renamed from do_mpfr_div.
+ * awk.h: Update declarations.
+ * awkgram.y (tokentab, snode): Revise accordingly.
+
2015-03-31 Arnold D. Robbins <arnold@skeeve.com>
* awk.h (call_sub): Renamed from call_sub_func.
@@ -768,6 +1306,12 @@
the buitin function expects.
* eval.c (r_get_field): Make extern.
+2015-03-27 Arnold D. Robbins <arnold@skeeve.com>
+
+ * io.c (redirect): Change not_string from int to bool.
+ * gawkapi.c (api_get_file): Minor stylistic improvements.
+ * NEWS: Updated for retryable I/O and new API function.
+
2015-03-24 Arnold D. Robbins <arnold@skeeve.com>
* awkgram.y (make_regnode): Make extern.
@@ -782,6 +1326,10 @@
* interpret.h (r_interpret): When Op_K_exit has an argument of
Nnull_string, do not update exit_val, since no value was supplied.
+2015-03-24 Arnold D. Robbins <arnold@skeeve.com>
+
+ * awk.h, gawkapi.c, io.c: Minor code reformatting.
+
2015-03-20 Arnold D. Robbins <arnold@skeeve.com>
Start on fixing indirect calls of builtins.
@@ -793,6 +1341,24 @@
* interpret.h (r_interpret): If calling do_sub, do it through
call_sub_func().
+2015-03-19 Arnold D. Robbins <arnold@skeeve.com>
+
+ * re.c (re_update): Handle hard regex - for sub/gsub/gensub.
+ * awkgram.y (grammar): Add support for hard_regex with ~ and !~;
+ allowed only on the right hand side.
+ (mk_rexp): Handle a hard regex.
+
+2015-03-18 Arnold D. Robbins <arnold@skeeve.com>
+
+ * builtin.c (do_typeof): Be smarter about checking for uninitialized
+ values; can now detect and return "untyped" for such values.
+ * awkgram.y (yylex): Collect @/.../ entirely in the lexer and return
+ a new terminal (HARD_REGEX).
+ (regexp): Reverted to just a regular awk regexp constant.
+ (hard_regexp): New nonterminal, can be used only in direct
+ assignment and as an argument in function call. New set of nonterminals
+ for function call expression lists. More work still to do.
+
2015-03-18 Arnold D. Robbins <arnold@skeeve.com>
* config.guess, config.sub: Updated, from libtool 2.4.6.
@@ -807,6 +1373,26 @@
* re.c (regexflags2str): Removed. It was redundant.
+ * io.c (devopen): Change the logic such that if nonfatal is true
+ for the socket, don't do retries. Also clean up the formatting
+ some. At strictopen, check if errno is ENOENT and if so, propagate
+ the error from getaddrinfo() up to the caller. Add explanatory
+ comments.
+
+2015-02-28 Andrew J. Schorr <aschorr@telemetry-investments.com>
+
+ * io.c (pty_vs_pipe): Remove check for NULL PROCINFO_node, since
+ this is now checked inside in_PROCINFO.
+
+2015-02-27 Andrew J. Schorr <aschorr@telemetry-investments.com>
+
+ * io.c (socketopen): New parameter hard_error; set it if
+ getaddrinfo() fails. Change fatals to warnings.
+ (devopen): Pass in address of boolean hard_error variable
+ and stop trying to open the file if hard_error is true.
+ Save and restore errno around call to socketopen() and
+ use restored errno if open() fails at strictopen.
+
2015-02-27 Arnold D. Robbins <arnold@skeeve.com>
* symbol.c (check_param_names): Fix argument order in memset() call.
@@ -814,6 +1400,20 @@
a long-standing problem where `-lm' was used twice in the final
compilation line.
+2015-02-27 Arnold D. Robbins <arnold@skeeve.com>
+
+ Start on making regexp a real type.
+
+ * awk.h (Node_hardregex): New node type.
+ (do_typeof): Add declaration.
+ * awkgram.y: Make @/.../ a hard regex.
+ (tokentab): New entry for typeof() function.
+ (snode): Try to handle typeof().
+ (make_regnode): Handle Node_hardregex.
+ * builtin.c (do_typeof): New function.
+ * eval.c (nodetypes): Add Node_hardregex.
+ * re.c (re_update): Check for hardregex too in assert.
+
2015-02-24 Arnold D. Robbins <arnold@skeeve.com>
* POSIX.STD: Update copyright year.
@@ -837,6 +1437,34 @@
* gawkapi.h: Fix spelling error in comment.
+2015-02-10 Arnold D. Robbins <arnold@skeeve.com>
+
+ * profile.c (pprint): Restore printing of count for rules.
+ Bug report by Hermann Peifer.
+
+2015-02-08 Arnold D. Robbins <arnold@skeeve.com>
+
+ * io.c: Make it "NONFATAL" everywhere.
+
+2015-02-08 Andrew J. Schorr <aschorr@telemetry-investments.com>
+
+ * awk.h (RED_NON_FATAL): Removed.
+ (redirect): Add new failure_fatal parameter.
+ (is_non_fatal_redirect): Add declaration.
+ * builtin.c (efwrite): Rework check for non-fatal.
+ (do_printf): Adjust calls to redirect.
+ (do_print_rec): Ditto. Move check for redirection error up.
+ * io.c (redflags2str): Remove RED_NON_FATAL.
+ (redirect): Add new failure_fatal parameter. Simplify the code.
+ (is_non_fatal_redirect): New function.
+ (do_getline_redir): Adjust calls to redirect.
+
+2014-12-27 Arnold D. Robbins <arnold@skeeve.com>
+
+ * awk.h (is_non_fatal_std): Declare new function.
+ * io.c (is_non_fatal_std): New function.
+ * builtin.c (efwrite): Call it.
+
2015-02-07 Arnold D. Robbins <arnold@skeeve.com>
* regcomp.c, regex.c, regex.h, regex_internal.c, regex_internal.h,
@@ -899,6 +1527,11 @@
* command.c: Ditto.
* NEWS: Note same.
+2015-01-16 Stephen Davies <sdavies@sdc.com.au>
+
+ * awkgram.y (rule): Set first_rule to false. Catches more cases
+ for gathering comments. Thanks to Hermann Peifer for the test case.
+
2015-01-15 Arnold D. Robbins <arnold@skeeve.com>
* dfa.h, dfa.c: Sync with grep. Mainly copyright updates.
@@ -916,6 +1549,22 @@
* builtin.c (do_length): Update comment.
* main.c (init_vars): Just call load_procinfo() and `load_environ()'.
+2015-01-08 Andrew J. Schorr <aschorr@telemetry-investments.com>
+
+ Revert changes to API deferred variable creation -- these variables
+ should be created when lookup is called, not when update is called.
+ * awk.h (variable_create): Remove function declaration.
+ * awkgram.y (variable_create): Remove function.
+ (variable): Restore variable_create functionality inline.
+ * gawkapi.c (api_sym_update): Revert to using install_symbol, since the
+ deferred variable check should be done when lookup is called, not here.
+
+2015-01-07 Andrew J. Schorr <aschorr@telemetry-investments.com>
+
+ * gawkapi.c (api_set_array_element): Remove stray call to
+ make_aname. I cannot see what purpose this served. Maybe I am
+ missing something.
+
2015-01-07 Arnold D. Robbins <arnold@skeeve.com>
* configure.ac: Update debug flags if developing.
@@ -934,6 +1583,124 @@
(do_add_scrfile): Set it on -l.
(process_deferred): Check it also.
+2015-01-06 Andrew J. Schorr <aschorr@telemetry-investments.com>
+
+ * gawkapi.c (api_sym_update): If copying a subarray, must update
+ the parent_array pointer. Also, call the astore hook if non-NULL.
+ (api_set_array_element): Call the astore hook if non-NULL.
+
+2015-01-06 Andrew J. Schorr <aschorr@telemetry-investments.com>
+
+ * awk.h (variable_create): Now takes a 3rd argument to tell caller
+ whether this is a deferred variable.
+ * awkgram.y (variable_create): Return indicator of whether this is
+ a deferred variable in a newly added 3rd arg.
+ (variable): Pass 3rd arg to variable_create.
+ * gawkapi.c (api_sym_update): If we triggered the creation of a deferred
+ variable, we must merge the extension's array elements into the deffered
+ array, not the other way around. The ENVIRON array has special funcs
+ to call setenv and unsetenv.
+
+2015-01-06 Andrew J. Schorr <aschorr@telemetry-investments.com>
+
+ * awk.h (variable_create): Declare new function.
+ * awkgram.y (variable_create): New function to create a variable
+ taking the deferred variable list into consideration.
+ (variable): Call new function variable_create if the variable is
+ not found.
+ * gawkapi.c (api_sym_update): If an array is being created, then
+ call new function variable_create instead of install_symbol. If this
+ is the first reference to a deferred variable, than the new array
+ may contain elements that must be merged into the array provided by
+ the extension.
+
+2015-01-05 Andrew J. Schorr <aschorr@telemetry-investments.com>
+
+ * io.c (wait_any): If the `interesting' argument is non-zero, then we
+ must not return until that child process has exited, since the caller
+ gawk_pclose depends on our returning its exit status. So in that case,
+ do not pass WNOHANG to waitpid.
+
+2015-01-04 Andrew J. Schorr <aschorr@telemetry-investments.com>
+
+ * gawkapi.h: Fix another comment typo.
+
+2015-01-04 Andrew J. Schorr <aschorr@telemetry-investments.com>
+
+ * gawkapi.h: Fix typo in comment.
+
+2015-01-02 Andrew J. Schorr <aschorr@telemetry-investments.com>
+
+ * gawkapi.h (gawk_api): Modify api_get_file to remove the typelen
+ argument.
+ (get_file): Remove typelen argument from the macro.
+ * gawkapi.c (api_get_file): Remove typelen argument.
+
+2014-12-24 Arnold D. Robbins <arnold@skeeve.com>
+
+ * profile.c (pprint): Be sure to set ip2 in all paths
+ through the code. Thanks to GCC 4.9 for the warning.
+
+2014-12-18 Arnold D. Robbins <arnold@skeeve.com>
+
+ * builtin.c (do_sub): Do not waste a byte at the end of a string.
+
+2014-12-14 Arnold D. Robbins <arnold@skeeve.com>
+
+ * awkgram.y (yyerror): Do not waste a byte at the end of a string.
+ * builtin.c (do_match): Ditto.
+ * command.y (append_statement): Ditto.
+ * debug.c (gprintf, serialize): Ditto.
+ * field.c (set_FIELDWIDTHS): Ditto.
+ * io.c.c (grow_iop_buffer): Ditto.
+ * profile.c (pp_string, pp_group3): Ditto.
+
+2014-12-14 Andrew J. Schorr <aschorr@telemetry-investments.com>
+
+ * array.c (concat_exp): Do not waste a byte at the end of a string.
+ * awkgram.y (common_exp): Ditto.
+ * builtin.c (do_substr): Ditto.
+ * eval.c (set_OFS): Ditto.
+ * field.c (rebuild_record): Ditto.
+ * gawkapi.h (r_make_string): Ditto.
+ * interpret.h (r_interpret): Ditto for Op_assign_concat.
+ * node.c (r_format_val, r_dupnode, make_str_node, str2wstr, wstr2str):
+ Ditto.
+ * re.c (make_regexp): Ditto.
+
+2014-12-20 Arnold D. Robbins <arnold@skeeve.com>
+
+ Enable non-fatal output on per-file or global basis,
+ via PROCINFO.
+
+ * awk.h (RED_NON_FATAL): New redirection flag.
+ * builtin.c (efwrite): If RED_NON_FATAL set, just set ERRNO and return.
+ (do_printf): Check errflg and if set, set ERRNO and return.
+ (do_print): Ditto.
+ (do_print_rec): Ditto.
+ * io.c (redflags2str): Update table.
+ (redirect): Check for global PROCINFO["nonfatal"] or for
+ PROCINFO[file, "nonfatal"] and don't fail on open if set.
+ Add RED_NON_FATAL to flags.
+ (in_PROCINFO): Make smarter and more general.
+
+2014-12-12 Stephen Davies <sdavies@sdc.com.au>
+
+ Improve comment handling in pretty printing.
+
+ * awk.h (comment_type): New field in the node.
+ (EOL_COMMENT, FULL_COMMENT): New defines.
+ * awkgram.y (block_comment): New variable.
+ (check_comment): New function.
+ (grammar): Add code to handle comments as needed.
+ (get_comment): Now takes a flag indicating kind of comment.
+ (yylex): Collect comments appropriately.
+ (append_rule): Ditto.
+ * profile.c (pprint): Smarten up comment handling.
+ Have printing \n take comments into account.
+ (end_line): New function.
+ (pp_func): Better handling of function comments.
+
2014-12-10 Arnold D. Robbins <arnold@skeeve.com>
* dfa.c: Sync with GNU grep.
@@ -1038,6 +1805,36 @@
and a it's a Node_val set to Nnull_string, return AWK_UNDEFINED instead
of AWK_NUMBER 0.
+2014-11-06 Andrew J. Schorr <aschorr@telemetry-investments.com>
+
+ * awk.h (redirect_string): First argument should be const. Add a new
+ extfd argument to enable extensions to create files with pre-opened
+ file descriptors.
+ (after_beginfile): Declare function used in both eval.c and gawkapi.c.
+ * eval.c (after_beginfile): Remove extern declaration now in awk.h.
+ * gawkapi.c (api_get_file): Implement API changes to return
+ awk_input_buf_t and/or awk_output_buf_t info, as well as accept an
+ fd for inserting an opened file into the table.
+ * gawkapi.h (gawk_api): Modify the api_get_file declaration to
+ return awk_bool_t and add 3 new arguments -- a file descriptor
+ for inserting an already opened file, and awk_input_buf_t and
+ awk_output_buf_t to return info about both input and output.
+ (get_file): Add new arguments to the macro.
+ * io.c (redirect_string): First arg should be const, and add a new
+ extfd arg so extensions can pass in a file that has already been
+ opened by the extension. Use the passed-in fd when appropriate,
+ and pass it into two_way_open.
+ (redirect): Pass new fd -1 arg to redirect_string.
+ (two_way_open): Accept new extension fd parameter and open it
+ as a socket.
+
+2014-11-05 Andrew J. Schorr <aschorr@telemetry-investments.com>
+
+ * io.c (retryable): New function to indicate whether I/O can be
+ retried for this file instead of throwing a hard error.
+ (get_a_record) Check whether this file is configured for retryable
+ I/O before returning nonstandard -2.
+
2014-11-03 Norihiro Tanaka <noritnk@kcn.ne.jp>
* re.c (research): Use dfa superset to improve matching speed.
@@ -1060,6 +1857,16 @@
(is_unary_minus): New function.
(pp_concat): Add checks for unary minus; needs to be parenthesized.
+2014-10-30 Andrew J. Schorr <aschorr@telemetry-investments.com>
+
+ * NEWS: Mention installation of /etc/profile.d/gawk.{csh,sh}.
+
+2014-10-29 Andrew J. Schorr <aschorr@telemetry-investments.com>
+
+ * configure.ac (AC_CONFIG_FILES): Add extras/Makefile.
+ * Makefile.am (SUBDIRS): Add extras.
+ * extras: Add new subdirectory.
+
2014-10-29 Arnold D. Robbins <arnold@skeeve.com>
* dfa.c: Sync with GNU grep. Again, again.
@@ -1121,12 +1928,35 @@
* profile.c (pprint): Fix typo in header. Sheesh.
+ Unrelated:
+
+ * awkgram.y (mk_program): Add a comment that we don't need to
+ clear the comment* variables.
+
2014-10-04 Arnold D. Robbins <arnold@skeeve.com>
* profile.c (pp_string_fp): Fix breaklines case to actually
output the current letter. This broke at gawk 4.0.0. Sigh.
Thanks to Bert Bos (bert@w3.org) for the report.
+2014-10-03 Stephen Davies <sdavies@sdc.com.au>
+
+ * awkgram.y (program_comment): Renamed from comment0.
+ (function_comment): Renamed from commentf.
+
+2014-10-02 Arnold D. Robbins <arnold@skeeve.com>
+
+ * awkgram.y, profile.c: Minor white space cleanups.
+
+2014-10-01 Arnold D. Robbins <arnold@skeeve.com>
+
+ Fix a few compile warnings:
+
+ * awkgram.y (split_comment): Make static.
+ General: Remove some unused variables, clean up some whitepace nits.
+
+ * profile.c (indent): Add some braces to turn off compiler warnings.
+
2014-09-29 Andrew J. Schorr <aschorr@telemetry-investments.com>
* main.c (main): In optlist, it should say "h", not "h:", since there
@@ -1199,6 +2029,45 @@
since use of isalnum() let non-ASCII letters slip through into
identifiers.
+2014-09-13 Stephen Davies <sdavies@sdc.com.au>
+
+ When doing pretty-printing (but not profiling), include the original
+ comments in the output.
+
+ General rules:
+
+ Pretty printing:
+ - Do NOT indent by a tab
+ - Do NOT print the header comments ("# BEGIN rules", etc.)
+ - DO print the comments that are in the program
+
+ Profiling:
+ - DO indent by a tab
+ - DO print the header comments
+ - Do NOT print the program's original comments
+
+ * awkgram.y (comment0, commentf): New varibles that are pointers to
+ program and function comments.
+ (get_comment): New function that retrieves consecutive comment lines
+ and empty lines as a unit).
+ (split_comment): New function: iff first block in the program is a
+ function and it is predeeded by comments, take the last non-blank
+ line as function comment and any preceeding lines as program comment.)
+
+ Following token rules were changed to handle comments:
+
+ * awkgram.y (pattern, LEX_BEGIN, LEX_END, LEX_BEGINFILE, LEX_ENDFILE,
+ action, function_prologue, statements): Update to handle comments.
+
+ Following functions were changed to handle comments:
+
+ * awkgram.y (mk_program, mk_function, allow_newline and yylex): Update
+ to handle comments. (Also fixed typo in case '\\'.)
+
+ * profile.c (print_comment): New function to format comment printing.
+ (indent, pprint, dump_prog, pp_func): Changed to handle comments and
+ the revised indentation rules.
+
2014-09-07 Arnold D. Robbins <arnold@skeeve.com>
* awk.h: Move libsigsegv stuff to ...
@@ -1260,6 +2129,27 @@
* regcomp.c, regex_internal.c: Sync with GBLIC. Why not.
+ Unrelated:
+
+ Remove support for MirBSD. It uglified the code too much
+ for no discernable gain.
+
+ * configure.ac: Remove check for MirBSD and define of
+ LIBC_IS_BORKED.
+ * dfa.c: Remove code depending on LIBC_IS_BORKED.
+ * main.c: Ditto.
+ * regcomp.c: Ditto.
+ * NEWS: Updated.
+
+2014-08-24 Arnold D. Robbins <arnold@skeeve.com>
+
+ * regex.h: Remove underscores in names of parameters in function
+ declarations. Tweak names as neeeded.
+
+2014-08-20 Arnold D. Robbins <arnold@skeeve.com>
+
+ * node.c (parse_escape): Max of 2 digits after \x.
+
2014-08-18 Arnold D. Robbins <arnold@skeeve.com>
* symbol.c: General formatting cleanup.
@@ -1284,6 +2174,13 @@
at how much to allocate. This came up in an email discussion
with Tom Dickey about mawk's gsub().
+2014-08-12 Juergen Kahrs <jkahrs@users.sourceforge.net>
+
+ * cmake/configure.cmake:
+ * cmake/package.cmake: Copyright update.
+ * README.cmake:
+ * README_d/README.cmake: Moved file.
+
2014-08-12 Arnold D. Robbins <arnold@skeeve.com>
OFS being set should rebuild $0 using previous OFS if $0
@@ -1355,6 +2252,12 @@
* awk.h (cleanup_mpfr): Add declaration.
* main.c (main): Add call to `cleanup_mpfr'.
+ Fix memory leak:
+
+ * mpfr.c (do_mpfr_div): Add unref to denominator and numerator
+ to not leak memory. Thanks to Katie Wasserman <katie@wass.net>
+ for isolating the problem to that routine.
+
2014-07-25 Arnold D. Robbins <arnold@skeeve.com>
* main.c (main): Add a warning message if -M is used and gawk was
@@ -1377,6 +2280,21 @@
2014-07-10 Arnold D. Robbins <arnold@skeeve.com>
+ New `div()' function to do integer division and remainder;
+ mainly useful for use with GMP integers. Thanks to
+ Katie Wasserman <katie@wass.net> for the suggestion.
+
+ * awk.h (do_div, do_mpfr_div): Declare new functions.
+ * builtin.c (do_div): New function.
+ * mpfr.c (do_mpfr_div): New function.
+ * awkgram.y (tokentab): New entry.
+ (snode): Add check for do_div/do_mpfr_div to make 3rd arg
+ be an array.
+ * NEWS: Updated.
+ * TODO: Updated.
+
+2014-07-10 Arnold D. Robbins <arnold@skeeve.com>
+
* awkgram.y (check_for_bad): New routine to do the fatal message,
with smarter checking.
(nextc): Call it as appropriate.
@@ -1391,6 +2309,13 @@
for bad characters in the source program.
(yylex): Adjust calls.
+2014-06-24 Arnold D. Robbins <arnold@skeeve.com>
+
+ * main.c (main): The --pretty-print option no longer runs the
+ program. This removes the need for the GAWK_NO_PP_RUN environment var.
+ * NEWS: Updated.
+ * TODO: Updated.
+
2014-06-22 Paul Eggert <eggert@penguin.cs.ucla.edu>
Bring in from GNULIB:
@@ -1511,6 +2436,13 @@
been moved into the inetfile() function.
(two_way_open): Update args to inetfile().
+2014-04-20 Arnold D. Robbins <arnold@skeeve.com>
+
+ * builtin.c (do_rand): Make calls to random() in predictable
+ order to avoid order of evaluation differences amongst compilers.
+ Thanks to Anders Magnusson <ragge@ludd.ltu.se> (of the PCC team)
+ for the suggestion.
+
2014-04-18 Arnold D. Robbins <arnold@skeeve.com>
* configure.ac: Change adding of -export-dynamic for GCC to be
@@ -1877,6 +2809,11 @@
* main.c (main): Ignore SIGPIPE. See the comment in the code.
Thanks to Alan Broder for reporting the issue.
+ Unrelated:
+
+ * rand.c (do_rand): Fix computation and loop checking against
+ 1.0 to use do..while.
+
2013-10-16 Arnold D. Robbins <arnold@skeeve.com>
Make -O work again. Turns out that C99 bool variables
@@ -1894,6 +2831,11 @@
* re.c (resetup): Add a comment about the joy of syntax bits.
+ Unrelated:
+
+ * builtin.c (do_rand): If result is exactly 1.0, keep trying.
+ Thanks to Nelson Beebe.
+
2013-10-10 Arnold D. Robbins <arnold@skeeve.com>
* dfa.c (lex): Sync with GNU grep. Handle multibyte \s and \S.
@@ -1913,6 +2855,13 @@
* dfa.c: Sync with GNU grep.
+2013-09-25 Arnold D. Robbins <arnold@skeeve.com>
+
+ * builtin.c (do_rand): Make the result more random by calling
+ random() twice. See the comment in the code. Thanks to
+ Bob Jewett <jewett@bill.scs.agilent.com> for the report and
+ the fix.
+
2013-09-24 Arnold D. Robbins <arnold@skeeve.com>
* debug.c (find_rule): Handle case where lineno is zero. Can happen
@@ -1994,6 +2943,12 @@
* regcomp.c, regex.h, regex_internal.h: Sync with GLIBC.
+2013-08-22 Arnold D. Robbins <arnold@skeeve.com>
+
+ * str_array.c (env_store): If the new value being stored is NULL,
+ pass in "" instead. Avoids core dump on Mac OS X.
+ Thanks to Hermann Peifer for the bug report.
+
2013-08-20 Arnold D. Robbins <arnold@skeeve.com>
* nonposix.h: New file. Contains FAKE_FD_VALUE.
@@ -2002,6 +2957,16 @@
2013-08-18 Arnold D. Robbins <arnold@skeeve.com>
+ Reflect updates to ENVIRON into the real environment.
+
+ * awk.h (init_env_array): Add declaration.
+ * main.c (load_environ): Call init_env_array.
+ * str_array.c (env_remove, env_store, env_clear, init_env_array):
+ New functions.
+ (env_array_func): New array vtable.
+
+2013-08-18 Arnold D. Robbins <arnold@skeeve.com>
+
* array.c (force_array): Set symbol->xarray to NULL before
initing the array if it was Node_var_new.
(null_array): Restore assert, undoing change of 2013-05-27.
@@ -2010,6 +2975,24 @@
* debug.c (print_memory): Fix whitespace / indentation.
+2013-08-02 Arnold D. Robbins <arnold@skeeve.com>
+
+ * awkgram.y (append_rule): Add attempt to insert any comment
+ before a rule. Commented out at the moment.
+
+2013-07-30 Arnold D. Robbins <arnold@skeeve.com>
+
+ * awk.h (enum opcodeval): Add Op_comment.
+ * awkgram.y (comment): New variable to hold comment text.
+ (statement): Add saved comments to lists being built.
+ (allow_newline): Save comment text if necessary. Append if have
+ existing text.
+ (yylex): Ditto.
+ * debug.c (print_instruction): Handle Op_comment.
+ * eval.c (optypes): Add entry for Op_comment.
+ * interpret.h (r_interpret): Ditto.
+ * profile.c (pprint): For Op_comment, print the comment text.
+
2013-07-24 Arnold D. Robbins <arnold@skeeve.com>
* io.c (FAKE_FD_VALUE): Move definition from here ...
@@ -2020,6 +3003,45 @@
* io.c (get_a_record): Change `min' to `MIN' for consistency with
other files and general practice.
+2013-07-07 Andrew J. Schorr <aschorr@telemetry-investments.com>
+
+ * configure.ac (AC_CHECK_FUNCS): Check for sigprocmask.
+ * io.c (wait_any): If sigprocmask is available, block signals instead
+ of ignoring them temporarily.
+
+2013-07-05 Andrew J. Schorr <aschorr@telemetry-investments.com>
+
+ * gawkapi.h (gawk_api): Document that the api_get_file function will not
+ access the file type and length arguments if the file name is empty.
+
+2013-07-04 Andrew J. Schorr <aschorr@telemetry-investments.com>
+
+ * configure.ac (AC_CHECK_FUNCS): Add a check for waitpid.
+ * io.c (wait_any): Enhance comment to explain why we loop reaping all
+ exited children when the argument is zero. When available, use waitpid
+ with WNOHANG to avoid blocking. Remove my previous incorrect patch to
+ exit after reaping the first child. The function is intended to
+ wait for all children, since we are not careful about reaping children
+ as soon as they die.
+
+2013-07-02 Andrew J. Schorr <aschorr@telemetry-investments.com>
+
+ * gawkapi.h (gawk_api): Remove unused api_lookup_file hook.
+ (lookup_file): Remove associated macro.
+ * gawkapi.c (api_lookup_file): Remove unused function.
+ (api_impl): Remove unused api_lookup_file hook.
+
+2013-07-02 Andrew J. Schorr <aschorr@telemetry-investments.com>
+
+ * awkgram.y (main_beginfile): Declare new global INSTRUCTION *.
+ (parse_program): Set main_beginfile to point to the BEGINFILE
+ instruction block.
+ * gawkapi.c (api_get_file): After nextfile starts a new file,
+ we need to run the BEGINFILE actions. We retrieve the
+ instruction pointer from main_beginfile and execute it until
+ we reach the Op_after_beginfile opcode. We then run after_beginfile
+ manually and restore the value of currule and source.
+
2013-07-04 Andrew J. Schorr <aschorr@telemetry-investments.com>
* gawkapi.h (awk_element_t): Add comment indicating that the array
@@ -2030,6 +3052,45 @@
force_string redundant, since node_to_awk_value does that internally
when we request a string.
+2013-07-02 Andrew J. Schorr <aschorr@telemetry-investments.com>
+
+ * eval.c (update_ERRNO_string): Set PROCINFO["errno"] to 0.
+ * io.c (inrec): Since get_a_record may now return -2, be sure
+ to throw an error in that case as well.
+ (wait_any): Fix what appears to be a bug. The old logic repeatedly
+ called wait until it failed. When a process has multiple children,
+ this causes it to stall until all of them have exited. Instead,
+ we now exit the function after the first successful wait call.
+ (do_getline_redir, do_getline): Handle case where get_a_record
+ returns -2.
+ (errno_io_retry): New function to decide whether an I/O operation should
+ be retried.
+ (get_a_record): When read returns an error, call errno_io_retry to
+ decide whether the operation should be retried. If so, return -2
+ instead of setting the IOP_AT_EOF flag.
+
+2013-07-01 Andrew J. Schorr <aschorr@telemetry-investments.com>
+
+ * eval.c (update_ERRNO_int, unset_ERRNO): Update PROCINFO["errno"].
+
+2013-06-30 Andrew J. Schorr <aschorr@telemetry-investments.com>
+
+ * awk.h (redirect_string): Declare new function that provides API access
+ to the redirection mechanism.
+ * gawkapi.h (GAWK_API_MINOR_VERSION): Bump from 0 to 1 since 2 new
+ hooks were added to the api.
+ (gawk_api_t): Add 2 new functions api_lookup_file and api_get_file.
+ (lookup_file, get_file): New macros to wrap the new API functions.
+ * gawkapi.c (curfile): Declare this extern, since it is needed
+ by lookup_file and get_flie.
+ (api_lookup_file): Find an open file using curfile or getredirect().
+ (api_get_file): Find or open a file using curfile or redirect_string().
+ (api_impl): Add api_lookup_file and api_get_file.
+ * io.c (redirect_string): Renamed from redirect and changed arguments
+ to take a string instead of a 'NODE *'. This allows it to be called
+ through the API's new get_file hook.
+ (redirect): Now implemented by calling redirect_string backend function.
+
2013-07-04 Arnold D. Robbins <arnold@skeeve.com>
* builtin.c (format_tree): Fixes for %c with multibyte characters