aboutsummaryrefslogtreecommitdiffstats
path: root/ChangeLog
diff options
context:
space:
mode:
Diffstat (limited to 'ChangeLog')
-rw-r--r--ChangeLog1832
1 files changed, 1831 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 17a6f566..a0f26b26 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,58 @@
+2017-03-16 Arnold D. Robbins <arnold@skeeve.com>
+
+ * configure.ac: Some cleanups.
+
+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-27 Andrew J. Schorr <aschorr@telemetry-investments.com>
* interpret.h [UNFIELD]: Fix condition for assignment from
@@ -10,6 +65,66 @@
Thanks to Rafael Fontenelle <rafaelff@gnome.org> and to
Eli Zaretskii <eliz@gnu.org>.
+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
@@ -17,6 +132,311 @@
not updating the node correctly by setting STRING and STRCUR flags
and setting stfmt.
+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.
+ [gawk_api_minor_version]: Reset to 0.
+ (api_add_ext_func): Update third arg to not be const.
+ * interpret.h (Op_ext_symbol): Revise lint check.
+
+2016-12-12 Arnold D. Robbins <arnold@skeeve.com>
+
+ * awk.h (INSTRUCTION): Replace min_required and max_expected
+ with a pointer to the extension functions awk_ext_func_t struct.
+ * ext.c (make_builtin): Store a pointer to the extension function
+ struct into the INSTRUCTION instead of the min and max.
+ * gawkapi.h (awk_ext_func): Use size_t instead of unsigned short.
+ Put min second, which preserves source code compatibility.
+ * interpret.h (Op_ext_builtin): Use the pointer for the info
+ directly. If lint and max_expected > 0 and args > max_expected
+ print a message and set max_expected to zero so we only print once
+ per function. Remove special case of both min and max being zero.
+ (Op_ext_func): Adjust creation of the data structures.
+
+2016-12-11 Arnold D. Robbins <arnold@skeeve.com>
+
+ * dfa.c: Sync with GNULIB.
+
+2016-12-05 Andrew J. Schorr <aschorr@telemetry-investments.com>
+
+ Add API support for strnum values.
+ * gawkapi.c (awk_value_to_node): Add AWK_STRNUM.
+ (assign_string): Add a type argument so we can use this for AWK_STRING
+ or AWK_STRNUM.
+ (node_to_awk_value): When AWK_NUMBER is requested, a regex value
+ should return false, as per the header file documentation.
+ Add support for AWK_STRNUM requests. When AWK_REGEX is requested,
+ implement the cases properly instead of always returning true.
+ Fix AWK_SCALAR logic. For AWK_UNDEFINED, rewrite using a switch
+ and support AWK_STRNUM.
+ (api_sym_update): Add AWK_STRNUM.
+ (api_sym_update_scalar): Add optimized support for updating AWK_STRNUM.
+ (valid_subscript_type): Add AWK_STRNUM.
+ (api_create_value): Add AWK_STRNUM.
+ * gawkapi.h (awk_valtype_t): Add AWK_STRNUM.
+ (strnum_value): New macro.
+ (Value fetching table): Updated.
+
+2016-12-04 Andrew J. Schorr <aschorr@telemetry-investments.com>
+
+ * gawkapi.c (assign_regex): Do not call assign_string, since we
+ know that a REGEX value is not an unterminated field string.
+ * gawkapi.h (make_regex): Delete macro.
+ (make_const_regex, make_malloced_regex): Add new macros to replace
+ make_regex with necessary memory management support.
+
+2016-12-04 Andrew J. Schorr <aschorr@telemetry-investments.com>
+
+ * awk.h (fixtype): Remove conditional checking if the node type
+ is Node_val. This is already covered by the assert, and if it's not
+ true, we have serious bugs.
+ * builtin.c (do_typeof): Do not treat Node_var the same way as
+ Node_val, since they are different beasts. In reality, the argument
+ to this function will never have type Node_var.
+
+2016-12-04 Andrew J. Schorr <aschorr@telemetry-investments.com>
+
+ * gawkapi.h (awk_element_t): Remove obsolete comment claiming that
+ the index will always be a string.
+ (gawk_api_t): Add new api_flatten_array_typed function and indicate
+ that api_flatten_array has been superseded.
+ (flatten_array_typed): New macro to call api_flatten_array_typed.
+ (flatten_array): Redefine using the new flatten_array_typed macro.
+ * gawkapi.c (api_flatten_array_typed): New function renamed from
+ api_flatten_array to flatten an array with the types requested by the
+ caller. Also update the comments and error messages.
+ (api_flatten_array): Now a wrapper around api_flatten_array_typed.
+ (api_impl): Add new api_flatten_array_typed hook.
+
+2016-12-06 Arnold D. Robbins <arnold@skeeve.com>
+
+ Add minimum required and maximum expected number of arguments
+ to the API.
+
+ * awk.h (INSTRUCTION): Add new members min_required and max_expected.
+ * ext.c (make_builtin): Store values from extension function struct
+ into the INSTRUCTION.
+ * gawkapi.h (awk_ext_func): Add min_required args. Make both it and
+ max_expected_args into unsigned short to match type in INSTRUCTION.
+ * interpret.h (Op_ext_builtin): Store min_required and max_expected
+ in instructions. Add checking code and lint checks.
+ (Op_ext_func): Copy min_required and max_expected from function info.
+
+
+2016-12-04 Andrew J. Schorr <aschorr@telemetry-investments.com>
+
+ * gawkapi.h (r_make_string_type): New inline function to create strings
+ of any type, currently AWK_STRING or AWK_REGEX.
+ (r_make_string): Now a wrapper around r_make_string_type.
+ (make_regex): Convert from an inline function to a macro that
+ calls r_make_string_type.
+
+2016-11-30 Arnold D. Robbins <arnold@skeeve.com>
+
+ * dfa.c: Sync with fixes in GNULIB.
+
+ Unrelated:
+
+ * gawkapi.h (make_regex): New function.
+
+2016-11-29 Arnold D. Robbins <arnold@skeeve.com>
+
+ Add support for typed regex variables to the API.
+
+ * awk.h (make_typed_regex): Declare function.
+ * awkgram.y (typed_regexp): Call make_typed_regex instead of
+ using inline code.
+ * gawkapi.h (AWK_REGEX): New value type.
+ (regex_value): New macro.
+ (Value fetching table): Updated.
+ * gawkapi.c (awk_value_to_node, node_to_awk_value, api_sym_update,
+ api_sym_update_scalar, valid_subscript_type, api_create_value):
+ Add support for AWK_REGEX.
+ (assign_regex): New function.
+ (api_flatten_array): Adjust comment.
+ * node.c (make_typed_regex): New function; moved code from grammar.
+
+2016-11-29 Arnold D. Robbins <arnold@skeeve.com>
+
+ Remove redundant flag from dfa:
+
+ * dfa.c (dfasyntax): Use RE_ICASE instead of DFA_CASE_FOLD.
+ * dfa.h (DFA_CASE_FOLD): Removed.
+ * re.c (make_regexp): Use RE_ICASE for regex and dfa. Yay!
+
+ Unrelated: Don't have to recompute syntax stuff every time
+ we compile a regexp.
+
+ * dfa.c (dfacopysyntax): New function.
+ (dfaalloc): Zero out the newly allocated memory.
+ * dfa.h (dfacopysyntax): Declare it.
+ * re.c (make_regexp): Declare two static dfaregs, one for
+ with and without ignorecase. Compute the syntax once for each,
+ then use dfacopysyntax to copy the settings when compiling
+ a regexp.
+
+2016-11-28 Arnold D. Robbins <arnold@skeeve.com>
+
+ Make gawk compile on HP-UX 11.33.
+
+ * debug.c (serialize_list): Renamed from `serialize'.
+ (unserialize_list): Renamed from `unserialize', for consistency.
+
+ Unrelated:
+
+ * dfa.c: Sync with GNULIB. Twice in one day.
+
+2016-11-21 Arnold D. Robbins <arnold@skeeve.com>
+
+ * dfa.c: Sync with GNULIB.
+
+2016-11-17 Arnold D. Robbins <arnold@skeeve.com>
+
+ General cleanup for zero termination of strings.
+
+ * array.c (do_delete): Use %.*s.
+ (value_info): Get length and use %.*s.
+ (asort_actual): Save and restore character after end.
+ * awkgram.y (split_comment): Use make_string, not make_str_node.
+ * builtin.c (do_fflush): Use %.*s.
+ (locale_category_from_argument, do_dcgettext, do_dcngettext,
+ do_bindtextdomain): Save and restore character after end.
+ * debug.c (do_info, print_array, print_subscript, do_print_var,
+ do_set_var, display, do_watch, print_watch_item, serialize_subscript,
+ do_print_f): Use %.*s.
+ * eval.c (cmp_nodes, fmt_index): Save and restore character after end.
+ * interpret.h (r_interpret): Fix compuation for concatenation of
+ wide strings.
+ * io.c (is_non_fatal_redirect): Add length parameter; save and
+ restore character after last. Adjust all other declarations and calls.
+ (do_close): Save and restore character after end.
+ * mpfr.c (ieee_fmts): Adjust table indentation.
+ (do_mpfr_strtonum): Clear wide string members of the union.
+ * msg.c (err): Use %.*s.
+
+2016-11-07 Arnold D. Robbins <arnold@skeeve.com>
+
+ * awk.h [USER_INPUT]: Renamed from MAYBE_NUM.
+ * builtin.c, eval.c, field.c, int_array.c, io.c, main.c,
+ mpfr.c, node.c: Change all uses.
+
+2016-11-15 Arnold D. Robbins <arnold@skeeve.com>
+
+ Finish reworking typed regexes.
+
+ * awk.h (typed_re): Replaces tre_reg.
+ * awkgram.y (typed_regexp production): Node_val points to a regular
+ Node_regex and also has string value and length.
+ (make_regnode): Simplified back to its original form.
+ * builtin.c (call_sub, call_match, call_split_func): For REGEX,
+ get n->typed_re.
+ * field.c (do_split, do_patsplit): Ditto, for separator regexp.
+ * profile.c (pprint): Op_match_rec, handle REGEX correctly.
+ * re.c (re_update): If REGEX, get t->typed_re->re_reg.
+
+2016-11-15 Arnold D. Robbins <arnold@skeeve.com>
+
+ Start reworking typed regexes.
+
+ * awk.h (Node_typedregex): Nuked.
+ [REGEX]: New flag.
+ (tre_reg): New member in val part of NODE union.
+ (force_string, force_number, fixtype): Remove use of Node_typedregex.
+ * awkgram.y (grammer): Use REGEX flag instead of node type.
+ (valinfo); Ditto.
+ (make_regnode): Adjust creation based on node type.
+ * builtin.c (do_length, do_print, call_sub, call_match,
+ call_split_func, do_typeof): Adjust code.
+ * debug.c (watchpoint_triggered, initialize_watch_item,
+ print_memory): Adjust code.
+ * eval.c (nodetypes): Remove Node_typedregex.
+ (flags2str): Add REGEX.
+ (setup_frame): Adjust code after removal of Node_typedregex.
+ * interpret.h (r_interpret): Adjust code after removal
+ of Node_typedregex.
+ * profile.c (pp_typed_regex): Renamed from pp_strong_regex.
+ (pp_string_or_strong_regex): Renamed from pp_string_or_strong_regex.
+ (pprint): Adjust code after removal of Node_typedregex.
+ * re.c (re_update): Adjust code after removal of Node_typedregex.
+
2016-11-04 Eli Zaretskii <eliz@gnu.org>
* builtin.c (efwrite) [__MINGW32__]: Call w32_maybe_set_errno if
@@ -24,11 +444,17 @@
* nonposix.h (w32_maybe_set_errno) [__MINGW32__]: Add prototype.
+2016-11-01 Arnold D. Robbins <arnold@skeeve.com>
+
+ * eval.c (flags2str): Add NO_EXT_SET and NUMCONSTSTR.
+
2016-10-31 Arnold D. Robbins <arnold@skeeve.com>
Fix valgrind issues.
* io.c (init_awkpath): Need to allocate max_path+3 pointers.
+ * awkgram.y (make_profile_number): Need to add STRCUR flag and
+ set n->stfmt to STFMT_UNUSED. See the comment in the code.
2016-10-26 Arnold D. Robbins <arnold@skeeve.com>
@@ -40,12 +466,77 @@
null elements represent the current directory. Sheesh.
Bug reported by "Jun T." <takimoto-j@kba.biglobe.ne.jp>.
+ Disallow negative arguments to the bitwise functions.
+
+ * NEWS: Document this.
+ * builtin.c (do_lshift, do_rshift, do_and, do_or, do_xor, do_compl):
+ Make negative arguments a fatal error.
+ * mpfr.c (do_mpfr_compl, get_intval): Ditto.
+
+2016-10-23 Arnold D. Robbins <arnold@skeeve.com>
+
+ * General: Remove trailing whitespace from all relevant files.
+ * mpfr.c: Replace Unicode sequences with ASCII.
+ * cint_array.c: Ditto.
+
+2016-10-16 Arnold D. Robbins <arnold@skeeve.com>
+
+ * awkgram.y: Typo fix in call to add_sign_to_num.
+
+2016-10-16 Arnold D. Robbins <arnold@skeeve.com>
+
+ * awk.h (enum opcodeval): Add Op_unary_plus.
+ * awkgram.y (add_sign_to_num): New routine to put in a sign on
+ profiling constants. Call it as necessary.
+ In unary plus production, use new opcode, or set up a
+ constant as for unary minus.
+ (negate_num): Call add_sign_to_num instead of doing it directly.
+ * eval.c (optypetab): Add entry for Op_unary_plus.
+ * interpret.h (r_interpret): Add case for Op_unary_plus.
+ * profile.c (pprint, prec_level, is_scalar): Ditto.
+
+2016-10-13 Arnold D. Robbins <arnold@skeeve.com>
+
+ * dfa.c: Sync with GNULIB.
+
+2016-10-12 Arnold D. Robbins <arnold@skeeve.com>
+
+ * awkgram.y (make_profile_number): Allocate an extra byte for the
+ string, so there's room for a minus if necessary. Store '\0'
+ in the right place.
+ (negate_num): Use memmove to shift the string up and then
+ insert a minus, instead of doing a fresh alloc + copy + free.
+
+2016-10-11 Arnold D. Robbins <arnold@skeeve.com>
+
+ * awk.h (NUMCONSTSTR): New flag value.
+ * awkgram.y (make_profile_number): New function. Use it
+ wherever we make a number. This calls make_number and then, if
+ pretty printing, save the original string value and sets NUMCONSTSTR.
+ (negate_num): If NUNCONSTSTR set, update the saved string value.
+ * profile.c (pp_number): Assert NUMCONSSTR set, use that value.
+ Remove previous code.
+
2016-09-24 Eli Zaretskii <eliz@gnu.org>
* debug.c (restart) [__MINGW32__]: Cast 2nd argument of execvp to
avoid compiler warnings about prototype mismatch. Reported by
Marc de Bourget <marcdebourget@gmail.com>.
+2016-09-09 Norihiro Tanaka <noritnk@kcn.ne.jp>
+
+ * awk.h (struct Regexp): Remove member has_anchor. All uses removed.
+ * re.c (make_regexp, research): Use dfa matcher for regex with anchor.
+
+2016-09-09 Arnold D. Robbins <arnold@skeeve.com>
+
+ * dfa.c: Sync with grep.
+
+2016-09-08 Paul Eggert <eggert@cs.ucla.edu>
+
+ * dfa.c, dfa.h: Sync with grep.
+ * re.c (make_regexp): Adjust to DFA API changes.
+
2016-09-08 Arnold D. Robbins <arnold@skeeve.com>
* command.y: Update license text to version 3. Oops.
@@ -56,6 +547,65 @@
GPLv3+ and with correct FSF address. Thanks to
David Kaspar <dkaspar@redhat.com> for pointing out the need.
+2016-09-02 Arnold D. Robbins <arnold@skeeve.com>
+
+ * dfa.c: Sync with grep.
+
+2016-09-01 Arnold D. Robbins <arnold@skeeve.com>
+
+ Merge grep's now thread-safe dfa. Wheee.
+
+ * dfa.h, dfa.c: Sync with grep.
+ * localeinfo.h, localeinfo.c, verify.h: New files.
+ * Makefile.am (base_sources): Adjust.
+ * awk.h (using_utf8): Declare new function.
+ * node.c (str2wstr): Use using_utf8 instead of now-gone dfa function.
+ * re.c: Include "localeinfo.h".
+ (localeinfo): New static variable.
+ (make_regexp): Adjust call to dfa_syntax.
+ (resetup): Call init_localeinfo on localeinfo. Remove call to
+ now-gone function dfa_init.
+ (using_utf8): New function.
+
+2016-08-29 Arnold D. Robbins <arnold@skeeve.com>
+
+ * configure.ac (fwrite_unlocked): Check for it.
+ * awk.h (fwrite): Define to fwrite_unlocked if we have it.
+ * NEWS: Make note of speed improvement.
+
+2016-08-25 Arnold D. Robbins <arnold@skeeve.com>
+
+ POSIX now says use strcmp for == and !=. Thanks to Chet Ramey
+ for pointing me at the change. Make it so:
+
+ * awk.h (cmp_nodes): New 3rd param indicating strcmp, not strcoll.
+ * debug.c (cmp_val): Update call to cmp_nodes.
+ * eval.c (cmp_nodes): New 3rd param indicating strcmp, not strcoll.
+ Adjust code and all callers.
+ (scalar_cmp_t): New enum type. Used in ...
+ (cmp_scalars): ... in order to call cmp_nodes correctly.
+ * interpret.h: Use the enum type in calls to cmp_scalars.
+ * re.c (re_update): Adjust call to cmp_nodes.
+
+2016-08-25 Norihiro Tanaka <noritnk@kcn.ne.jp>
+
+ * awk.h (struct Regexp): Remove dfa. Now dfareg instead of it. All
+ referers changed.
+ * re.c (research): Arrange caller of dfaexec and research.
+ * (avoid_dfa): Removed. All callers changed.
+ * awk.h (avoid_dfa): Removed.
+
+ Other changes by Arnold Robbins:
+
+ * awk.h (struct Regexp): Change various boolean members to bool.
+ (RE_NO_FLAGS): New #define.
+ * interpret.h: Use RE_NO_FLAGS instead of zero.
+ * re.c (research): Prettify the logic a little bit.
+
+2016-08-25 Arnold D. Robbins <arnold@skeeve.com>
+
+ * dfa.c: Sync with grep.
+
2016-08-25 Arnold D. Robbins <arnold@skeeve.com>
* 4.1.4: Release tar ball made.
@@ -78,6 +628,12 @@
* dfa.c: Sync with grep.
+2016-08-15 Andrew J. Schorr <aschorr@telemetry-investments.com>
+
+ * int_array.c (is_integer): Fix merge of stable changes to remove
+ obsolete string formatting check that has been superseded by
+ the new standard_integer_string check.
+
2016-08-14 Arnold D. Robbins <arnold@skeeve.com>
* re.c (make_regexp): Only call dfasyntax if actually using
@@ -104,6 +660,28 @@
force_number to parse the string, but this is disabled due to possible
negative performance impact.
+2016-08-03 Arnold D. Robbins <arnold@skeeve.com>
+
+ Remove typed regexes until they can be done properly.
+
+ * NEWS: Updated.
+ * awk.h (enum nodevals): Remove Node_typedregex.
+ (force_string, force_number): Remove check for Node_typedregex.
+ * awkgram.y (TYPED_REGEXP): Remove token.
+ (grammar): Remove productions related to typed regexps.
+ (yylex): Don't find a typed regex or return it.
+ (valinfo): Remove code for Node_typedregex.
+ * builtin.c (do_length, do_print, call_sub, call_match,
+ call_split_func, do_typeof): Remove code for Node_typedregex.
+ * debug.c (watchpoint_triggered, print_memory): Remove code
+ for Node_typedregex.
+ * eval.c (nodetypes, setup_frame): Remove code for Node_typedregex.
+ * interpret.h (r_interpret): Remove code for Node_typedregex.
+ * profile.c (pprint): Remove code for Node_typedregex.
+ (pp_strong_regex): Removed.
+ (pp_string_or_strong_regex): Remove code for Node_typedregex.
+ * re.c (re_update): Remove code for Node_typedregex.
+
2016-08-01 Arnold D. Robbins <arnold@skeeve.com>
* README, NEWS: Mark DJGPP port as unsupported.
@@ -137,6 +715,17 @@
should not be mapped to upper case. Fixes inconsistencies between
dfa and regex in some single bytes locales; notably el_GR.iso88597.
+2016-07-23 Arnold D. Robbins <arnold@skeeve.com>
+
+ Make result of close on a pipe match result of system.
+ Thanks to Mike Brennan for the encouragement.
+
+ * awk.h (sanitize_exit_status): Declare routine.
+ * builtin.c (sanitize_exit_status): New routine.
+ (do_system): Use it.
+ * io.c (close_rp): Use it on pclose result.
+ (gawk_pclose): Use it.
+
2016-07-23 Andrew J. Schorr <aschorr@telemetry-investments.com>
* builtin.c (do_print): Improve logic for formatting
@@ -177,10 +766,192 @@
* eval.c (set_LINT): Reset lintfunc to `warning' for LINT="invalid".
Thanks to Andy Schorr for the report.
+2016-07-08 Andrew J. Schorr <aschorr@telemetry-investments.com>
+
+ * awk.h: Restore previous comment about unterminated strings, since
+ I am removing the string termination patches from field.c
+ (free_api_string_copies): Declare new gawkapi function.
+ * builtin.c (do_mktime, do_system): Restore temporary string
+ termination to protect against unterminated field values.
+ (nondec2awknum): Remove comment about unnecessary termination.
+ * eval.c (posix_compare): Restore temporary string termination.
+ * field.c (databuf): Remove struct, no longer needed.
+ (set_field): Remove memcpy for string termination, since we will support
+ unterminated field string values.
+ (rebuild_record): Ditto. Also no need to allocate space for terminated
+ string copies.
+ (allocate_databuf): Remove function, since memory management can again
+ be done inside set_record.
+ (set_record): Restore inline buffer management logic.
+ (reset_record): Remove calls to allocate_databuf, since we no longer
+ need space for making terminated copies of field strings.
+ * gawkapi.c (free_api_string_copies): New function to free strings
+ that we made to provide terminated copies to API functions.
+ (assign_string): New function to convert a string to an awk_value,
+ making sure to copy it if we need to terminate it.
+ (node_to_awk_value): Use assign_string to return string values with
+ NUL termination protection.
+ * int_array.c (is_integer): Restore temporary string termination.
+ * interpret.h (Op_push_i): Ditto.
+ (Op_ext_builtin): After external function returns, call
+ free_api_string_copies to free temporary string copies.
+ * mpfr.c (force_mpnum): Restore temporary string termination.
+ * node.c (r_force_number, get_ieee_magic_val): Ditto.
+
2016-07-08 Arnold D. Robbins <arnold@skeeve.com>
* dfa.c: Sync with GNU grep.
+ Unrelated:
+
+ * builtin.c (do_print): Coding style change. (This change obsoleted
+ by earlier changes in the fixtype branch.)
+
+2016-07-06 Andrew J. Schorr <aschorr@telemetry-investments.com>
+
+ * awk.h: Modify comments to indicate that MAYBE_NUM will now be
+ left enabled to indicate strnum values by the NUMBER|MAYBE_NUM
+ combination, whereas STRING|MAYBE_NUM indicates a potential strnum.
+ (fixtype): Modify MAYBE_NUM test to avoid calling force_number if
+ NUMCUR is already set.
+ * builtin.c (do_typeof): Call fixtype to resolve argument type.
+ This forces parsing of numeric strings, so there's a performance
+ penalty, but we must do this to give a correct result. The meaning
+ of "strnum" changes from "potential strnum" to "actual strnum".
+ * eval.c (set_TEXTDOMAIN): Remove some dead code left over from last
+ patch.
+ * int_array.c (is_integer): When a MAYBE_NUM is converted successfully
+ to a NUMBER, leave the MAYBE_NUM flag enabled.
+ * mpfr.c (mpg_force_number): Ditto.
+ * node.c (r_force_number): Ditto.
+
+2016-07-06 Andrew J. Schorr <aschorr@telemetry-investments.com>
+
+ * awk.h: Modify stptr comment to indicate that all strings are now
+ NUL-terminated.
+ * builtin.c (do_mktime): Remove unnecessary logic to terminate
+ the string with '\0' temporarily.
+ (do_system) Ditto.
+ (nondec2awknum): Add a comment about termination.
+ * eval.c (posix_compare): Remove logic to terminate strings temporarily.
+ (set_ORS): No need to terminate ORS, since the string node is already
+ terminated. What gave us the right to modify that node anyway?
+ (fmt_index): Remove code to terminate string. This seems to have been
+ invalid anyway, since we don't own that memory.
+ (set_TEXTDOMAIN): Do not terminate TEXTDOMAIN string, since the node
+ is already terminated. We didn't have the right to modify that node
+ anyway.
+ * gawkapi.c (node_to_awk_value): Add assert checks to confirm that the
+ string is NUL-terminated.
+ * gawkapi.h: Modify awk_string comment to indicate that strings are
+ always terminated with '\0'.
+ * int_array.c (isinteger): Remove unnecessary logic to terminate string
+ with '\0' temporarily.
+ * interpret.h (Op_push_i): Ditto.
+ * io.c (nextfile): Remove string termination. We didn't own that memory
+ anyway.
+ * mpfr.c (force_mpnum): Remove unnecessary logic to terminate the
+ string with '\0' temporarily.
+ * node.c (r_force_number): Remove NUL termination around strtod call,
+ since we already know that there is either a white space or '\0'
+ character there. Either one will stop strtod.
+ (get_ieee_magic_val): Ditto.
+ * profile.c (pp_number): No need to terminate string returned by
+ r_format_val.
+
+2016-07-06 Andrew J. Schorr <aschorr@telemetry-investments.com>
+
+ * interpret.h (Op_field_spec): Now that all $n field values are
+ NUL-terminated, there is no reason to call dupnode for $n where n > 0.
+ This saves malloc and copying overhead, thereby more than offsetting the
+ performance hit of the additional copying and NUL-termination in the
+ last patch to field.c. It also eliminates repeated parsing in cases
+ where $n, for n > 1, was accessed more than once in a numeric context,
+ so the new approach should be a performance win.
+
+2016-07-06 Andrew J. Schorr <aschorr@telemetry-investments.com>
+
+ Make sure that all field values, and therefore all strings inside gawk,
+ are terminated with a '\0' character!
+
+ * field.c (databuf): New static struct to hold info about our buffer to
+ contain the field string values.
+ (allocate_databuf): New function to make sure the databuf is large
+ enough to hold $0 and copies of $1 through $NF.
+ (set_field): Copy $n into free space previously allocated in databuf
+ and add a '\0' at the end.
+ (rebuild_record): Call allocate_databuf to ensure sufficient space
+ for copying non-malloced field values. When copying field values,
+ use databuf to create a NUL-terminated copy.
+ (purge_record): New function extracted from reset_record to initialize
+ $1 through $NF to null values.
+ (set_record): Buffer management moved to new allocate_databuf function.
+ Call purge_record instead of reset_record, since reset_record contains
+ some extra logic not needed in this case.
+ (reset_record): Call purge_record to do most of the work, and call
+ allocate_databuf to make sure we have a big enough buffer to contain
+ copies of the $1 through $NF.
+
+2016-07-06 Andrew J. Schorr <aschorr@telemetry-investments.com>
+
+ * awk.h: Renumber flags to remove gap created when FIELD was removed.
+
+2016-07-05 Andrew J. Schorr <aschorr@telemetry-investments.com>
+
+ * field.c (rebuild_record): Need to set MALLOC flag if we allocate
+ memory for a residual field node with valref > 1.
+
+2016-07-05 Andrew J. Schorr <aschorr@telemetry-investments.com>
+
+ * field.c (rebuild_record): Do not bother to create new field nodes
+ to replace malloc'ed nodes when rebuilding $0.
+
+2016-07-05 Andrew J. Schorr <aschorr@telemetry-investments.com>
+
+ * awk.h (FIELD): Remove unnecessary flag.
+ (MALLOC): Move definition to join the others, and improve the comment.
+ * array.c (value_info): Replace FIELD test with MALLOC test.
+ * eval.c (flags2str): Remove FIELD flag.
+ * field.c (init_fields): Remove FIELD bit from Null_field->flags.
+ (set_field): Remove FIELD bit from flags.
+ (rebuild_record): Test against MALLOC instead of FIELD. If a field
+ node has valref > 1, we should make a copy, although I don't think
+ it is valid for this to happen.
+ (set_record): Remove FIELD bit from flags.
+ * interpret.h (UNFIELD): Add comment, and test MALLOC flag instead of
+ FIELD. Remove probably buggy code to disable the FIELD flag when
+ valref is 1; that would have created a node where neither the FIELD
+ nor MALLOC flag was set, which seems invalid.
+ * node.c (r_dupnode): Remove code disabling FIELD flag.
+
+2016-07-04 Andrew J. Schorr <aschorr@telemetry-investments.com>
+
+ * awk.h (force_string_fmt): New inline function to get the string
+ representation in a requested format.
+ (force_string): Reimplement as a macro using force_string_fmt function.
+ (force_string_ofmt): New macro to get a value's OFMT representation.
+ * builtin.c (do_print): Use new force_string_ofmt macro instead of
+ duplicating the logic inline.
+
+2016-07-04 Andrew J. Schorr <aschorr@telemetry-investments.com>
+
+ * str_array.c (str_lookup): There is no need to worry about the
+ MAYBE_NUM flag, since the code has been patched to make sure to
+ preserve the string value of strnum values, and the integer array
+ code should no longer mistakenly claim a strnum integer with a
+ nonstandard string representation.
+
+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
@@ -201,6 +972,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.
@@ -211,6 +1062,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.
@@ -221,10 +1088,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>
@@ -261,6 +1228,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
@@ -309,6 +1286,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.
@@ -321,12 +1305,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
@@ -402,6 +1394,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
@@ -419,12 +1420,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
@@ -456,6 +1499,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.
@@ -479,6 +1527,15 @@
* configure.ac (AM_GNU_GETTEXT_VERSION): Bump to 0.19.7.
+2016-02-21 Nelson H.F. Beebe <beebe@math.utah.edu>
+
+ * random.c [SHUFFLE_BITS, SHUFFLE_MAX, SHUFFLE_MASK]: New macros.
+ (shuffle_init, shuffle_buffer): New static variables.
+ (random_old): Renamed from random.
+ (random): New function wrapping random_old and providing a
+ shuffle buffer to increase the period. See the literature citations
+ and other notes in the code.
+
2016-02-21 Arnold D. Robbins <arnold@skeeve.com>
* regexec.c (prune_impossible_nodes): Remove attribute that
@@ -504,6 +1561,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
@@ -565,6 +1659,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
@@ -577,6 +1677,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
@@ -614,6 +1719,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
@@ -740,6 +1851,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.
@@ -753,6 +1956,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.
@@ -777,6 +1990,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
@@ -787,6 +2011,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.
@@ -811,6 +2043,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.
@@ -843,6 +2080,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.
@@ -856,6 +2108,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
@@ -869,6 +2129,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).
@@ -890,6 +2167,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
@@ -931,6 +2217,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.
@@ -947,6 +2254,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.
@@ -961,6 +2274,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.
@@ -972,6 +2289,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.
@@ -986,6 +2321,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.
@@ -993,6 +2348,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.
@@ -1016,6 +2385,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,
@@ -1078,6 +2475,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.
@@ -1095,6 +2497,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.
@@ -1113,6 +2531,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.
@@ -1217,6 +2753,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.
@@ -1239,6 +2805,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.
@@ -1300,12 +2876,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
@@ -1378,6 +2977,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 ...
@@ -1439,6 +3077,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.
@@ -1463,6 +3122,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
@@ -1534,6 +3200,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
@@ -1556,6 +3228,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.
@@ -1570,6 +3257,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:
@@ -1690,6 +3384,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
@@ -2056,6 +3757,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
@@ -2073,6 +3779,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.
@@ -2092,6 +3803,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
@@ -2173,6 +3891,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.
@@ -2181,6 +3905,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.
@@ -2189,6 +3923,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 ...
@@ -2199,6 +3951,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
@@ -2209,6 +4000,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