5620
5620
* array.c (do_delete_loop): Call after_assign for the loop index.
5621
5621
* field.c (do_split): The third argument to split(), sep, has to be
5622
evaluated and the result dupnoded before assoc_clear is called,
5623
similarily as src. And we needn't to evaluate the third argument
5624
if it's CONSTant regex and the first parameter is null string.
5622
evaluated and the result dupnoded before assoc_clear is called,
5623
similarily as src. And we needn't to evaluate the third argument
5624
if it's CONSTant regex and the first parameter is null string.
5625
5625
* awk.h (dupnode): Changed to macro, function renamed to r_dupnode.
5626
5626
* node.c (dupnode, r_dupnode): Rename.
5627
5627
* awkgram.y (parms_shadow): Return bool value, ...
5628
(shadow_funcs): ... which will enable us to end the program if
5630
(program): Cleanup of the rules defining the ``program'' non-terminal.
5631
(start, program, rule): No value associated,
5632
expression_value is now treated similarily as begin_block and end_block.
5633
(pattern, rule): Bison actions for non-terminal `pattern' now
5634
add a new rule to the appropriate Node_rule_list, action for
5635
non-terminal `rule' now only adds the associated code block
5636
to the rnode of Node_rule_node.
5637
(io_allowed): Renamed to !begin_or_end_rule.
5638
(append_pattern): New function, adds new Node_rule_node to a rule_list.
5639
(mkrangenode): Deleted, this tiny function was called only once.
5640
(function_body): Non-terminal replaced by `action'.
5641
(statements, action, statement): `statements' can now be empty;
5642
both callers had to accomodate to this.
5643
(statements): Don't call isnoeffect($2->type) if
5644
$2 happens to be NULL.
5628
(shadow_funcs): ... which will enable us to end the program if
5630
(program): Cleanup of the rules defining the ``program'' non-terminal.
5631
(start, program, rule): No value associated,
5632
expression_value is now treated similarily as begin_block and end_block.
5633
(pattern, rule): Bison actions for non-terminal `pattern' now
5634
add a new rule to the appropriate Node_rule_list, action for
5635
non-terminal `rule' now only adds the associated code block
5636
to the rnode of Node_rule_node.
5637
(io_allowed): Renamed to !begin_or_end_rule.
5638
(append_pattern): New function, adds new Node_rule_node to a rule_list.
5639
(mkrangenode): Deleted, this tiny function was called only once.
5640
(function_body): Non-terminal replaced by `action'.
5641
(statements, action, statement): `statements' can now be empty;
5642
both callers had to accomodate to this.
5643
(statements): Don't call isnoeffect($2->type) if
5644
$2 happens to be NULL.
5646
5646
Mon Jan 27 14:12:19 2003 Arnold D. Robbins <arnold@skeeve.com>
7078
7078
Mon Oct 29 14:53:57 2001 Arnold D. Robbins <arnold@skeeve.com>
7080
7080
* awkgram.y: Add semicolons in calls to count_args().
7081
Apparently bisoon adds a semicolon to each body
7082
automatically and byacc doesn't.
7081
Apparently bisoon adds a semicolon to each body
7082
automatically and byacc doesn't.
7084
7084
Sun Oct 28 16:53:18 2001 Arnold D. Robbins <arnold@skeeve.com>
7086
7086
* builtin.c (format_tree): Fix off-by-one error in "ran out
7087
for this one" diagnostic. Also fix lint check for too many
7088
arguments vs. count in format string.
7087
for this one" diagnostic. Also fix lint check for too many
7088
arguments vs. count in format string.
7090
7090
Wed Oct 10 11:01:47 2001 Arnold D. Robbins <arnold@skeeve.com>
7092
7092
* fixvers: Check that files exist before doing `cmp', in
7093
case they're in a source code system and aren't there.
7094
Fix from Grant Erickson (gerickson@brocade.com).
7093
case they're in a source code system and aren't there.
7094
Fix from Grant Erickson (gerickson@brocade.com).
7096
7096
Thu Oct 4 18:20:36 2001 Arnold D. Robbins <arnold@skeeve.com>
7098
7098
* eval.c (r_tree_eval): For comparison, dupnode() results of
7099
evaluation so that we can hang on to them and avoid memory
7100
corruption. Change calls to free_temp() to unref().
7099
evaluation so that we can hang on to them and avoid memory
7100
corruption. Change calls to free_temp() to unref().
7102
7102
Tue Sep 25 15:19:53 2001 Arnold D. Robbins <arnold@skeeve.com>
7104
7104
* io.c (iop_open): Only call os_close_on_exec() for
7105
fd > fileno(stderr).
7105
fd > fileno(stderr).
7107
7107
2001-09-07 Paul Eggert <eggert@twinsun.com>
7109
7109
* io.c (redirect): When deciding to use the fdopen bug hack,
7110
use "__sun" rather than "solaris". No compilers predefine
7111
"solaris", but both GCC and Sun C predefine "__sun".
7110
use "__sun" rather than "solaris". No compilers predefine
7111
"solaris", but both GCC and Sun C predefine "__sun".
7113
7113
Thu Aug 30 15:17:12 2001 Arnold D. Robbins <arnold@skeeve.com>
7115
7115
* main.c (copyleft): Use a printf %d for last year of update
7116
to avoid translation strings changing when the file
7117
is updated from now on. Suggestion from Ulrich Drepper.
7116
to avoid translation strings changing when the file
7117
is updated from now on. Suggestion from Ulrich Drepper.
7119
7119
Thu Aug 23 14:01:14 2001 Arnold D. Robbins <arnold@skeeve.com>
7121
7121
* awkgram.y (unary minus production): Add check that value
7122
isn't a string. Based on bug report from drj@pobox.com.
7122
isn't a string. Based on bug report from drj@pobox.com.
7123
7123
* profile.c (tree_eval): For node_val, only test NUMBER
7124
to see if value is numeric, not NUM|NUMBER.
7124
to see if value is numeric, not NUM|NUMBER.
7126
7126
Thu Aug 16 12:21:28 2001 Arnold D. Robbins <arnold@skeeve.com>
7430
7430
Sun Jan 7 15:26:16 2001 Arnold D. Robbins <arnold@skeeve.com>
7432
7432
* getopt.h: Removed names in prototypes for getopt_long
7433
and getopt_long_only, fixes problems on MINGW32.
7433
and getopt_long_only, fixes problems on MINGW32.
7435
7435
Thu Jan 4 10:13:46 2001 Arnold D. Robbins <arnold@skeeve.com>
7437
7437
* configure.in: Add check for mcheck.h
7438
7438
* main.c: Include mcheck.h if have it.
7439
(main): If TIDYMEM turned on in environment, also call mtrace().
7439
(main): If TIDYMEM turned on in environment, also call mtrace().
7441
7441
Wed Jan 3 16:41:33 2001 Arnold D. Robbins <arnold@skeeve.com>
7443
7443
Fixed minor memory leaks.
7444
7444
* re.c (re_update): When IGNORECASE changed, unref(t->re_text).
7445
7445
* eval.c (pop_fcall): Fix the logic to correctly free the vname
7446
when copying array args back to their underlying source.
7446
when copying array args back to their underlying source.
7448
7448
Fixed massive memory leaks.
7449
7449
* node.c (dupnode): If PERM is set, do nothing.
7450
(unref): Fix logic. Always turn off TEMP. Check just for MALLOC
7451
when incrementing the stref.
7450
(unref): Fix logic. Always turn off TEMP. Check just for MALLOC
7451
when incrementing the stref.
7452
7452
* array.c (assoc_lookup): Turn off PERM also when saving subscript.
7453
7453
* builtin.c (sub_common): Turn off PERM also when making private copy
7456
7456
Add a minor memory cleanup facility (undocumented):
7457
7457
* awk.h (do_tidy_mem, release_all_vars): Add declarations.
7458
7458
* main.c (do_tidy_mem): Add declaration.
7459
(main): If $TIDYMEM exists, do_tidy_mem is true, and call mtrace().
7459
(main): If $TIDYMEM exists, do_tidy_mem is true, and call mtrace().
7460
7460
* awkgram.y (release_all_vars): New function.
7462
7462
Sun Dec 31 10:47:37 2000 Arnold D. Robbins <arnold@skeeve.com>
7464
7464
* awkgram.y (in_end_rule): Renamed `parsing_end_rule' to avoid
7465
conflict with global var of same name.
7465
conflict with global var of same name.
7467
7467
Sun Dec 24 10:36:54 2000 Eli Zaretskii <eliz@is.elta.co.il>
7469
7469
* awkgram.y (snode): Reword the error message about the number of
7470
arguments for a builtin, so as not to use the English `s' as a
7470
arguments for a builtin, so as not to use the English `s' as a
7473
7473
Tue Dec 12 08:38:03 2000 Arnold D. Robbins <arnold@skeeve.com>
7475
7475
* ext.c (do_ext): ifdef out use of `dummy'. Duh.
7476
7476
* regex.c (re_error_msgid): Revert to array of `char *' so that can
7477
compile on K&R compilers. Fix all uses appropriately.
7478
(re_error_msgid_idx): Removed.
7477
compile on K&R compilers. Fix all uses appropriately.
7478
(re_error_msgid_idx): Removed.
7480
7480
Fri Dec 8 11:47:26 2000 Arnold D. Robbins <arnold@skeeve.com>
7482
7482
* ext.c (dummy): Make gcc specific via ifdef.
7483
7483
* builtin.c (do_dcgettext): Make conditional compilation smarter.
7484
7484
* msg.c (warning, error, r_fatal): Finish switching back to
7485
multi-version function header.
7485
multi-version function header.
7487
7487
Wed Dec 6 13:28:58 2000 Arnold D. Robbins <arnold@skeeve.com>
7489
7489
* random.h: Include <config.h> to get ssize_t definition.
7490
7490
* awkgram.y (yyerror): Restore multi-version function header,
7491
it seems that what ansi2knr produces doesn't quite do the
7492
job on old compilers.
7491
it seems that what ansi2knr produces doesn't quite do the
7492
job on old compilers.
7495
7495
Tue Dec 5 15:05:35 2000 Arnold D. Robbins <arnold@skeeve.com>
7612
7612
Major simplification of automake machinery.
7614
7614
* configure.in:
7615
- INSTALL is forced only if not provided in environment
7616
- lots of Makefile.in files removed since move to automake 1.4a
7615
- INSTALL is forced only if not provided in environment
7616
- lots of Makefile.in files removed since move to automake 1.4a
7617
7617
* Makefile.am, */Makefile.am: Moved directories that don't need
7618
the automake machinery into EXTRA_DIST as appropriate and
7619
removed the Makefile{,.am,.in} files as needed.
7618
the automake machinery into EXTRA_DIST as appropriate and
7619
removed the Makefile{,.am,.in} files as needed.
7620
7620
* eval_p.c, profile_p.c: New files to make it easier with automake
7623
7623
Tue Oct 24 12:20:18 2000 Arnold D. Robbins <arnold@skeeve.com>
7625
7625
* awkgram.y (valinfo, var_comp, dump_vars): New functions to dump
7626
the list of global variables.
7626
the list of global variables.
7627
7627
* awk.h: Declare dump_vars.
7628
7628
* main.c (optab): New option "dump-variables".
7629
(main): Code to handle it, set the output file and then call
7630
dump_vars() at the end.
7631
(usage): New option added to usage message.
7629
(main): Code to handle it, set the output file and then call
7630
dump_vars() at the end.
7631
(usage): New option added to usage message.
7633
7633
Sat Oct 21 22:59:59 2000 Arnold D. Robbins <arnold@skeeve.com>
7635
7635
* awkgram.y (parms_shadow): For a function, check if any
7636
parameters shadow global variables and print a warning.
7637
(shadow_funcs): Go through all functions and call parms_shadow().
7638
(isnoeffect, isassignable): Add Node_LINT and NODE_BINMODE.
7636
parameters shadow global variables and print a warning.
7637
(shadow_funcs): Go through all functions and call parms_shadow().
7638
(isnoeffect, isassignable): Add Node_LINT and NODE_BINMODE.
7639
7639
* main.c (main): If do_lint, call shadow_funcs().
7640
7640
* awk.h: Add declaration of shadow_funcs().
7641
7641
* configure.in: Added m4/Makefile and awklib/eg/network/Makefile
7642
to list of generated makefiles.
7642
to list of generated makefiles.
7644
7644
Tue Oct 17 10:47:35 2000 Arnold D. Robbins <arnold@skeeve.com>
7646
7646
* array.c (assoc_lookup): Reverted change that did dupnode of
7647
array indices. Creates significant problems if index is
7648
numeric value and CONVFMT changes. Added fix to set
7649
bucket->ahname->stfmt to -1 so that force_string never recalculates
7650
the string value, and also turned off NUM and turned on STR.
7651
See test/arynasty.awk.
7647
array indices. Creates significant problems if index is
7648
numeric value and CONVFMT changes. Added fix to set
7649
bucket->ahname->stfmt to -1 so that force_string never recalculates
7650
the string value, and also turned off NUM and turned on STR.
7651
See test/arynasty.awk.
7653
7653
Mon Oct 16 12:21:26 2000 Arnold D. Robbins <arnold@skeeve.com>
7655
7655
* All: Cleaned up various lint warnings for consistent phrasing.
7656
7656
* awk.y (in_end_rule): New variable for warning about unredirected
7657
getline. It's ok in a BEGIN, but not in an END.
7657
getline. It's ok in a BEGIN, but not in an END.
7659
7659
Sun Oct 15 14:14:05 2000 Arnold D. Robbins <arnold@skeeve.com>
7661
7661
* field.c (set_FS): Add lint warning for FS = "".
7662
(do_split): Ditto for 3rd arg = "".
7662
(do_split): Ditto for 3rd arg = "".
7664
7664
Fri Oct 13 09:17:04 2000 Arnold D. Robbins <arnold@skeeve.com>
7666
7666
* io.c (close_redir): Clear rp->fp on all closes. Remove
7667
rp from list if either closing both ends or both ends
7668
have been closed separately. Add exitwarn message for
7670
(flush_io): Add warning message if fflush of co-process
7671
fails. Rationalize return value to either 0 or -1.
7667
rp from list if either closing both ends or both ends
7668
have been closed separately. Add exitwarn message for
7670
(flush_io): Add warning message if fflush of co-process
7671
fails. Rationalize return value to either 0 or -1.
7672
7672
* builtin.c (do_gensub): 3rd arg of zero generates a
7674
(do_fflush): Rationalize return value: -1 for unopen or read-only
7675
redirection, status of fflush otherwise.
7674
(do_fflush): Rationalize return value: -1 for unopen or read-only
7675
redirection, status of fflush otherwise.
7677
7677
Wed Oct 11 22:11:19 2000 Arnold D. Robbins <arnold@skeeve.com>
7679
7679
* awk.y (for loop): Check that there is a body as
7680
part of the `is it a delete statement' check.
7680
part of the `is it a delete statement' check.
7682
7682
Thu Oct 5 11:56:42 2000 Arnold D. Robbins <arnold@skeeve.com>
7684
7684
* awk.h, awkgram.y, configure.in, eval.c: Enabled
7685
`for (i in_sorted array)' loops for those who
7686
are Strong In The Way Of The Source. So there.
7685
`for (i in_sorted array)' loops for those who
7686
are Strong In The Way Of The Source. So there.
7688
7688
Mon Oct 2 10:09:32 2000 Arnold D. Robbins <arnold@skeeve.com>
7690
7690
* io.c (do_close): Make close(x) for non-open x return -1
7691
and update ERRNO. close(FILENAME) no longer does anything
7692
magic; this is all for better consistency with other awks
7693
and is more logical, anyway.
7691
and update ERRNO. close(FILENAME) no longer does anything
7692
magic; this is all for better consistency with other awks
7693
and is more logical, anyway.
7695
7695
Thu Sep 28 17:27:16 2000 Arnold D. Robbins <arnold@skeeve.com>
7697
7697
* io.c (close_one): Added a lint warning if it becomes
7698
necessary to start multiplexing fd's, per ancient suggestion
7699
from Scott Deifik, <scottd@amgen.com>.
7698
necessary to start multiplexing fd's, per ancient suggestion
7699
from Scott Deifik, <scottd@amgen.com>.
7701
7701
Tue Sep 26 14:41:41 2000 Arnold D. Robbins <arnold@skeeve.com>
7703
7703
* profile.c: Move enum for redirection placement to top
7704
of file, and make the value a parameter to pp_redir.
7705
Fix all the calls. This gets `|&' right everywhere.
7704
of file, and make the value a parameter to pp_redir.
7705
Fix all the calls. This gets `|&' right everywhere.
7707
7707
Sun Sep 24 16:38:04 2000 Arnold D. Robbins <arnold@skeeve.com>
7709
7709
* awk.h (freenode): Set the flags straight to UNINITIALIZED.
7710
7710
* node.c (unref): Fix test for MALLOC|TEMP to test the
7711
actual flags, not zero.
7711
actual flags, not zero.
7712
7712
* builtin.c (format_tree): ala print and concat, dupnode
7713
the temp nodes from tree_evaling the arguments. See
7713
the temp nodes from tree_evaling the arguments. See
7716
7716
Mon Sep 18 10:16:58 2000 Arnold D. Robbins <arnold@skeeve.com>
7718
7718
* awkgram.y (snode): Make match 3rd arg and close 2nd arg fatal
7719
errors if --tradtional.
7719
errors if --tradtional.
7721
7721
Thu Sep 14 12:22:42 2000 Arnold D. Robbins <arnold@skeeve.com>
7723
7723
* eval.c (update_ERRNO): Call gettext on result of strerror.
7726
7726
Wed Sep 13 14:56:11 2000 Arnold D. Robbins <arnold@skeeve.com>
7728
7728
* eval.c (r_tree_eval): Case for Node_concat. Dupnode the
7729
strings ala do_print to get more consistent results.
7730
Compare gawk 3.0.6 to nawk/mawk on test/nasty.awk.
7731
Thanks to Andrew Sumner (andrewsumner@yahoo.com) for
7732
pointing this one out.
7729
strings ala do_print to get more consistent results.
7730
Compare gawk 3.0.6 to nawk/mawk on test/nasty.awk.
7731
Thanks to Andrew Sumner (andrewsumner@yahoo.com) for
7732
pointing this one out.
7734
7734
Wed Sep 13 10:06:47 2000 Arnold D. Robbins <arnold@skeeve.com>
7736
7736
* io.c (two_way_close_type): New enumerated type.
7737
(close_redir): New third param of type two_way_close_type.
7738
Add smarts to two-way case for different close types.
7739
Only remove it from the redir list if closing is for both ends.
7740
(gawk_pclose): Check that rp->iop != NULL before closing,
7737
(close_redir): New third param of type two_way_close_type.
7738
Add smarts to two-way case for different close types.
7739
Only remove it from the redir list if closing is for both ends.
7740
(gawk_pclose): Check that rp->iop != NULL before closing,
7742
7742
* awkgram.y (tokentab): Allow 2nd argument to close.
7743
(snode): Add lint warning.
7743
(snode): Add lint warning.
7745
7745
Sun Sep 10 14:16:10 2000 Arnold D. Robbins <arnold@skeeve.com>
7747
7747
* field.c (set_FIELDWIDTHS): Generate a fatal error upon
7748
encountering a negative width.
7748
encountering a negative width.
7750
7750
Sun Sep 10 10:37:35 2000 Arnold D. Robbins <arnold@skeeve.com>
7752
7752
* awkgram.y (snode): If first argument to dcgettext is a
7753
string constant and --gen-po, dump the string constant to
7753
string constant and --gen-po, dump the string constant to
7755
7755
* main.c (nostalgia): Add call to fflush(stderr).
7756
7756
* eval.c (r_tree_eval): Add entries for Node_LINT and for
7759
7759
Thu Sep 7 10:46:20 2000 Arnold D. Robbins <arnold@skeeve.com>
7761
7761
* builtin.c (do_dcgettext): Per suggestion from Ulrich Drepper,
7762
make the awk interface:
7762
make the awk interface:
7764
str = dcgettext(string [, domain [, category]])
7764
str = dcgettext(string [, domain [, category]])
7766
7766
Wed Sep 6 16:28:12 2000 Arnold D. Robbins <arnold@skeeve.com>
7768
7768
Bring gettext features out to the awk level!
7770
7770
* awk.h: Add declarations of new functions `do_dcgettext'
7771
`do_bindtextdomain', `set_TEXTDOMAIN' and variables
7772
`TEXTDOMAIN', `TEXTDOMAIN_node'. New NODETYPE enum
7771
`do_bindtextdomain', `set_TEXTDOMAIN' and variables
7772
`TEXTDOMAIN', `TEXTDOMAIN_node'. New NODETYPE enum
7774
7774
* eval.c (nodetypes): Add Node_TEXTDOMAIN at end.
7775
(set_TEXTDOMAIN): New function.
7776
(r_get_lhs): Add case for Node_TEXTDOMAIN.
7775
(set_TEXTDOMAIN): New function.
7776
(r_get_lhs): Add case for Node_TEXTDOMAIN.
7777
7777
* main.c (varinit): Add entry for TEXTDOMAIN.
7778
7778
* node.c (format_val): If INTLSTR use dcgettext of string
7780
7780
* awkgram.y (tokentab): Add entries for "dcgettext" and
7782
7782
* builtin.c (do_dcgettext, do_bindtextdomain): New functions.
7784
7784
Tue Sep 5 17:01:34 2000 Arnold D. Robbins <arnold@skeeve.com>
7786
7786
* profile.c (pp_string_fp): Use lower case versions of
7787
isascii and isprint to avoid printing high-bit-set
7788
characters. Make it smarter to break strings at 70
7789
chars or after embedded newline, for --gen-po.
7790
Fix the calls to it everywhere for new boolean option
7791
to yes/no break lines.
7787
isascii and isprint to avoid printing high-bit-set
7788
characters. Make it smarter to break strings at 70
7789
chars or after embedded newline, for --gen-po.
7790
Fix the calls to it everywhere for new boolean option
7791
to yes/no break lines.
7792
7792
* m4/strtod.m4: New file, defines GAWK_AC_FUNC_STRTOD_C89.
7793
7793
* configure.in: GAWK_AC_FUNC_STRTOD_C89 call added
7794
7794
* acinclude.m4: Include strtod.m4.
7795
7795
* acconfig.h: Add entry for STRTOD_NOT_C89.
7796
Remove entries for BITOPS and NON_DEC_DATA.
7796
Remove entries for BITOPS and NON_DEC_DATA.
7797
7797
* missing/missing.c: Add check for STRTOD_NOT_C89, use ours
7799
7799
* missing/strtod.c: Make smarter for input like 0x345.
7800
7800
* awk.h: [STRTOD_NOT_C89]: Define strtod gawk_strtod to get
7801
our version. Avoids linker weirdness.
7801
our version. Avoids linker weirdness.
7803
7803
Mon Sep 4 09:16:43 2000 Arnold D. Robbins <arnold@skeeve.com>
7805
7805
* field.c (set_record): Fix from Utz-Uwe Haus
7806
<haus@saturn.Math.Uni-Magdeburg.DE> to make sure there's
7807
always enough room in the record.
7806
<haus@saturn.Math.Uni-Magdeburg.DE> to make sure there's
7807
always enough room in the record.
7808
7808
* builtin.c (nondec2awknum): Fix octal conversions to exit
7809
when hitting a non-digit, and not go to decimal. Make
7810
check for non-octal better. Based on bug report from
7811
Morris_Lee@tvratings.com.
7809
when hitting a non-digit, and not go to decimal. Make
7810
check for non-octal better. Based on bug report from
7811
Morris_Lee@tvratings.com.
7813
7813
Sun Sep 3 13:52:11 2000 Arnold D. Robbins <arnold@skeeve.com>
7815
7815
* builtin.c (format_tree): Allow positional parameters for
7816
%*.* kinds of things.
7816
%*.* kinds of things.
7818
7818
Made octal/hex constants and strtonum on by default. Made
7819
7819
--enable-non-decimal-data a runtime switch `--non-decimal-data'.
7821
7821
* configure.in: Removed AC_ARG_ENABLE for --enable-bitops and
7822
--enable-non-decimal-data.
7823
In .developing check, remove the AC_DEFINEs.
7822
--enable-non-decimal-data.
7823
In .developing check, remove the AC_DEFINEs.
7824
7824
* awk.h: Decls for bitwise functions now there by default.
7825
Add decl of `do_non_decimal_data'.
7825
Add decl of `do_non_decimal_data'.
7826
7826
* main.c (do_non_decimal_data): New variable
7827
(optlist): Add new entry for `--non-decimal-data'.
7828
(main): Turn off `do_non_decimal_data' if `do_traditional'.
7829
(usage): Add the new option.
7827
(optlist): Add new entry for `--non-decimal-data'.
7828
(main): Turn off `do_non_decimal_data' if `do_traditional'.
7829
(usage): Add the new option.
7830
7830
* node.c (r_force_number): Make check for non-decimal data a
7831
runtime check based on do_non_decimal_data.
7831
runtime check based on do_non_decimal_data.
7832
7832
* awkgram.y (yylex): Make non-decimal constants a runtime check.
7833
7833
* builtin.c: Remove the ifdefs around the bit functions and
7836
7836
Tue Aug 29 18:45:56 2000 Arnold D. Robbins <arnold@skeeve.com>
7838
7838
* configure.in: Go back to ARRAYDEBUG if .developing set.
7839
7839
* awkgram.y: Use ARRAYDEBUG for adump(), use multiple tests
7842
7842
Mon Aug 28 17:09:06 2000 Arnold D. Robbins <arnold@skeeve.com>
7844
7844
* field.c (do_split): Add check for first arg is null string,
7845
if so, skip the work and return zero.
7845
if so, skip the work and return zero.
7847
7847
Mon Aug 14 23:01:55 2000 Arnold D. Robbins <arnold@skeeve.com>
7849
7849
Add %COUNT$... handling to printf.
7851
7851
* awk.h (printf_count): New define in NODE structure.
7852
(format_tree): Added decl.
7852
(format_tree): Added decl.
7853
7853
* awkgram.y (count_args): New function to set printf_count in
7855
[print productions]: Call the function.
7855
[print productions]: Call the function.
7856
7856
* (snode): For do_sprintf, call count_args, set the count
7858
7858
* builtin.c (format_tree): New fourth arg is argument count.
7859
Add smarts to handle the `$' in a format.
7859
Add smarts to handle the `$' in a format.
7860
7860
* (do_sprintf): Use new argument to format_tree.
7861
node.c (format_val): Ditto.
7861
node.c (format_val): Ditto.
7863
7863
Sun Aug 13 11:10:41 2000 Arnold D. Robbins <arnold@skeeve.com>
7937
7937
* awk.h (NODE): exec_count now in #ifndef NO_PROFILING.
7938
7938
* Makefile.in: Changes to only recompile eval.c and profile.c to a
7939
special version for profiling.
7939
special version for profiling.
7940
7940
* custom.h [MSC_VER]: Turn on NO_PROFILING to omit the exec_count
7942
7942
* node.c (more_nodes): Move setting of exec_count to
7943
#ifndef NO_PROFILING.
7943
#ifndef NO_PROFILING.
7945
7945
Thu Jul 1 12:12:05 1999 Arnold D. Robbins <arnold@skeeve.com>
7947
7947
* configure.in (AC_PREREQ): Update to 2.13.
7948
GAWK_AC_C_STRINGIZE: convert to AC_C_STRINGIZE.
7948
GAWK_AC_C_STRINGIZE: convert to AC_C_STRINGIZE.
7949
7949
* aclocal.m4 (GAWK_AC_C_STRINGIZE): Remove definition, now
7951
7951
* acconfig.h (HAVE_STRINGIZE): Ditto.
7953
7953
Wed Apr 28 11:08:05 1999 Arnold D. Robbins <arnold@skeeve.com>
7955
7955
* array.c (assoc_lookup): Fix call to free_temp(subs) to after
7958
7958
Sun Apr 25 16:48:06 1999 Arnold D. Robbins <arnold@skeeve.com>
7960
7960
* io.c (redirect): Add lint warning when same file is used for
7963
7963
Thu Apr 22 15:05:30 1999 Arnold D. Robbins <arnold@skeeve.com>
7965
7965
* array.c (assoc_lookup): Fix call to fatal to lintwarn instead.
7966
7966
* node.c (r_force_number): Use `0 &&' to disable warnings about
7967
conversions: they're overzealous, methinks.
7967
conversions: they're overzealous, methinks.
7969
7969
Thu Apr 8 14:27:58 1999 Arnold D. Robbins <arnold@skeeve.com>
7971
New features for profiling:
7971
New features for profiling:
7973
7973
* awk.h (NODE): Add `exec_count' member.
7974
(freenode): Clear `exec_count' upon free.
7974
(freenode): Clear `exec_count' upon free.
7975
7975
* awk.y (func_count): New variable, counts total number of functions.
7976
(func_install): Increment func_count.
7977
(struct finfo): Information for use in sorting functions when
7979
(fcompare): Compare two finfo structures.
7980
(dump_funcs): Print the functions in sorted order for profiling.
7981
(getfname): Return the name of a builtin function.
7976
(func_install): Increment func_count.
7977
(struct finfo): Information for use in sorting functions when
7979
(fcompare): Compare two finfo structures.
7980
(dump_funcs): Print the functions in sorted order for profiling.
7981
(getfname): Return the name of a builtin function.
7982
7982
* eval.c (INCREMENT): New macro for counting execution of nodes.
7983
(interpret): Call INCREMENT() appropriately.
7983
(interpret): Call INCREMENT() appropriately.
7984
7984
* main.c (do_profiling): New flag if doing profiling.
7985
`--profiling': New option added to getopt_long machinery.
7986
(main): For profiled version, set do_profile and output file.
7987
Call `dump_prog' and `dump_funcs' if do_profiling at end.
7988
(usage): Add new argument.
7985
`--profiling': New option added to getopt_long machinery.
7986
(main): For profiled version, set do_profile and output file.
7987
Call `dump_prog' and `dump_funcs' if do_profiling at end.
7988
(usage): Add new argument.
7989
7989
* node.c (more_nodes, freenode): Set exec_count to zero.
7990
7990
* profile.c: New file, does pretty printing and prints counts.
7991
7991
* Makefile.in: Update to create two versions of gawk, regular
7992
and `pgawk' which does profiling.
7992
and `pgawk' which does profiling.
7994
7994
Wed Mar 10 21:38:14 1999 Arnold D. Robbins <arnold@skeeve.com>
7996
7996
* io.c (close_redir): Use update_ERRNO() instead of manually
7999
7999
Mon Dec 21 15:58:21 1998 Arnold D. Robbins <arnold@skeeve.com>
8001
8001
* configure.in: Add BeOS to list of cases where we hardwire
8003
custom.h: Remove the #define from __be_os case. Cleaner to
8004
do it all in configure. Based on email from Martin C. Brown,
8003
custom.h: Remove the #define from __be_os case. Cleaner to
8004
do it all in configure. Based on email from Martin C. Brown,
8007
8007
Mon Nov 30 20:52:52 1998 Arnold D. Robbins <arnold@skeeve.com>
8009
8009
* eval.c (update_ERRNO): New function, mainly for use by
8010
extension functions.
8010
extension functions.
8011
8011
* awk.h: Add decl.
8013
8013
Tue Nov 24 18:13:29 1998 Arnold D. Robbins <arnold@skeeve.com>
8015
8015
* Changes based on submission from Christos Zoulas at D.E. Shaw
8016
that adds the following features:
8017
- checking for use of uninitialized variables
8018
- checking if a string that's not a number converts to 0
8019
- ability to load a dynamic library to add built-ins
8020
- VERSION variable (may or may not stay)
8022
- --lint=fatal makes lint errors become fatal
8023
- LINT="fatal" has the same effect, any other positive
8024
value makes lint errors be just warnings
8016
that adds the following features:
8017
- checking for use of uninitialized variables
8018
- checking if a string that's not a number converts to 0
8019
- ability to load a dynamic library to add built-ins
8020
- VERSION variable (may or may not stay)
8022
- --lint=fatal makes lint errors become fatal
8023
- LINT="fatal" has the same effect, any other positive
8024
value makes lint errors be just warnings
8025
8025
* Makefile.in (includedir): New variable for gawk header files
8026
(ext.c, ext.o): New source and object files
8027
(OTHERS, extension): New directory for macro with example extension
8028
(install): Install header files
8026
(ext.c, ext.o): New source and object files
8027
(OTHERS, extension): New directory for macro with example extension
8028
(install): Install header files
8029
8029
* acconfig.h (DYNAMIC): New macro, true if can do dynamic loading
8030
8030
* array.c (assoc_lookup): New parameter `reference' is true if we
8031
want to do reference checking. Add appropriate reference checking
8031
want to do reference checking. Add appropriate reference checking
8033
8033
* awk.h (UNITITIALIZED): New flag
8034
(lintfunc): Function pointer for correct function to use
8035
(lintwarn): New macro to produce warnings
8036
(result): New macro for func call result, used in commented out
8038
(getnode, freenode): Revised to set UNINITIALIZED.
8039
(get_lhs): Third arg for reference checking, change all calls
8040
-- Add appropriate decls of new/changed functions
8034
(lintfunc): Function pointer for correct function to use
8035
(lintwarn): New macro to produce warnings
8036
(result): New macro for func call result, used in commented out
8038
(getnode, freenode): Revised to set UNINITIALIZED.
8039
(get_lhs): Third arg for reference checking, change all calls
8040
-- Add appropriate decls of new/changed functions
8041
8041
* awk.y (tokentab): New builtin "extension" for adding extensions
8042
(node_common): Set flags to UNINITIALIZED for Node_var.
8042
(node_common): Set flags to UNINITIALIZED for Node_var.
8043
8043
* configure.in (dynamic linking): New check. Probably should
8044
be a separate macro.
8044
be a separate macro.
8045
8045
* eval.c (flag2str): Add UNINITIALIZED to the table.
8046
(r_tree_eval): Add checks for UNINITIALIZED.
8047
(push_args): Appropriate changes for UNINITIALIZED to work.
8048
(r_get_lhs): New third argument for reference checking.
8049
(set_LINT): Add code to handle setting `lintfunc' appropriately.
8046
(r_tree_eval): Add checks for UNINITIALIZED.
8047
(push_args): Appropriate changes for UNINITIALIZED to work.
8048
(r_get_lhs): New third argument for reference checking.
8049
(set_LINT): Add code to handle setting `lintfunc' appropriately.
8050
8050
* ext.c: New file, for doing dynamic library extensions.
8051
8051
* extension/*: New directory with simple example code.
8052
8052
* main.c (VERSION_node, EXTENSION_node): New nodes for new vars.
8053
(optab): Change for "lint" to allow optional argument.
8054
(lintfunc): Definition.
8055
(main): Add case in option processing for --lint.
8056
(varinit): Add entries for VERSION and EXTENSION.
8053
(optab): Change for "lint" to allow optional argument.
8054
(lintfunc): Definition.
8055
(main): Add case in option processing for --lint.
8056
(varinit): Add entries for VERSION and EXTENSION.
8057
8057
* node.c (r_force_number): Checks that string really is a number.
8058
(morenodes): Set UNITIALIZED in the flags.
8058
(morenodes): Set UNITIALIZED in the flags.
8059
8059
* re.c (all): Change `result' to `res' globally to avoid conflict
8061
8061
* GLOBAL: Change lint calls to warning() to lintwarn().
8062
8062
* GLOBAL: Change all calls to get_lhs() to have 3rd arg.
8063
8063
* GLOBAL: Change all calls to assoc_lookup() to have 3rd arg.
8199
8199
* acconfig.h: Add HAVE_SOCKETS and HAVE_PORTALS defs.
8200
8200
* aclocal.m4: New macro GAWK_AC_LIB_SOCKETS.
8201
8201
* awk.h: New node type, Node_redirect_twoway, and new redirection
8202
flags: RED_TWOWAY, and RED_SOCKET.
8202
flags: RED_TWOWAY, and RED_SOCKET.
8203
8203
* awk.y (parser): Add TWOWAYIO token and appropriate productions.
8204
(yylex): Recognize `|&' token if not traditional.
8204
(yylex): Recognize `|&' token if not traditional.
8205
8205
* builtin.c (do_print, do_printf): Flush buffer if TWOWAYIO.
8206
8206
* configure.in: Add header checks for networking header files,
8207
add --enable-portals switch, call GAWK_AC_LIB_SOCKETS
8207
add --enable-portals switch, call GAWK_AC_LIB_SOCKETS
8208
8208
* eval.c (nodetypes): Add string constant for Node_redirect_twoway.
8209
8209
* io.c (redflags2str): New function.
8210
(redirect): Better error message in default case, add code for
8211
Node_redirect_twoway.
8212
(socketopen): New function.
8213
(iop_open, devopen): Add recognition of `/inet/...'.
8214
(two_way_open): New function.
8210
(redirect): Better error message in default case, add code for
8211
Node_redirect_twoway.
8212
(socketopen): New function.
8213
(iop_open, devopen): Add recognition of `/inet/...'.
8214
(two_way_open): New function.
8216
8216
Sat Dec 13 21:15:07 1997 Arnold D. Robbins <arnold@skeeve.com>
8218
8218
* awk.h (struct node): New member, `param_list' in union `x', becomes
8219
`node->parmlist' in the code.
8219
`node->parmlist' in the code.
8220
8220
* awk.y (func_install): Rearranged a bit, to build up a list of
8221
the function parameter names and to save it in the `parmlist' field.
8221
the function parameter names and to save it in the `parmlist' field.
8222
8222
* eval.c (push_args): New parameter, `varnames', which is the list
8223
of variable names. Use this to set the vname field of each
8224
parameter's value as it's created. Special case arrays to include
8225
where they came from, mainly for array vs. scalar diagnostics.
8226
(r_tree_eval): Don't set the `vname' field for parameters.
8227
(pop_fcall): Free the `vname' field if it's an array.
8228
(func_call): Pass in the `parmlist' field to call of push_args().
8229
(r_get_lhs): For Node_subscript, change error message to use
8231
(stopme): New do-nothing function for use with debugging code
8232
and setting breakpoints.
8223
of variable names. Use this to set the vname field of each
8224
parameter's value as it's created. Special case arrays to include
8225
where they came from, mainly for array vs. scalar diagnostics.
8226
(r_tree_eval): Don't set the `vname' field for parameters.
8227
(pop_fcall): Free the `vname' field if it's an array.
8228
(func_call): Pass in the `parmlist' field to call of push_args().
8229
(r_get_lhs): For Node_subscript, change error message to use
8231
(stopme): New do-nothing function for use with debugging code
8232
and setting breakpoints.
8234
8234
Thu Dec 4 15:18:17 1997 Arnold D. Robbins <arnold@skeeve.com>
8236
8236
* awk.y: Fixed several lint checks and moved some into
8237
test for do_lint_old.
8237
test for do_lint_old.
8238
8238
* eval.c (fmt_index): Add value of bad format spec to
8241
8241
Tue Nov 18 22:19:02 1997 Arnold D. Robbins <arnold@skeeve.com>
8243
8243
* Makefile.in (install): Strip the installed binary.
8244
From Anatoly A. Orehovsky (tolik@mpeks.tomsk.su).
8244
From Anatoly A. Orehovsky (tolik@mpeks.tomsk.su).
8246
8246
Sun Nov 16 22:12:39 1997 Arnold D. Robbins <arnold@skeeve.com>
8248
8248
* array.c (in_array, assoc_lookup): Add symbol->vname to
8249
fatal calls for scalar in array context.
8249
fatal calls for scalar in array context.
8251
8251
Wed Nov 12 22:18:33 1997 Arnold D. Robbins <arnold@skeeve.com>
8253
8253
* awk.h [ISASCII]: On all IS* macros, add cast to unsigned char.
8254
[TOUPPER, TOLOWER]: New macros using unsigned char.
8254
[TOUPPER, TOLOWER]: New macros using unsigned char.
8255
8255
* awk.y: Change to use of IS* vs. is* macros.
8256
8256
* builtin.c (nondec2awknum): Change to use of IS* vs. is* macros,
8257
change casts for casetable[] from int to unsigned char.
8258
use new TOLOWER, TOUPPER macros
8257
change casts for casetable[] from int to unsigned char.
8258
use new TOLOWER, TOUPPER macros
8259
8259
* dfa.c [ISASCII]: On all IS* macros, add cast to unsigned char.
8260
(lex): Change isdigit to ISDIGIT.
8261
[TOUPPER, TOLOWER]: New macros using unsigned char, now used.
8260
(lex): Change isdigit to ISDIGIT.
8261
[TOUPPER, TOLOWER]: New macros using unsigned char, now used.
8262
8262
* eval.c (fmt_ok): Change to use of IS* vs. is* macros.
8263
8263
* field.c (sc_parse_field): Change to use of IS* vs. is* macros,
8264
change casts for casetable[] from int to unsigned char.
8265
(set_FS): Change to use of IS* vs. is* macros.
8264
change casts for casetable[] from int to unsigned char.
8265
(set_FS): Change to use of IS* vs. is* macros.
8266
8266
* io.c (get_a_record): Change to use of IS* vs. is* macros,
8267
change casts for casetable[] from int to unsigned char.
8267
change casts for casetable[] from int to unsigned char.
8268
8268
* main.c (main): Change to use of IS* vs. is* macros.
8269
8269
* node.c (r_force_number, parse_escape): Change to use of IS* vs.
8271
8271
* re.c (make_regexp): Change to use of IS* vs. is* macros.
8272
8272
* regex.c [ISASCII]: On all IS* macros, add cast to unsigned char.
8576
8576
Sun May 7 16:33:05 2000 Arnold D. Robbins <arnold@skeeve.com>
8578
8578
* array.c (concat_exp): Change ref to `lnode->stlen' and
8579
`lnode->stptr' for SUBSEP to use `var_value->...'.
8579
`lnode->stptr' for SUBSEP to use `var_value->...'.
8581
8581
Tue May 2 09:54:29 2000 Arnold D. Robbins <arnold@skeeve.com>
8583
8583
Fix referencing freed memory as shown by test/arynocls.* tests.
8584
8584
* awk.h [Node_array_ref]: New node type.
8585
[orig_array]: New macro element in NODE structure.
8585
[orig_array]: New macro element in NODE structure.
8586
8586
* field.c (do_split): Handle case for Node_array_ref, fetch
8588
8588
* array.c (in_array, do_delete): Ditto.
8589
8589
* eval.c (nodetypes[]): Add Node_array_ref string.
8590
(r_tree_eval): Handle case for Node_array_ref.
8591
(push_args): Push arrays as Node_array_ref, and pass them on.
8592
(pop_fcall): Don't unref lnode if it's an array when releasing
8593
local arguments. Check for both Node_array and Node_array_ref.
8594
(r_get_lhs): Choke on Node_array_ref as for Node_array.
8595
For Node_subscript, handle Node_array_ref.
8590
(r_tree_eval): Handle case for Node_array_ref.
8591
(push_args): Push arrays as Node_array_ref, and pass them on.
8592
(pop_fcall): Don't unref lnode if it's an array when releasing
8593
local arguments. Check for both Node_array and Node_array_ref.
8594
(r_get_lhs): Choke on Node_array_ref as for Node_array.
8595
For Node_subscript, handle Node_array_ref.
8597
8597
Tue May 2 09:52:12 2000 Bruno Haible <haible@clisp.cons.org>
8599
8599
* io.c (redirect): After reopening a `struct redirect', move it to
8600
the head of the list.
8600
the head of the list.
8602
8602
Sun Apr 2 17:51:40 2000 Arnold D. Robbins <arnold@skeeve.com>
8604
8604
* re.c (re_update): Check if IGNORECASE has changed, and
8605
if so recompute the re. See test/igncdym.awk.
8605
if so recompute the re. See test/igncdym.awk.
8607
8607
Mon Mar 20 16:18:34 2000 Arnold D. Robbins <arnold@skeeve.com>
8609
8609
* io.c (set_RS): Added a lint warning about multicharacter RS,
8610
per suggestion from Akim DeMaille (akim@epita.fr).
8610
per suggestion from Akim DeMaille (akim@epita.fr).
8612
8612
Sun Feb 13 14:40:32 2000 Arnold D. Robbins <arnold@skeeve.com>
8614
8614
* eval.c (push_args): Fix from Nide Naoyuki <nide@ics.nara-wu.ac.jp>,
8615
re-assign `f' in case tree_eval moved fcall_list around.
8615
re-assign `f' in case tree_eval moved fcall_list around.
8617
8617
Sun Feb 6 11:39:33 2000 Arnold D. Robbins <arnold@skeeve.com>
8619
8619
* eval.c (op_assign): Fix it right. For ++ and --, get the lhs
8620
in the operations, do the op, and then return. For += etc,
8621
get the rhs FIRST, since the lhs can move around as a result,
8622
*then* get the lhs and do the operation. See test/opasnidx.awk.
8620
in the operations, do the op, and then return. For += etc,
8621
get the rhs FIRST, since the lhs can move around as a result,
8622
*then* get the lhs and do the operation. See test/opasnidx.awk.
8624
8624
Tue Feb 1 18:41:40 2000 Arnold D. Robbins <arnold@skeeve.com>
8626
8626
* eval.c (op_assign): Reget the rval after regetting
8627
the left hand side. See test/opasnslf.awk for why.
8627
the left hand side. See test/opasnslf.awk for why.
8629
8629
Thu Jan 27 18:06:31 2000 Arnold D. Robbins <arnold@skeeve.com>
8631
8631
* awk.y (yylex): Made ']' not one of the characters
8632
that sets `want_assign' to false. `a[i] /= 2' was
8633
broken. Per bug report from Kristofer T. Karas
8634
<ktk@ktk.bidmc.harvard.edu>.
8632
that sets `want_assign' to false. `a[i] /= 2' was
8633
broken. Per bug report from Kristofer T. Karas
8634
<ktk@ktk.bidmc.harvard.edu>.
8636
8636
Wed Dec 22 15:06:37 1999 Arnold D. Robbins <arnold@skeeve.com>
8638
8638
* awk.y: Removed declarations of functions before
8639
definition of `tokentab[]'. They're redundant with
8639
definition of `tokentab[]'. They're redundant with
8642
8642
Thu Dec 9 17:01:07 1999 Arnold D. Robbins <arnold@skeeve.com>
8644
8644
* node.c (parse_escape): Add lint warning for unrecognized
8647
8647
Mon Dec 6 15:17:34 1999 Arnold D. Robbins <arnold@skeeve.com>
8649
8649
* main.c (usage): Changed bug reporting email addresses to
8650
be a reference to `Bugs' node in the online and printed
8650
be a reference to `Bugs' node in the online and printed
8653
8653
Thu Dec 2 13:08:18 1999 Arnold D. Robbins <arnold@skeeve.com>
8655
8655
* builtin.c (do_compl): Test `d' for negative inside the do_lint
8656
test, not uval. Ooops.
8656
test, not uval. Ooops.
8658
8658
Fri Nov 26 10:58:36 1999 Arnold D. Robbins <arnold@skeeve.com>
8660
8660
* array.c (assoc_find): ALWAYS compare indexes as strings,
8661
don't use cmp_nodes in case they are numeric. Oh my.
8662
Talk about a Day 1 bug!
8661
don't use cmp_nodes in case they are numeric. Oh my.
8662
Talk about a Day 1 bug!
8664
8664
Tue Nov 23 11:58:53 1999 Arnold D. Robbins <arnold@skeeve.com>
8666
8666
* regex.c (SYNTAX): Cast argument to `unsigned char' instead of
8667
&-ing with 0xFF. Hopefully somewhat more portable, ala 21 Nov 99
8667
&-ing with 0xFF. Hopefully somewhat more portable, ala 21 Nov 99
8670
8670
Sun Nov 21 22:25:27 1999 Paul Eggert <eggert@twinsun.com>
8672
8672
* aclocal.m4 (AC_SYS_LARGEFILE_FLAGS): Work around a
8673
problem with the QNX 4.25 shell, which doesn't propagate exit
8674
status of failed commands inside shell assignments.
8673
problem with the QNX 4.25 shell, which doesn't propagate exit
8674
status of failed commands inside shell assignments.
8676
8676
Sun Nov 21 20:33:35 1999 Arnold D. Robbins <arnold@skeeve.com>
8678
8678
* awk.h (nextc): Remove declaration, don't need it here.
8679
awk.y (nextc): Cast values to unsigned char so that latin-1
8680
characters in strings don't turn themselves into EOF.
8681
Most notably y-umlaut, which is decimal 255.
8679
awk.y (nextc): Cast values to unsigned char so that latin-1
8680
characters in strings don't turn themselves into EOF.
8681
Most notably y-umlaut, which is decimal 255.
8683
8683
Mon Nov 1 20:00:25 1999 Arnold D. Robbins <arnold@skeeve.com>
8685
8685
* regex.c (init_syntax_once): Move below definition of
8686
ISALNUM etc., then use ISALNUM to init the table, so that
8687
the word ops will work if i18n'ed.
8688
(SYNTAX): And subscript with 0xFF for Latin-1 characters.
8686
ISALNUM etc., then use ISALNUM to init the table, so that
8687
the word ops will work if i18n'ed.
8688
(SYNTAX): And subscript with 0xFF for Latin-1 characters.
8690
8690
Mon Oct 25 18:37:13 1999 Arnold D. Robbins <arnold@skeeve.com>
8692
8692
* awk.h, main.c, io.c: Undo previous changes (22 Oct 1999).
8693
8693
* main.c (main): Move call to `init_fields()' to before
8694
arg parsing. This allows `-v NF=blah' to work ok.
8694
arg parsing. This allows `-v NF=blah' to work ok.
8696
8696
Fri Oct 22 17:43:40 1999 Arnold D. Robbins <arnold@skeeve.com>
8698
8698
* main.c (arg_assign): Add new arg, `initing' for icky special
8699
casing of -v of special variables. Use it to check for NF.
8700
May need to add other cases later.
8701
(pre_assign): Change call arg_assign, passing initing=TRUE;
8702
io.c (nextfile): Change call arg_assign, passing initing=FALSE;
8703
awk.h: Change prototype for arg_assign.
8699
casing of -v of special variables. Use it to check for NF.
8700
May need to add other cases later.
8701
(pre_assign): Change call arg_assign, passing initing=TRUE;
8702
io.c (nextfile): Change call arg_assign, passing initing=FALSE;
8703
awk.h: Change prototype for arg_assign.
8705
8705
Tue Oct 19 16:06:48 1999 Paul Eggert <eggert@twinsun.com>
8707
8707
* io.c (close_redir): Don't munge errno between setting it and
8710
8710
Wed Oct 6 17:47:47 1999 Arnold D. Robbins <arnold@skeeve.com>
8712
8712
* main.c (arg_assign): Return NULL on bad variable. Allows
8713
things like `./3x=stuff' to work as a filename.
8713
things like `./3x=stuff' to work as a filename.
8715
8715
Thu Sep 23 21:35:46 1999 Paul Eggert <eggert@twinsun.com>
8717
8717
* aclocal.m4 (GAWK_AC_SYS_LARGEFILE_FLAGS): Work around GCC
8718
2.95.1 bug in HP-UX 10.20 or later. (Had to fix the fix. ADR. :-)
8718
2.95.1 bug in HP-UX 10.20 or later. (Had to fix the fix. ADR. :-)
8720
8720
Tue Sep 21 13:31:36 1999 Arnold D. Robbins <arnold@skeeve.com>
8722
8722
* builtin.c (format_tree): For '0', only set zero_flag if we
8723
haven't seen the field width or precision yet.
8723
haven't seen the field width or precision yet.
8725
8725
Mon Aug 9 13:06:01 1999 Arnold D. Robbins <arnold@skeeve.com>
8727
8727
* array.c (assoc_lookup): Removed code that gave each array
8728
a private copy of each index. Balloons memory usage for
8729
no good reason that I can see. Just use dupnode in all
8728
a private copy of each index. Balloons memory usage for
8729
no good reason that I can see. Just use dupnode in all
8731
8731
* configure.in: Check for $srcdir/.developing adds extra
8732
defines for my testing/debugging use. Yes, hack alert.
8732
defines for my testing/debugging use. Yes, hack alert.
8734
8734
Sun Aug 1 11:02:02 1999 Arnold D. Robbins <arnold@skeeve.com>
8952
8952
Mon Mar 16 14:06:41 1998 Arnold D. Robbins <arnold@gnu.org>
8954
8954
* field.c (using_FIELDWIDTHS): New macro.
8955
(using_fieldwidths): Use new macro.
8956
(do_split): In case for FS_DFLT, also check that
8957
we're not using FIELDWIDTHS. Otherwise, split() would use
8958
FIELDWIDTHS, not current value of FS. Oops.
8955
(using_fieldwidths): Use new macro.
8956
(do_split): In case for FS_DFLT, also check that
8957
we're not using FIELDWIDTHS. Otherwise, split() would use
8958
FIELDWIDTHS, not current value of FS. Oops.
8960
8960
Sun Nov 16 20:08:59 1997 Arnold D. Robbins <arnold@gnu.org>
8962
8962
* builtin.c (sub_common): Fix for count of matches in gsub
8963
from Geert.Debyser@esat.kuleuven.ac.be.
8963
from Geert.Debyser@esat.kuleuven.ac.be.
8965
8965
Wed Oct 15 03:38:12 1997 Arnold D. Robbins <arnold@gnu.org>
8967
8967
* field.c (set_FS): Use `sc_parsefield' if the value of FS is not
8968
alphabetic OR if not ignoring case. Bug fix if IGNORECASE
8969
is true and FS happens to be '^'. Sheesh, talk about obscure.
8970
(rebuild_record): Add more smarts to the code that sets up the
8971
fields. Thanks to Alan J. Broder (ajb@dtmr.com).
8968
alphabetic OR if not ignoring case. Bug fix if IGNORECASE
8969
is true and FS happens to be '^'. Sheesh, talk about obscure.
8970
(rebuild_record): Add more smarts to the code that sets up the
8971
fields. Thanks to Alan J. Broder (ajb@dtmr.com).
8973
8973
Sun Oct 5 11:56:52 1997 Arnold D. Robbins <arnold@gnu.org>
8975
8975
* configure.in: If ISC add -D_SYSV3 to CFLAGS, per email from
8976
Mario Vanoni (vanonim@dial.eunet.ch).
8976
Mario Vanoni (vanonim@dial.eunet.ch).
8978
8978
Fri Sep 26 00:57:49 1997 Arnold D. Robbins <arnold@gnu.org>
8980
8980
* awk.y (append_right): Return if either list is NULL. Prevents
8981
syntax errors from causing core dumps.
8981
syntax errors from causing core dumps.
8983
8983
Wed Sep 17 15:34:15 1997 Arnold D. Robbins <arnold@gnu.org>
8985
8985
* field.c (rebuild_record): Set things up so that all fields point
8986
into the new record and release any changed fields without
8987
causing memory leaks. Avoids problems when fields are extended
8988
with the value of $0 or other fields and then $0 is assigned to.
8986
into the new record and release any changed fields without
8987
causing memory leaks. Avoids problems when fields are extended
8988
with the value of $0 or other fields and then $0 is assigned to.
8990
8990
Mon Sep 15 16:12:55 1997 Arnold D. Robbins <arnold@gnu.org>
8992
8992
* builtin.c (do_print): When testing for NUMBER, make sure
8993
it's not a string too. Thanks to Michael Brennan for
8994
clarifying the semantics.
8993
it's not a string too. Thanks to Michael Brennan for
8994
clarifying the semantics.
8996
8996
Sun Sep 14 19:55:12 1997 Arnold D. Robbins <arnold@gnu.org>
8998
8998
* node.c (format_val): Always format values ourselves: avoids
8999
problems if OFMT is bizarre, like %s.
8999
problems if OFMT is bizarre, like %s.
9001
9001
Sun Sep 14 00:08:53 1997 Arnold D. Robbins <arnold@gnu.org>
9003
9003
* io.c (get_a_record): Replace all occurrences of the test
9004
`grRS == FALSE' with `RS_is_null' which makes ` RS = "\0" '
9005
actually work, is clearer code, and actually makes use of
9006
the `RS_is_null' variable!
9004
`grRS == FALSE' with `RS_is_null' which makes ` RS = "\0" '
9005
actually work, is clearer code, and actually makes use of
9006
the `RS_is_null' variable!
9008
9008
Sun Aug 17 07:15:12 1997 Arnold D. Robbins <arnold@gnu.org>
9010
9010
* field.c (set_FS): Change logic to always set parse_field, even
9011
if FS hasn't changed. Thanks to Igor Sheyn for catching this.
9011
if FS hasn't changed. Thanks to Igor Sheyn for catching this.
9013
9013
Wed Aug 6 21:04:37 1997 Arnold D. Robbins <arnold@gnu.org>
9015
9015
* io.c (VMS et al gawk_popen): Use pclose, not fclose, if
9018
9018
Wed Jul 30 19:53:52 1997 Arnold D. Robbins <arnold@gnu.org>
9150
9150
* builtin.c (do_strtonum): New function.
9151
9151
* configure.in (non-decimal-data): New --enable-* option.
9152
9152
* node.c (r_force_number): Change to allow non-decimal data inside
9155
9155
Tue Apr 15 06:32:50 1997 Pat Rankin <rankin@eql.caltech.edu>
9157
9157
* missing/strftime.c (malloc, realloc, getenv, strchr): Only
9158
declare these when STDC_HEADERS is not defined.
9159
<stdlib.h, string.h>: Include these when STDC_HEADERS is defined.
9158
declare these when STDC_HEADERS is not defined.
9159
<stdlib.h, string.h>: Include these when STDC_HEADERS is defined.
9160
9160
* awk.h (freenode, tree_eval, m_tree_eval): Reorganize definitions.
9161
9161
* alloca.c (malloc): If malloc is already defined as a macro,
9162
presumeably by config.h, don't define or declare it.
9162
presumeably by config.h, don't define or declare it.
9164
9164
Wed Apr 9 22:45:27 1997 Arnold D. Robbins <arnold@skeeve.atl.ga.us>
9166
9166
* Makefile.in [COMPFLAGS]: Per suggestion from Karl Berry, put
9169
9169
Tue Apr 8 23:54:46 1997 Arnold D. Robbins <arnold@skeeve.atl.ga.us>
9171
9171
* eval.c (interpret): For Node_K_break and Node_K_continue, if
9172
treating them like `next', also check the function call stack
9173
and pop it if necessary.
9172
treating them like `next', also check the function call stack
9173
and pop it if necessary.
9175
9175
Mon Apr 7 18:22:37 1997 Arnold D. Robbins <arnold@skeeve.atl.ga.us>
9177
9177
* awk.h: Add decls of new routines do_compl() and set_loc().
9178
9178
* awk.y (tokentab): Add entry for "compl" function.
9179
9179
* builtin.c (do_compl): New function to do ones complement.
9180
(do_substr): Rationalized yet again, now notices negative start
9181
and length parameters.
9180
(do_substr): Rationalized yet again, now notices negative start
9181
and length parameters.
9182
9182
* eval.c (push_args): Fix if call_list gets realloc'ed in the
9183
middle of things. Avoids crash for deeply nested function calls.
9183
middle of things. Avoids crash for deeply nested function calls.
9184
9184
* main.c (catch_sig): Add call to set_loc().
9185
9185
* msg.c (set_loc, srcfile, srcline): New function and private
9186
variables to help out in tracing down source of error messages.
9186
variables to help out in tracing down source of error messages.
9188
9188
Fri Mar 28 08:42:27 1997 Arnold D. Robbins <arnold@skeeve.atl.ga.us>
9190
9190
* io.c (iop_alloc, iop_close): Undo changes of Feb 11, apparently
9191
other cleanups in io.c made mmap stuff start working again.
9192
BAH! It's a mess, the test suite still fails. I'm leaving the
9193
mmap stuff undefined for now. It'll probably get ripped out in 3.1.
9191
other cleanups in io.c made mmap stuff start working again.
9192
BAH! It's a mess, the test suite still fails. I'm leaving the
9193
mmap stuff undefined for now. It'll probably get ripped out in 3.1.
9195
9195
Thu Mar 27 08:48:57 1997 Arnold D. Robbins <arnold@skeeve.atl.ga.us>
9271
9271
Wed Feb 19 23:29:02 1997 Arnold D. Robbins <arnold@skeeve.atl.ga.us>
9273
9273
* main.c (main): Add do_intervals to condition that causes
9274
resetup() to be called again. Makes the --re-interval option
9275
actually work. What a concept.
9274
resetup() to be called again. Makes the --re-interval option
9275
actually work. What a concept.
9277
9277
Fri Feb 14 09:47:31 1997 Arnold D. Robbins <arnold@skeeve.atl.ga.us>
9279
9279
* io.c [#include "awk.h"]: Undef HAVE_MMAP to just use the old code.
9280
Something is causing a file descriptor leak, and this is getting to
9281
be just too much hair. I reserve the right to rip out the mmap
9282
code entirely at a future date.
9280
Something is causing a file descriptor leak, and this is getting to
9281
be just too much hair. I reserve the right to rip out the mmap
9282
code entirely at a future date.
9284
9284
Tue Feb 11 06:28:29 1997 Arnold D. Robbins <arnold@skeeve.atl.ga.us>
9286
9286
* io.c (iop_alloc): For an mmap'ed file, close the file descriptor,
9287
and then touch each page to get a private copy. Fixes nasty case
9288
of truncating our input file.
9289
(iop_close): Don't call close on mmap'ed file.
9287
and then touch each page to get a private copy. Fixes nasty case
9288
of truncating our input file.
9289
(iop_close): Don't call close on mmap'ed file.
9291
9291
Wed Feb 5 17:59:04 1997 Arnold D. Robbins <arnold@skeeve.atl.ga.us>
9293
9293
* eval.c (interpret): For Node_K_delete, just call do_delete; let
9294
it handle the case of `delete array'.
9294
it handle the case of `delete array'.
9295
9295
* array.c (do_delete): Changed to handle case of `delete array',
9296
and made smarter if the array is actually an uninitialized
9296
and made smarter if the array is actually an uninitialized
9299
9299
Sun Jan 26 22:58:29 1997 Arnold D. Robbins <arnold@skeeve.atl.ga.us>
9301
9301
* getopt.h, getopt.c, getopt1.c: Replaced with new versions from
9304
9304
Sun Jan 19 23:37:03 1997 Arnold D. Robbins <arnold@skeeve.atl.ga.us>
9306
9306
* eval.c (nodetype2str): Not static, for debugging.
9307
(flags2str): New function for debugging.
9307
(flags2str): New function for debugging.
9308
9308
* field.c (get_field): Add new var that is like Nnull_string but
9309
does not have numeric attributes, so that new fields are strings.
9310
(set_record): Turn off PERM flag before unrefing fields and field 0.
9309
does not have numeric attributes, so that new fields are strings.
9310
(set_record): Turn off PERM flag before unrefing fields and field 0.
9311
9311
* array.c (in_array): Always evaluate subscript, could have
9313
9313
* builtin.c (do_strftime): Way increase size of buffer to make sure
9314
we don't have overflow problem. Keeps Paul Eggert happy.
9314
we don't have overflow problem. Keeps Paul Eggert happy.
9315
9315
* custom.h [__amigaos__]: Define fork to vfork. From Fred Fish.
9316
9316
* dfa.c: Move include of config.h to top, for RSXNT. From Kai
9318
(ISALPHA, etc): Change from Jacob Engelbrecht (jaen@novo.dk)
9319
to better handle non-ASCII environments.
9318
(ISALPHA, etc): Change from Jacob Engelbrecht (jaen@novo.dk)
9319
to better handle non-ASCII environments.
9320
9320
* gawkmisc.c: Remove amigados case, posix should now work fine.
9321
9321
* amiga/*: Nuked per previous entry.
9322
9322
* Makefile.in: Removed all references to amiga
9323
9323
* io.c [HAVE_SYS_PARAM_H]: Add #undef RE_DUP_MAX to avoid
9324
spurious conflict with regex.h.
9325
(flush_io): Remove amiga ifdefs, not needed anymore.
9326
(spec_setup): Set getrec field for special files. Fix from
9327
Mark Gray (markgray@pdt.net).
9324
spurious conflict with regex.h.
9325
(flush_io): Remove amiga ifdefs, not needed anymore.
9326
(spec_setup): Set getrec field for special files. Fix from
9327
Mark Gray (markgray@pdt.net).
9328
9328
* node.c (more_nodes): Fix to get the last entry in the array.
9330
9330
Wed Jan 8 17:42:37 1997 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
9332
9332
* io.c (mmap_get_record): Fix return value if file ends without
9335
9335
Fri Jan 3 19:57:16 1997 Pat Rankin <rankin@eql.caltech.edu>
9337
9337
* awk.y (get_src_buf): Test for an empty source file by detecting
9338
an initial read of 0 bytes rather than by relying on info from
9338
an initial read of 0 bytes rather than by relying on info from
9341
9341
Wed Dec 25 11:25:22 1996 Arnold D. Robbins <arnold@skeeve.atl.ga.us>
9633
9633
Mon Jul 29 12:02:48 1996 Arnold D. Robbins <arnold@skeeve.atl.ga.us>
9635
9635
* eval.c (set_IGNORECASE): Made somewhat smarter. gawk -v IGNORECASE=0
9636
was acting the same as -v IGNORECASE=1. Thanks to Darrell Hankerson
9636
was acting the same as -v IGNORECASE=1. Thanks to Darrell Hankerson
9639
9639
Fri Jul 26 12:04:43 1996 Arnold D. Robbins <arnold@skeeve.atl.ga.us>
9641
9641
* awk.h (format_val): Add declaration of new routine.
9642
9642
* node.c (format_val): New routine, abstracts old guts of
9643
r_forcestring; accepts format string and index as additional params.
9644
(r_force_string): Changed to call format_val.
9643
r_forcestring; accepts format string and index as additional params.
9644
(r_force_string): Changed to call format_val.
9645
9645
* builtin.c (do_print): Don't tree_eval the tree twice in case
9646
OFMTidx != CONVFMTidx; doing so could cause side effects
9647
(from bug report by Tobias Rettstadt, xassp@ipds.uni-kiel.de).
9648
Instead, call format_val.
9646
OFMTidx != CONVFMTidx; doing so could cause side effects
9647
(from bug report by Tobias Rettstadt, xassp@ipds.uni-kiel.de).
9648
Instead, call format_val.
9650
9650
Mon Jul 22 21:59:15 1996 Arnold D. Robbins <arnold@skeeve.atl.ga.us>
9652
9652
* io.c (iop_close): Change check for "is $0 in the input buffer"
9653
to use `< (iop->buf + iop->secsiz + iop->size)' instead of
9654
`< iop->end'. The latter is bogus if EOF has been hit on the
9655
file. Fix from Darrel Hankerson based on bug report by
9656
Charles Howes (howes@grid.direct.ca). See test/eofsplit.awk.
9653
to use `< (iop->buf + iop->secsiz + iop->size)' instead of
9654
`< iop->end'. The latter is bogus if EOF has been hit on the
9655
file. Fix from Darrel Hankerson based on bug report by
9656
Charles Howes (howes@grid.direct.ca). See test/eofsplit.awk.
9658
9658
Thu Jul 18 19:43:20 1996 Arnold D. Robbins <arnold@skeeve.atl.ga.us>
9660
9660
* builtin.c (sub_common): Backed out change of Feb 14 in favor of:
9661
(do_gensub): Changed to use make_string and then to |= TEMP
9662
flag, based on bug report and patch from Katsuyuki Okabe,
9663
hgc02147@niftyserve.or.jp.
9661
(do_gensub): Changed to use make_string and then to |= TEMP
9662
flag, based on bug report and patch from Katsuyuki Okabe,
9663
hgc02147@niftyserve.or.jp.
9665
9665
Thu Jul 18 19:23:53 1996 Arnold D. Robbins <arnold@skeeve.atl.ga.us>
9667
9667
* custom.h: Added ifdef for QNX, based on bug report from
9668
Michael Hunter, mphunter@qnx.com.
9668
Michael Hunter, mphunter@qnx.com.
9670
9670
Mon Jul 15 09:31:01 1996 Arnold D. Robbins <arnold@skeeve.atl.ga.us>
9672
9672
* io.c (redirect): When finding the rp pointer, if it's not
9673
NULL, set str = rp->value. This gets the '\0' terminated
9674
version. Motivated by bug report from John Hawkinson
9675
(jhawk@bbnplanet.com).
9673
NULL, set str = rp->value. This gets the '\0' terminated
9674
version. Motivated by bug report from John Hawkinson
9675
(jhawk@bbnplanet.com).
9677
9677
Sun Jul 14 18:40:26 1996 Arnold D. Robbins <arnold@skeeve.atl.ga.us>
9679
9679
* configure.in: Added call to AC_CHECK_LIB(m, fmod), since
9680
apparently some systems have fmod in the math library.
9681
Portability: The Holy Grail. Sigh.
9680
apparently some systems have fmod in the math library.
9681
Portability: The Holy Grail. Sigh.
9683
9683
Sun Jul 14 18:08:01 1996 Arnold D. Robbins <arnold@skeeve.atl.ga.us>
9685
9685
* awk.h: Add Jim Meyerings ISASCII etc hacks for ctype macros.
9686
9686
* builtin.c (do_toupper, do_tolower, sub_common): Changed to use
9687
upper-case versions of ctype macros.
9687
upper-case versions of ctype macros.
9688
9688
* main.c (main): Ditto.
9689
9689
* node.c (r_force_number, parse_escape): Ditto.
9691
9691
Sun Jul 14 06:34:18 1996 Arnold D. Robbins <arnold@skeeve.atl.ga.us>
9693
9693
* field.c (set_record): Made it always do the PERM flag.
9694
Fixes cases where $0 is assigned to, e.g. by gsub, keeps
9696
(get_field): Removed the call to reset_record in
9697
case where ! field0_valid. We want to leave the fields alone
9698
if they've been changed.
9694
Fixes cases where $0 is assigned to, e.g. by gsub, keeps
9696
(get_field): Removed the call to reset_record in
9697
case where ! field0_valid. We want to leave the fields alone
9698
if they've been changed.
9700
9700
Thu Jul 11 23:04:20 1996 Arnold D. Robbins <arnold@skeeve.atl.ga.us>
9702
9702
* io.c (devopen): Change tests of (flag & O_fooONLY) to
9703
(flag & O_ACCMODE) == O_fooONLY. Per (long standing) bug
9704
report from Chapman Flack.
9705
(close_redir): Change final conditional to just (status != 0)
9706
so that ERRNO always set; the warning had its own `if (do_lint)'
9703
(flag & O_ACCMODE) == O_fooONLY. Per (long standing) bug
9704
report from Chapman Flack.
9705
(close_redir): Change final conditional to just (status != 0)
9706
so that ERRNO always set; the warning had its own `if (do_lint)'
9708
9708
* eval.c (do_split): Force type of array to be Node_var_array
9709
instead of Node_var. Per (long standing) bug report from
9709
instead of Node_var. Per (long standing) bug report from
9712
9712
Thu Jul 11 22:17:14 1996 Arnold D. Robbins <arnold@skeeve.atl.ga.us>
9714
9714
* Makefile.in (install): Added symlink of gawk to awk if
9715
no awk in $(bindir).
9716
(LN_S): New variable for symlinking.
9717
(uninstall): Remove awk if it's the same gawk.
9715
no awk in $(bindir).
9716
(LN_S): New variable for symlinking.
9717
(uninstall): Remove awk if it's the same gawk.
9718
9718
* Configure.in: Added call to AC_PROG_LN_S for Makefile.in.
9720
9720
Sun Jul 7 15:47:13 1996 Arnold D. Robbins <arnold@infographix.com>
9722
9722
* main.c (main): Made `--posix' turn on interval expressions.
9723
Gawk now matches its documentation. (What a concept!)
9723
Gawk now matches its documentation. (What a concept!)
9725
9725
Wed Jul 3 15:02:48 1996 Arnold D. Robbins <arnold@infographix.com>
9729
9729
Fri May 17 08:46:07 1996 Arnold D. Robbins <arnold@skeeve.atl.ga.us>
9731
9731
* io.c (get_a_record): Added `continued' flag. Fix from
9732
Darrell Hankerson for when RS = "\n|something".
9732
Darrell Hankerson for when RS = "\n|something".
9734
9734
Wed May 15 02:34:55 1996 Arnold D. Robbins <arnold@skeeve.atl.ga.us>
9736
9736
* Makefile.in (awklib/all): Now depends on gawk, fixes problem
9739
9739
Tue May 14 15:02:52 1996 Arnold D. Robbins <arnold@skeeve.atl.ga.us>
9741
9741
* builtin.c (format_tree): Fix handling of '*' to deal with
9742
negative value for fieldwidth -- make positive and turn on
9743
left justify. Per bug report from Michael Brennan.
9742
negative value for fieldwidth -- make positive and turn on
9743
left justify. Per bug report from Michael Brennan.
9745
9745
Sun May 12 20:42:06 1996 Arnold D. Robbins <arnold@skeeve.atl.ga.us>
9747
9747
* eval.c (r_get_lhs): case Node_subscript. Check if array name
9748
is actually a function, fatal error if so.
9748
is actually a function, fatal error if so.
9750
9750
Sun May 5 10:11:52 1996 Arnold D. Robbins <arnold@skeeve.atl.ga.us>
9752
9752
* io.c (redirect): Call flush_io() before creating a new output pipe,
9753
per bug report from Brian Kernighan (bwk@research.bell-labs.com).
9753
per bug report from Brian Kernighan (bwk@research.bell-labs.com).
9755
9755
Fri Mar 15 06:38:33 1996 Arnold D. Robbins <arnold@skeeve.atl.ga.us>
9757
9757
* Makefile.in (install): Use $(INSTALL_PROGRAM), not $(INSTALL).
9758
(local-distclean): Add `*~' to list of files to be removed.
9759
(CFLAGS): Now contains just @CFLAGS@.
9760
(COMPFLAGS): Replaces use of CFLAGS, has CFLAGS plus all the
9758
(local-distclean): Add `*~' to list of files to be removed.
9759
(CFLAGS): Now contains just @CFLAGS@.
9760
(COMPFLAGS): Replaces use of CFLAGS, has CFLAGS plus all the
9763
9763
Wed Mar 13 14:19:38 1996 Arnold D. Robbins <arnold@skeeve.atl.ga.us>
9765
9765
* io.c (mmap_get_record): Fixed to not place sentinel at end
9766
of mmap'ed object. Won't work if file is exact multiple of
9767
disk block size. See comments in code for more info.
9768
Thanks to Rick Adams (rick@uunet.uu.net) for help in testing.
9766
of mmap'ed object. Won't work if file is exact multiple of
9767
disk block size. See comments in code for more info.
9768
Thanks to Rick Adams (rick@uunet.uu.net) for help in testing.
9770
9770
Sun Mar 10 22:50:23 1996 Arnold D. Robbins <arnold@skeeve.atl.ga.us>
9772
9772
* io.c (do_close): Notice if we were called as `close(FILENAME)'
9773
and arrange to close the current input file. This turns out
9774
to be easy to do, just call `nextfile(TRUE)'. Based on bug report
9775
from Pascal A. Dupuis, <dupuis@lei.ucl.ac.be>.
9773
and arrange to close the current input file. This turns out
9774
to be easy to do, just call `nextfile(TRUE)'. Based on bug report
9775
from Pascal A. Dupuis, <dupuis@lei.ucl.ac.be>.
9777
9777
Thu Mar 7 08:08:51 1996 Arnold D. Robbins <arnold@skeeve.atl.ga.us>
9779
9779
* field.c (init_fields, grow_fields, set_field, rebuild_record):
9780
Nuke the `nodes' array everywhere. Anytime a field is unref'ed,
9781
allocate a new node that is a copy of Nnull_string. This avoids
9782
subtle memory management problems when doing a lot of assignment
9783
to fields, and tweaking of NF. Make sure that fields_arr[0] always
9784
has a type of Node_val!
9780
Nuke the `nodes' array everywhere. Anytime a field is unref'ed,
9781
allocate a new node that is a copy of Nnull_string. This avoids
9782
subtle memory management problems when doing a lot of assignment
9783
to fields, and tweaking of NF. Make sure that fields_arr[0] always
9784
has a type of Node_val!
9785
9785
* field.c (set_NF): If NF is decremented, clear fields between
9786
NF and parse_high_water, otherwise if NF incremented, clear
9787
fields between parse_high_water and NF.
9786
NF and parse_high_water, otherwise if NF incremented, clear
9787
fields between parse_high_water and NF.
9788
9788
* eval.c (nodetype2str): New function, used for diagnostics.
9789
(interpret): Use nodetype2str when finding invalid node.
9789
(interpret): Use nodetype2str when finding invalid node.
9791
9791
Mon Mar 4 09:02:28 1996 Arnold D. Robbins <arnold@skeeve.atl.ga.us>
9793
9793
* builtin.c (do_toupper, do_tolower): Use isascii along with
9794
isupper/islower before changing case, in case characters have
9795
the high bit set. This is a hack.
9794
isupper/islower before changing case, in case characters have
9795
the high bit set. This is a hack.
9797
9797
Mon Feb 26 22:24:44 1996 Arnold D. Robbins <arnold@skeeve.atl.ga.us>
9799
9799
* builtin.c (sub_common): If no match, and called from gensub,
9800
don't free the temporary string, since the tmp_number then
9800
don't free the temporary string, since the tmp_number then
9803
9803
Sun Feb 25 23:13:01 1996 Arnold D. Robbins <arnold@skeeve.atl.ga.us>
9805
9805
* builtin.c (format_tree): Fixed %c to treat user input as
9806
numeric also by adding test for MAYBE_NUM.
9806
numeric also by adding test for MAYBE_NUM.
9808
9808
Tue Feb 20 12:25:50 1996 Arnold D. Robbins <arnold@skeeve.atl.ga.us>
9810
9810
* configure.in: Added AC_FUNC_MMAP call and add madvise to
9811
list of functions to look for.
9811
list of functions to look for.
9812
9812
* awk.h [IOP_ISMAPPED]: New flag value for mmap support and new
9813
`getrec' structure member in struct iobuf.
9813
`getrec' structure member in struct iobuf.
9814
9814
* io.c (iop_alloc, iop_close): Changed to map/unmap input file
9815
into memory if possible.
9816
(mmap_get_record): New function to actually retrieve the
9817
record from mmaped file.
9815
into memory if possible.
9816
(mmap_get_record): New function to actually retrieve the
9817
record from mmaped file.
9819
9819
Thu Feb 1 08:56:46 1996 Arnold D. Robbins <arnold@skeeve.atl.ga.us>
9821
9821
* builtin.c (do_substr): Fixed lint message to use indx+1 when
9822
start position is past end of string.
9822
start position is past end of string.
9824
9824
Sun Jan 28 07:00:56 1996 Arnold D. Robbins <arnold@skeeve.atl.ga.us>
9826
9826
* builtin.c (do_substr): Rationalized handling of missing length
9827
argument, as well as various accompanying lint warnings. Previous
9828
code was slightly bogus. Talk about your Day 1 bugs.
9827
argument, as well as various accompanying lint warnings. Previous
9828
code was slightly bogus. Talk about your Day 1 bugs.
9830
9830
Thu Jan 25 14:09:11 1996 Arnold D. Robbins <arnold@skeeve.atl.ga.us>
9832
9832
* builtin.c (do_substr): If length exceeds length of actual
9833
string, do computation of needed substring length *after*
9833
string, do computation of needed substring length *after*
9836
9836
Wed Jan 24 10:06:16 1996 Arnold D. Robbins <arnold@skeeve.atl.ga.us>
9838
9838
* Makefile.in (gawk): Add $(CFLAGS) to link line.
9839
(Makefile): Target depends on the Makefile.in files.
9840
(OTHERS): Added TAGS and tags to the distribution.
9841
(local-distclean): New rule.
9842
(distclean): Use it.
9843
(maintainer-clean): Don't `make distclean' before running submakes,
9844
since that removes makefiles needed for the submakes.
9839
(Makefile): Target depends on the Makefile.in files.
9840
(OTHERS): Added TAGS and tags to the distribution.
9841
(local-distclean): New rule.
9842
(distclean): Use it.
9843
(maintainer-clean): Don't `make distclean' before running submakes,
9844
since that removes makefiles needed for the submakes.
9845
9845
* builtin.c (do_strftime): Remove hard coded limit on length of result.
9846
Based on code from Paul Eggert (eggert@twinsun.com).
9846
Based on code from Paul Eggert (eggert@twinsun.com).
9848
9848
Mon Jan 22 13:16:37 1996 Arnold D. Robbins <arnold@skeeve.atl.ga.us>
9850
9850
* main.c (usage): Takes new fp parameter which is either
9851
stdout for `--help' (per the GNU Coding Standards) or stderr
9852
if an error occurs. Fix all calls.
9853
(version): Prints to stdout per the coding stds.
9854
(copyleft): Prints to stdout now, not stderr, and exits.
9851
stdout for `--help' (per the GNU Coding Standards) or stderr
9852
if an error occurs. Fix all calls.
9853
(version): Prints to stdout per the coding stds.
9854
(copyleft): Prints to stdout now, not stderr, and exits.
9856
9856
Fri Jan 19 08:10:29 1996 Arnold D. Robbins <arnold@skeeve.atl.ga.us>
9858
9858
* regex.h [RE_GNU_AWK]: Added RE_CONTEXT_INDEP_OPS to set of
9859
bits we turn off for regular operation. Breaks things like
9860
/^+[0-9]+/ to match a literal `+' at the beginning of, say,
9859
bits we turn off for regular operation. Breaks things like
9860
/^+[0-9]+/ to match a literal `+' at the beginning of, say,
9863
9863
Wed Jan 10 23:19:36 1996 Arnold D. Robbins <arnold@skeeve.atl.ga.us>