Introduced -devel and -extras subpackages for gawk
[platform/upstream/gawk.git] / ChangeLog.0
1 Mon Jun 20 20:33:26 2011  Arnold D. Robbins  <arnold@skeeve.com>
2
3         * dfa.c (dfaanalyze): Allocate the right number of leaves to
4         avoid crashes. Thanks to Jim Meyering.
5
6 Mon Jun 20 20:22:35 2011  Arnold D. Robbins  <arnold@skeeve.com>
7
8         * dfa.c (setbit_c, setbit_case_fold_c): Compare btowc result against
9         WEOF. Thanks to Eli Zaretskii for pointing out the problem.
10
11 Mon Jun 20 20:22:26 2011  Pat Rankin  <rankin@pactechdata.com>
12
13         * dfa.c (addtok_wc): enclose prototype within #if MBS_SUPPORT.
14
15 Fri Jun 17 11:09:22 2011  Arnold D. Robbins  <arnold@skeeve.com>
16
17         * Release 3.1.86: Final beta test tar ball for 4.0.
18
19 Fri Jun 17 10:55:27 2011  Arnold D. Robbins  <arnold@skeeve.com>
20
21         Implement Rational Range Interpretation (RRI) directly in code.
22
23         * regex.h [RE_RANGES_IGNORE_LOCALES]: Remove macro and its use.
24         * dfa.c (parse_bracket_exp): Remove use of RE_RANGES_IGNORE_LOCALES
25         and just do it in code.
26         (hard-locale.h): Remove include.
27         (hard_LC_COLLATE): Remove variable and its uses.
28         * re.c (resetup): Remove use of RE_RANGES_IGNORE_LOCALES.
29         * regcomp.c (build_range_exp): Remove use of RE_RANGES_IGNORE_LOCALES
30         and just do it in code. Remove cmp_buf array; it's no longer needed.
31         * Makefile.am (base_sources): Remove hard_locale.h and hard_locale.c.
32         * hard_locale.h, hard_locale.c: Removed from dist.
33
34 Sun Jun 12 23:43:06 2011  Arnold D. Robbins  <arnold@skeeve.com>
35
36         * re.c (resetup): Always turn on RE_RANGES_IGNORE_LOCALES.
37         Add justifying comment with URLs for the relevant portions of
38         POSIX. Thanks to Paul Eggert for pointing out the happy change
39         to the rules and supplying the URLs.
40
41 Wed Jun  8 22:41:30 2011  Arnold D. Robbins  <arnold@skeeve.com>
42
43         * regcomp.c (build_range_exp): Add check for RE_NO_EMPTY_RANGES
44         from GNULIB regcomp.c, courtesy of GNU grep.
45
46 Wed Jun  8 22:10:03 2011  Arnold D. Robbins  <arnold@skeeve.com>
47
48         * dfa.c: Sync with GNU grep.
49
50 Sun Jun  5 21:49:30 2011  Arnold D. Robbins  <arnold@skeeve.com>
51
52         * Release 3.1.85: Fourth beta test tar ball for 4.0.
53
54 Sun Jun  5 21:39:17 2011  Arnold D. Robbins  <arnold@skeeve.com>
55
56         * field.c (fpat_parse_field): Bug fix.  Thanks to
57         "Radoulov, Dimitre" <cichomitiko@gmail.com> for pointing
58         out the problem.
59
60 Fri Jun  3 10:39:17 2011  Arnold D. Robbins  <arnold@skeeve.com>
61
62         * regcomp.c (build_range_exp): Make syntax the first argument,
63         for compatibility with gnulib version of the file.
64
65 Wed Jun  1 06:29:27 2011  Pat Rankin  <rankin@pactechdata.com>
66
67         * re.c (check_bracket_exp): Fix typo.
68
69 Tue May 31 23:01:00 2011  John Haque      <j.eh@mchsi.com>
70
71         * re.c (check_bracket_exp): Use mem* routines instead of str*
72         for searching.
73         * main.c (arg_assign): Disallow builtin or user-defined function
74         as the name of a variable.
75         * awkgram.y (check_special): Rework so can be called from
76         arg_assign.
77
78 Tue May 31 22:23:41 2011  Arnold D. Robbins  <arnold@skeeve.com>
79
80         In order to attain the goal of having ranges act like they are
81         always in the C locale, bit the bullet and did the work in
82         the regex and dfa engines. The pre-processing routine was not
83         handling too many cases that a full regexp parser would catch.
84
85         * regex.h [RE_RANGES_IGNORE_LOCALES]: New syntax bit.
86         (RE_SYNTAX_GNU_AWK): Use it.
87         * dfa.c (parse_bracket_exp): If the RE_RANGES_IGNORE_LOCALES
88         is set, ignore locales when building a range.
89         * re.c (expand_range): Remove function and declaration.
90         (add_char): Remove function and declaration.
91         (make_regexp): Remove use of expand_range.
92         (resetup): Add RE_RANGES_IGNORE_LOCALES if --traditional.
93         * regcomp.c (build_range_exp): Add syntax variable as last argument.
94         Add code to check for RE_RANGES_IGNORE_LOCALES and do the right thing.
95         Adjust all calls.
96
97 Sun May 29 22:48:41 2011  Arnold D. Robbins  <arnold@skeeve.com>
98
99         * re.c (expand_range): Handle cases where expanded range
100         includes '\\' (and ']'). Thanks to Juergen Daubert <jue@jue.li>.
101         Fatal error if end point is below start point ([z-a]),
102         thanks to John Haque.  Don't repeat the last character in
103         the expansion. Thanks to Arnold Robbins.
104
105 Fri May 27 10:01:17 2011  Arnold D. Robbins  <arnold@skeeve.com>
106
107         * Release 3.1.84: Third beta test tar ball for 4.0.
108
109 Thu May 26 22:10:08 2011  Arnold D. Robbins  <arnold@skeeve.com>
110
111         * field.c (get_field): Enhance logic for setting NF if we're
112         using FPAT to parse fields. Can end up with weird cases. Thanks
113         to Pat Rankin for pointing them out.
114
115 Mon May 23 22:06:13 2011  Arnold D. Robbins  <arnold@skeeve.com>
116
117         * awkgram.y: Allow newline after comma in range patterns,
118         per POSIX.  Thanks to discussion in comp.lang.awk. (!!!)
119
120 Mon May 23 22:02:46 2011  John Haque      <j.eh@mchsi.com>
121
122         * ext.c (get_actual_argument): Change argument type from
123         Node_var_new to Node_var when used as a scalar.
124
125 Sun May 22 11:56:40 2011  Arnold D. Robbins  <arnold@skeeve.com>
126
127         * main.c (varinit): Give FPAT a reasonable default value.
128         * field (get_field): Adjust test for at end of record to >=;
129         fpat_parse_field can go beyond when matching null regexps.
130         Thanks to Pat Rankin.
131
132 Fri May 20 11:00:17 2011  Arnold D. Robbins  <arnold@skeeve.com>
133
134         * regex_internal.h (__attribute_warn_unused_result__): Always
135         ifdef out. Bleah.
136
137 Thu May 19 17:13:18 2011  Arnold D. Robbins  <arnold@skeeve.com>
138
139         * Release 3.1.83: Second beta test tar ball for 4.0.
140
141 Thu May 19 16:47:19 2011  Arnold D. Robbins  <arnold@skeeve.com>
142
143         * awkgram.y (dump_vars): Fix warning message. Thanks to Pat Rankin.
144         * main.c (usage): No space allowed after -d and -p. Also thanks
145         to Pat Rankin.
146
147 Thu May 19 16:34:04 2011  Pat Rankin  <rankin@pactechdata.com>
148
149         * regex_internal.h (__attribute_warn_unused_result__): Define with
150         empty expansion for !__GNUC__ configuration.
151
152 Wed May 18 22:13:18 2011  Arnold D. Robbins  <arnold@skeeve.com>
153
154         * Release 3.1.82: Beta test tar ball for 4.0, we hope!
155
156 Wed May 18 21:47:54 2011  Arnold D. Robbins  <arnold@skeeve.com>
157
158         * io.c (PIPES_SIMULATED): Simplify the case where PIPES_SIMULATED
159         is true but using temporary files - that code not needed anymore.
160         * regcomp.c, regex.h, regex_internal.c, regex_internal.h,
161         regexec.c: Sync with GLIBC. Why not.
162
163 Mon May 16 17:55:25 2011  Arnold D. Robbins  <arnold@skeeve.com>
164
165         * awkgram.c: Regenerated using bison 2.5.
166
167 Sat May 14 22:25:50 2011  Arnold D. Robbins  <arnold@skeeve.com>
168
169         * io.c (nextfile): Use `in_array' in main loop to see if element
170         of ARGV exists, instead of using `assoc_lookup'.  The latter creates
171         the element!  A day one bug!
172         * dfa.c (parse_bracket_exp): For z/OS init pattern manually.
173
174 Mon May  9 16:30:49 2011  Arnold D. Robbins  <arnold@skeeve.com>
175
176         * array.c (sort_up_value_type): Remove unused variable ret.
177         (do_delete): Initialize local variables to silence warnings.
178         Thanks to Michal Jaegermann.
179
180 Mon May  9 15:07:29 2011  Corinna Vinschen  <vinschen@redhat.com>
181
182         * awk.h: Remove cygwin code for libsigsegv.
183
184 Sun May  8 20:38:03 2011  John Haque      <j.eh@mchsi.com>
185
186         * eval.c (r_interpret): In case Op_sub_array, store only the
187         subarray index as 'vname'.
188         * array.c (make_aname): Redone for dynamic computation of
189         a subarray actual 'vname'.
190         (array_vname): Use make_aname() for (sub)array name.
191         (asort_actual): Performance optimization for asort(a).
192
193 Sun May  8 20:29:17 2011  Arnold D. Robbins  <arnold@skeeve.com>
194
195         * debug.c (print_array): Sort in order of string indices, per
196         request from John Haque.
197         * array.c (sort_up_value_number): Use string value to provide
198         ordering when numeric values are equal. Ensures that tests come
199         out OK on different systems.
200
201 Sun May  8 20:27:27 2011  Arnold D. Robbins  <arnold@skeeve.com>
202
203         * dfa.c: Sync with GNU grep.
204         * regex.h: Sync with GLIBC in preparation for submitting updates
205         back.
206
207 Thu May  5 21:22:44 2011  Arnold D. Robbins  <arnold@skeeve.com>
208
209         * eval.c (r_interpret): PROCINFO sorting only takes effect
210         if not do_posix.
211
212 Wed May  4 23:31:14 2011  Arnold D. Robbins  <arnold@skeeve.com>
213
214         Move array sorting to using predefined strings, add value sorting
215         by type of assignment.
216
217         * array.c (sort_up_value_type, sort_down_value_type): New routines.
218         (asort_actual): Pass string value to assoc_list, not NODE *.
219         Make sure indices of new arrays have numeric value set also.
220         (sort_up_value_number): Don't break the tie based on string value.
221         (sort_selection): Removed.
222         (assoc_list): Third arg is string constant. Add name to table of
223         functions. Linear search it.
224         * awk.h (assoc_list): Fix declaration.
225         * debug.c (print_array): And use of assoc_list.
226         * eval.c (r_interpret): Ditto.
227
228 Wed May  4 23:06:17 2011  John Haque      <j.eh@mchsi.com>
229
230         * eval.c (setup_frame): Handle a Node_var in stack. Fixes
231         a problem when a Node_var_new as param becomes Node_var during
232         expresssion evaluation for a subsequent param.
233
234 Wed May  4 23:04:06 2011  John Haque      <j.eh@mchsi.com>
235
236         Fix the problem (crash) with disappearing array argument when
237         it is a subarray of another deleted array argument.
238
239         * awk.h (struct exp_node): Nuke unused field sub.nodep.number.
240         New field sub.nodep.rn.
241         (parent_array): New definition for sub.nodep.rn to keep track
242         of the parent of a subarray.
243         * awkgram.y (mk_symbol): Initialize parent_array to NULL.
244         * eval.c (r_interpret): In the case Op_sub_array, assign
245         parent_array.
246         * array.c (get_array): Initialize parent_array to NULL when
247         a Node_var_new becomes a Node_var_array.
248         (assoc_find): Add a fourth argument for the previous node
249         of the returned bucket.
250         (in_array, assoc_lookup): Adjust calls to assoc_find().
251         (adjust_fcall_stack): New routine to change a soon-to-be deleted
252         subarray parameter in the function call stack to a local array.
253         (do_delete): Simplify code, remove recursive usage. Call
254         adjust_fcall_stack() where appropriate.
255         (do_delete_loop): Call adjust_fcall_stack() before clearing the
256         array.
257         (asort_actual): Don't accept an array and its subarray as
258         arguments for asort() or asorti().
259         (asort_actual, dup_table): For asort(), appropriately assign
260         parent_array when creating the result array.
261         * field.c (do_split, do_patsplit): An array and its subarray not
262         accepted for the second and the fourth arguments. Remove
263         unnecessary dupnode of the field seperator node.
264
265         Unrelated:
266         * awkgram.y (LEX_DELETE, simple_variable): Change type argument
267         from Node_var_array to Node_var_new for calls to variable().
268         * io.c (devopen): Fix parsing GAWK_MSEC_SLEEP env variable.
269
270 Mon May  2 23:44:34 2011  Arnold D. Robbins  <arnold@skeeve.com>
271
272         * dfa.c (parse_bracket_exp): Sync with GNU grep, since we
273         now require C 90, go ahead and put non-constant values into
274         the array initializers.
275
276 Mon May  2 23:37:09 2011  Corinna Vinschen  <vinschen@redhat.com>
277
278         * awk.h (small): Undef after include of <sigsegv.h> to compile
279         builtin.c on Cygwin.
280
281 Fri Apr 29 12:29:56 2011  Arnold D. Robbins  <arnold@skeeve.com>
282
283         * dfa.c: Sync with GNU grep, mainly typos in comments.
284
285 Fri Apr 29 12:13:32 2011  Arnold D. Robbins  <arnold@skeeve.com>
286
287         * io.c (inetfile): Change ifdef to ifndef for have getaddrinfo.
288         Ooops.
289
290 Fri Apr 29 11:49:38 2011  Arnold D. Robbins  <arnold@skeeve.com>
291
292         Per Pat Rankin, remove code related to GFMT_WORKAROUND and VAXCRTL.
293
294         * builtin.c (sgfmt): Nuked.
295         (format_tree): Removed code related to GFMT_WORKAROUND and VAXCRTL.
296         * node.c (format_val): Revise comment.
297
298 Fri Apr 29 11:33:08 2011  Arnold D. Robbins  <arnold@skeeve.com>
299
300         * awk.h (NUMIND): New flag, indicates numeric value of an
301         array index is current.
302         * array.c (awk_hash): Remove code for VAXC, it's no longer
303         needed. Per Pat Rankin.
304         (assoc_lookup): Only assign the numeric value if it's available.
305         (do_delete): Add comment about free_subs calling force_string.
306         (sort_force_index): Use NUMIND.
307
308 Fri Apr 29 10:15:24 2011  John Haque      <j.eh@mchsi.com>
309
310         * builtin.c: Relocate all codes from awkprintf.h. Restore
311         format_tree.
312         * debug.c (do_print_f): Adjust appropriately. Install fatal trap
313         for format_tree.
314         * Makefile.am (base_sources): Remove awkprintf.h.
315
316         * array.c (assoc_list): Avoid possible crash; Remove unneeded
317         initialization of pre_func.
318
319 Wed Apr 27 22:31:23 2011  Arnold D. Robbins  <arnold@skeeve.com>
320
321         * awk.h (ahash_dupnode): Merged into dupnode in node.c, change uses.
322         * array.c (ahash_unref): Merged into unref in node.c, change all uses.
323         * node.c (dupnode): Revised to support Node_ahash.
324         (unref): Ditto.
325
326         Lots of code clean up in array.c:
327
328         * array.c (AVG_CHAIN_MAX): Made unsigned.
329         (array_init): Use strtoul to convert value instead of doing it
330         manually.
331         (array_vname): Nuke code that could limit length of name. It
332         was never used.
333         (concat_exp): Make len unsigned, clean up the calculation.
334         (assoc_lookup): Set ahname_num in the index at time of element
335         creation.
336         (dup_table): Copy ahname_num also.
337         Other minor cleanups after code review.
338
339 Sun Apr 24 15:39:19 2011  Arnold D. Robbins  <arnold@skeeve.com>
340
341         * NEWS.0: Moved all pre-4.0 news to here.
342         * NEWS: Shortened.
343         * Makefile.am (EXTRA_DIST): Add NEWS.0.
344
345 Sun Apr 24 12:43:49 2011  John Haque      <j.eh@mchsi.com>
346
347         * array.c (sort_user_func): Fix return value to match the
348         documentaion.
349         (sort_selection): Make user-specified comparison function with
350         the same name override default "unsorted" specification.
351
352 Fri Apr 22 16:05:27 2011  John Haque      <j.eh@mchsi.com>
353
354         * array.c (sort_user_func): New routine to handle user-defined
355         quicksort comparison function.
356         (assoc_list): Adjust for user-defined comparison function.
357
358 Fri Apr 22 09:18:16 2011  Arnold D. Robbins  <arnold@skeeve.com>
359
360         * array.c (awk_hash): Force results into 32 bits for consistency
361         across platforms. Keeps the test suite happy. This may turn out
362         to be a bad idea in the long run.
363
364 Mon Apr 18 10:18:26 2011  John Haque      <j.eh@mchsi.com>
365
366         * array.c (assoc_list): New function to construct, and optionally
367         sort, a list of array elements.
368         (asort_actual): Use the new function to sort array elements.
369         (assoc_sort_inplace, assoc_from_list, merge_sort, merge): Nuked.
370         (sort_selection): Simplify handling of error and warning messages.
371         (sorted_in, sort_match): Nuked, related code in sort_selection() and
372         assoc_list().
373         (sort_ignorecase, sort_up_index_ignrcase, sort_down_index_ignrcase,
374         sort_maybe_numeric_index, sort_cmp_nodes, cmp_func, sort_up_value,
375         sort_down_value): Nuked. Ignorecase handling done in the corresponding
376         non-ignorecase versions.
377         (cmp_string): New routine for string comparisons.
378         (sort_up_value_string, sort_down_value_string, sort_up_value_number,
379         sort_down_value_number, sort_force_index_number,
380         sort_force_value_number, sort_force_value_string): New routines.
381         * awk.h (struct exp_node): New field sub.hash.num to store the
382         numeric value of an array index.
383         (ahname_num): New define.
384         (SORT_CTXT): New typedef.
385         * awkgram.y (tokentab): Accept three args for asort() and asorti().
386         (snode): Adjust for the extra args.
387         * eval.c (r_interpret): In case Op_arrayfor_init, call assoc_list()
388         for a list of array elements.
389         * debug.c (print_array): Call assoc_list() for a sorted list of array
390         elements.
391
392 Wed Apr 13 10:17:37 2011  John Haque      <j.eh@mchsi.com>
393
394         * builtin.c (do_strftime): Make the third argument to strftime
395         really work.
396         * io.c (redirect): Do not free `rp' after failure to open socket
397         in redirect_twoway. Fixes a double-free memory error.
398
399 Thu Apr  7 21:38:08 2011  Arnold D. Robbins  <arnold@skeeve.com>
400
401         * array.c (merge): Use sort_cmp_nodes for asort/asorti.
402         See test/arraysort.awk test 1.
403
404 Thu Apr  7 10:48:21 2011  Pat Rankin  <rankin@patechdata.com>
405
406         * array.c (sort_cmp_nodes): New routine. Unlike cmp_nodes, numbers
407         are less than strings instead of being formatted and then compared.
408         (sort_up_value): Use it.
409
410 Sun Apr  3 22:18:26 2011  Arnold D. Robbins  <arnold@skeeve.com>
411
412         * README, FUTURE: Minor edits.
413
414 Fri Apr  1 11:53:54 2011  Pat Rankin  <rankin@patechdata.com>
415
416         * array.c (sort_up_index_number): Fix the NODE arguments passed to
417         sort_up_index_string() when a tie breaker is needed.
418
419 Fri Apr  1 11:49:17 2011  Arnold D. Robbins  <arnold@skeeve.com>
420
421         Change ISATTY macro to os_isatty function.
422
423         * awk.h (ISATTY): Remove definition.
424         (os_isatty): Add declaration.
425         * debug.c, io.c, main.c: Change all calls.
426
427 Thu Mar 31 22:57:36 2011  Arnold D. Robbins  <arnold@skeeve.com>
428
429         * Checklist: Updated. This is a git-only file.
430         * POSIX.STD: Revised some.
431
432 Tue Mar 29 20:52:38 2011  John Haque      <j.eh@mchsi.com>
433
434         * awkgram.y (LEXT_NEXT): Don't issue an error message if the next
435         statement is in a function (rule = 0).
436
437         Always resolve the jump target for an exit statement at run-time.
438         This fixes a bug when the statement occurs in a function.
439
440         * awk.h: New defines target_atexit and target_end.
441         * awkgram.y (LEX_EXIT): Initilize the jump targets.
442         * eval.c (r_interpret): Use current rule to choose the jump target
443         for Op_K_exit.
444         * debug.c (print_instruction): Adjust case Op_K_exit.
445
446 Tue Mar 29 20:45:49 2011  Pat Rankin  <rankin@patechdata.com>
447
448         Move the code to support sorting `for (index in array)' from
449         eval.c to array.c, and implement several additional orderings.
450
451         * array.c (comp_func, sorted_in, sort_ignorecase,
452         sort_up_index_ignrcase, sort_down_index_ignrcase): Move from eval.c.
453         (sort_up_index_string, sort_down_index_string): Move from eval.c
454         and rename from *_str to *_string.
455         (sort_selection, sort_match, sort_maybe_numeric_index,
456         sort_up_index_number, sort_down_index_number,
457         sort_up_value, sort_down_value): New routines.
458         * eval.c (sort_&c): Move to array.c.
459         (r_interpret: case Op_arrayfor_init): Call sort_maybe_numeric_index
460         before and after qsort.
461         * awk.h (qsort_compfunc): New typedef.
462         (sorted_in, sort_maybe_numeric_index): Declare.
463
464 Fri Mar 25 13:15:36 2011  Arnold D. Robbins  <arnold@skeeve.com>
465
466         * awk.h: Move libsigsegv portability checks to here from main.c.
467         * eval.c (fcall_list, fcall_count): Move definitions to here
468         from main.c.
469         * io.c (do_find_source): Check against NULL in for loop.
470         * main.c: Lots of cleanup. Move some things out to other files,
471         add comments to some variable definitions.
472         (enum asgntype): To assign_type
473         (main): Remove decls of getopt variables, clean up comments.
474         Use emalloc and efree for libsigsegv stack. Remove check for SCCS
475         leading magic characters.
476         (add_preassign): Change allocassigns to alloc_assigns.
477         (init_locale): Change strdup calls to estrdup.
478         (save_argv): Make the routine static.
479         * version.in (version_string): Remove leading 4 SCCS magic characters.
480
481 Wed Mar  2 08:15:02 2011  John Haque      <j.eh@mchsi.com>
482
483         * array.c (asort_actual): Handle the case when the same array
484         is used as the source and destination.
485         * field.c (do_split): Make it fatal if attempting to use the same
486         array for both second and fourth arguments. 
487         (do_patsplit): Ditto.
488
489 Sun Feb 27 08:01:04 2011  Arnold D. Robbins  <arnold@skeeve.com>
490
491         Update copryright in all relevant files.
492
493 Sat Feb 26 21:54:07 2011  Arnold D. Robbins  <arnold@skeeve.com>
494
495         * eval.c (sorted_in): Revise text of lint warning.
496
497 Fri Feb 25 17:34:14 2011  Pat Rankin  <rankin@patechdata.com>
498
499         * eval.c (sorted_in): Remove incorrect unref() call.
500
501 Wed Feb 23 21:48:20 2011  Arnold D. Robbins  <arnold@skeeve.com>
502
503         * main.c (main): Free extra_stack, to make valgrind happier.
504
505 Tue Feb 22 12:04:09 2011  Arnold D. Robbins  <arnold@skeeve.com>
506
507         * main.c (UPDATE_YEAR): Move to 2011. Fix copyright.
508
509 Tue Feb 15 17:11:26 2011  Pat Rankin  <rankin@pactechdata.com>
510
511         * eval.c (sorted_in, sort_up_index_str, sort_down_index_str,
512         sort_up_index_ignrcase, sort_down_index_ignrcase, sort_ignorecase):
513         New functions to sort arrays for `for (index in array)' statements.
514         (r_interpret: case Op_arrayfor_init): Call sorted_in().
515
516 Wed Feb 16 07:12:50 2011  John Haque  <j.eh@mchsi.com>
517
518         Fix line numbers in the lint, warning and error messages issued
519         by the parser.
520
521         * awkgram.y (lintwarn_ln, warning_ln, error_ln): New local versions,
522         each accepts an additional line number argument.
523         (print_included_from): New function to seperate 'Included from ..'
524         message from yyerror. Use it in yyerror, and in the new functions.
525         (grammar): Use the local versions for messages.
526         (add_srcfile, include_source, dup_parms, func_install, param_sanity,
527         mk_binary, add_lint): Ditto.
528         (dup_params, include_source): Adjust arguments to pass line number.
529         * awk.h: New definition ATTRIBUTE_PRINTF_2.
530
531         * awkgram.y (yylex): New variable warntab. Use it to issue only one
532         warning for the same non-standard special token in source.
533         (parse_program): Avoid spurious warnings. Don't call check_funcs if
534         yyparse aborts prematurely.
535
536 Mon Feb 14 08:03:41 2011  John Haque  <j.eh@mchsi.com>
537
538         * awkgram.y (regexp): Don't use tokstart in lint warning, it isn't
539         `\0' terminated.
540         (grammar): Copy update and assign routines from relevant variables into
541         instructions to avoid extra pointer dereferencing at run-time.
542         * awk.h (update_var, assign_var): new definitions.
543         * eval.c (r_interpret): Adjust cases Op_var_assign and Op_var_update.
544
545 Sun Feb 13 20:22:47 2011  Eli Zaretskii  <eliz@gnu.org>
546
547         * awkgram.y (add_srcfile):
548         * debug.c (source_find): Pass `path' and `src' to files_are_same.
549         * gawkmisc.c [__DJGPP__ || __MINGW32__]: Include pc/gawkmisc.pc,
550         for consistency with __EMX__ and pc/Makefile.
551         * debug.c (interpret, initialize_pager, prompt_continue)
552         (set_gawk_output): Use ISATTY instead of isatty.
553         * io.c (redirect, iop_alloc): Same.
554         * main.c (main): Same.
555         * awk.h (ISATTY): Trivial definition, if not defined elsewhere.
556
557 Sun Feb 13 20:16:04 2011  Arnold D. Robbins  <arnold@skeeve.com>
558
559         * awkgram.y (check_funcs): Update warning about never called to say
560         "never called directly" since it could be called indirectly.
561
562 Sun Feb 13 07:12:50 2011  John Haque  <j.eh@mchsi.com>
563
564         * profile.c (pprint): In case Op_indirect_func_call, pop off
565         indirect var after function parameters.
566         Thanks to Hermann Peifer <peifer@gmx.eu> for the bug report.
567         * array.c (do_delete): Always free an empty sub-array name and node.
568         * ChangeLog: Fix typos. 
569
570 Fri Feb 11 10:26:25 2011  Arnold D. Robbins  <arnold@skeeve.com>
571
572         * io.c (remad_std_file): Close oldfd first, in case we've
573         run out of fd and do dup2 if the newfd isn't what we were
574         looking for.  Thanks to Hermann Peifer <peifer@gmx.eu> for
575         the bug report.
576
577 Thu Feb 10 21:31:36 2011  Andreas Buening    <andreas.buening@nexgo.de>
578
579         * main.c (load_procinfo): Fix warning about unsed variables if we
580         don't have multiple groups.
581         * protos.h: Move decls for many standard functions here if
582         they aren't in the header files (OS/2) and bracket inside
583         #ifndef STDC_HEADERS.
584         * io.c (devopen): Remove decl of strtoul.
585         * field.c (set_FIELDWIDTHS): Same.
586         * awk.h: Always include protos.h.
587
588 Tue Feb  8 22:46:22 2011  Arnold D. Robbins  <arnold@skeeve.com>
589
590         * array.c, builtin.c, eval.c: Equalize message strings and
591         fix a typo. Thanks to Benno Schulenberg <bensberg@justemail.net>.
592
593 Mon Feb  7 11:23:33 2011  Arnold D. Robbins  <arnold@skeeve.com>
594
595         * awkgram.y (next_sourcefile): Comment out assertion that
596         lexeof is true; causes core dump on user typos of bad
597         characters which previous versions did not do. Thanks to
598         Pat Rankin for the report.
599
600         * re.c (expand_range): Allow for ^ as first character
601         inside range. Thanks for Nelson Beebe for the bug report.
602
603 Fri Feb  4 10:28:19 2011  Arnold D. Robbins  <arnold@skeeve.com>
604
605         * README.cvs: Udpated.
606         * Checklist: New file for storage in the git repository.
607
608 Wed Feb  2 20:34:41 2011  Corinna Vinschen  <vinschen@redhat.com>
609
610         * awkgram.y (free_bc_internal): Remove unused variable.
611
612 Tue Feb  1 23:13:10 2011  Arnold D. Robbins  <arnold@skeeve.com>
613
614         * bootstrap.sh: No need to find aclocal.m4, just touch it.
615
616 Tue Feb  1 23:05:51 2011  Corinna Vinschen  <vinschen@redhat.com>
617
618         Make values of ctype macros into unsigned char to fix
619         warnings found on Cygwin / Newlib.
620
621         * array.c (array_init): Add cast.
622         * awkgram.y: Ditto.
623         * awkprintf.h: Ditto.
624         * builtin.c (sub_common, nondec2awknum): Ditto.
625         * command.y: Ditto.
626         * eval.c (fmt_ok): Ditto.
627         * ext.c (make_builtin): Ditto.
628         * main.c (main, arg_assign): Ditto.
629         * re.c (check_bracket_exp): Ditto.
630         * node.c (r_force_number, parse_escape): Ditto.
631         (dump_wstr): Add unused attribute (unrelated).
632
633 Tue Feb  1 23:01:40 2011  John Haque  <j.eh@mchsi.com>
634
635         Fix switch debugging.
636
637         * awkgram.y (LEX_SWITCH, case_statements, case_statement,
638         case_value): Linearize instructions to facilitate debugging.
639         (switch_body): Removed.
640         (yylex): Add LEX_CASE in special token processing.
641         (free_bc_internal): Remove case Op_K_switch.
642         * awk.h (OPCODE): Remove opcode Op_case_list.
643         * eval.c (r_interpret): Remove Op_K_switch. Add case
644         Op_K_case to handle switch.
645         Add cases Op_K_do, Op_K_while, Op_K_for, Op_K_arrayfor, Op_K_switch
646         and Op_K_default as no-ops, needed for pgawk.
647         * debug.c (print_instruction): Remove case Op_K_switch,
648         add case Op_K_case instead.
649
650         Unrelated:
651         * awkgram.y (case_statements): As case values, "abc" and /abc/
652         no longer considered as duplicates.
653
654         Cleanup grammar and run-time code for switch and loops.
655         Jump targets for break and continue are now fixed, and known
656         at parse time. See ChangeLog entry dated Oct 21, 2010.
657
658         * awk.h (OPCODE): Remove Op_push_loop and Op_pop_loop.
659         (loop_count): Remove definition.
660         * awkgram.y (fix_break_continue): Change calling parameters to
661         instruction list, break and continue targets. Adjust code.
662         (LEX_DO, LEX_WHILE, LEX_SWITCH, LEX_FOR): Simplify grammar. Use
663         Op_no_op as target for break. Adjust call to fix_break_continue.
664         (mk_for_loop): Ditto.
665         * eval.c (r_interpret): Nuke cases Op_push_loop and Op_pop_loop.
666         Simplify Op_K_break and Op_K_continue. Remove declaration of in_loop
667         and all loop detection code thereof.
668         * debug.c (pre_execute, post_execute): Adjust declarations and code.
669         (print_instruction): Nuke cases Op_push_loop and Op_pop_loop.
670         * eval.c (r_interpret): Adjust calls to pre_execute and post_execute. 
671         * profile.c (pprint): Adjust cases Op_K_for, Op_K_do, Op_K_while,
672         Op_K_switch and Op_K_arrayfor. Add cases Op_K_case and Op_K_default.
673         Remove Op_push_loop and Op_pop_loop.
674
675         Unrelated cleanup:
676         * awkgram.y (mk_condition): Don't include Op_K_if, Op_K_else and
677         Op_cond_exp if not profiling.
678
679 Tue Feb  1 10:20:02 2011  Arnold D. Robbins  <arnold@skeeve.com>
680
681         * eval.c (r_interpret): Change magic string for array sorting.
682
683 Sun Jan 30 21:49:53 2011  John Haque  <j.eh@mchsi.com>
684
685         Add `isarray' built-in function.
686
687         * awk.h (enum opcodeval): Op_push_arg: new opcode.
688         (do_isarray): Add declaration.
689         * awkgram.y (tokentab): Add new entry for `isarray' function.
690         (snode): Add handling for it.
691         * builtin.c (do_isarray): New function.
692         (do_length): Die if posix and get an array argument.
693         * debug.c (print_instruction): Handle Op_push_arg.
694         * profile.c (pprint): Likewise.
695         * eval.c (optypes, r_interpret): Likewise.
696
697 Sun Jan 30 21:13:01 2011  Arnold D. Robbins  <arnold@skeeve.com>
698
699         * hard-locale.h: Synced to GNU grep.
700         * hard-locale.c: New file, brought in from GNU grep.
701         * Makefile.am (base_sources): Add hard-locale.c.
702         * dfa.h: Sync as much as possible to GNU grep.
703         * dfa.c: Sync as much as possible to GNU grep.
704         * builtin.c (do_strftime): Remove unneeded variable.
705
706 Thu Jan 27 22:52:54 2011  Arnold D. Robbins  <arnold@skeeve.com>
707
708         * awk.h (comp_func): Add declaration.
709         * debug.c (comp_func): Make not static, and move to ...
710         * eval.c (comp_func): ... here.
711         (r_interpret): Add array sorting if magic index is
712         set in PROCINFO.
713
714 Thu Jan 27 22:12:00 2011  Corinna Vinschen  <vinschen@redhat.com>
715
716         * Makefile.am: Remove $(EXEEXT) from 'awk' symlink.
717
718 Thu Jan 27 21:21:13 2011  John Haque  <j.eh@mchsi.com>
719
720         * eval.c (r_interpret): When in BEGINFILE or ENDFILE, add check for
721         `getline var < file' in cases Op_K_getline_redir and Op_K_getline.
722
723         * awkgram.y (constant_fold): Code cleanups. Fix bug in the code for
724         string concatenation.
725
726         * configure.ac: Remove unneeded extra call to AC_LANG.
727
728 Thu Jan 27 15:00:42 2011  Arnold D. Robbins  <arnold@skeeve.com>
729
730         * eval.c: Fix up some comments.
731         * io.c (remap_std_file): New function.
732         (iop_close): Use it.
733
734 Mon Jan 24 22:14:21 2011  Andreas Buening    <andreas.buening@nexgo.de>
735
736         * debug.c: Bracket variables used with readline in #ifdef.
737         * dfa.c (add_utf8_anychar): Move inside ifdef.
738
739 Mon Jan 24 22:05:26 2011  Arnold D. Robbins  <arnold@skeeve.com>
740
741         * re.c (make_regexp): Add separate variable for dfa syntax.
742         General formatting cleanup.
743         (research): General formatting cleanup.
744         (refree): Remove out of date comment.
745         (re_update): Comment the routine.
746         (check_bracket_exp): Improve check for range to not get [^-/]
747         kinds of things. Thanks to Nelson Beebe for pointing out the bug.
748
749 Wed Jan 19 20:31:17 2011  Arnold D. Robbins  <arnold@skeeve.com>
750
751         * awk.h (is_valid_character): Add `& 0XFF' and remove casts to
752         unsigned chars in other files. Remove definition of this macro
753         in not MBS_SUPPORT case, since it wasn't being used.
754         (btowc_cache): New macro to index into the array and use the
755         same trick. Relies on ANSI C preprocessor semantics.
756         Fix all uses.
757         * builtin.c, node.c, io.c: Fix uses of these macros.
758
759 Wed Jan 19 20:19:29 2011  Arnold D. Robbins  <arnold@skeeve.com>
760
761         * node.c (wstr2str): New function.
762         * awk.h: Declare it.
763         * builtin.c (is_wupper, is_wlower, to_wupper, to_wlower,
764         wide_change_case, wide_tolower, wide_toupper): New functions to
765         simplify wide character case conversions.
766         (do_tolower, do_toupper): Use wide_tolower, wide_toupper in multibyte
767         case.
768         (do_substr): Simplify code a little bit.
769
770 Mon Jan 17 22:48:48 2011  Arnold D. Robbins  <arnold@skeeve.com>
771
772         * builtin.c (do_bindtextdomain): Change type of `the_result'
773         to const char* to kill compiler warnings.
774         * debug.c (source_find): Improve error message when file not
775         found.
776         * awkgram.y (get_src_buf): Add cast to value of `read' to
777         turn off compiler warnings on different systems.
778
779 Mon Jan 10 21:40:05 2011  Andreas Buening    <andreas.buening@nexgo.de>
780
781         * io.c (devopen): Handle opening of directories for OS/2.
782
783 Mon Jan 10 21:37:49 2011  Arnold D. Robbins  <arnold@skeeve.com>
784
785         * awk.h: Rearrange includes of <fcntl.h> so it won't be
786         included for VMS, move definition of O_BINARY down.
787
788 Sat Jan  8 23:00:37 2011  Arnold D. Robbins  <arnold@skeeve.com>
789
790         * awk.h: Include <fcntl.h> here.
791         * main.c, io.c: Remove includes of <fcntl.h>.
792
793 2011-01-08  Eli Zaretskii  <eliz@gnu.org>
794
795         * io.c (PIPES_SIMULATED) [__DJGPP__ || __MINGW32__]: Define.
796         (binmode): Define for __DJGPP__ and __MINGW32__ as well.
797         (gawk_popen) [!PIPES_SIMULATED]: Define for __DJGPP__ and
798         __MINGW32__ as well.
799
800 Wed Jan  5 20:35:30 2011  Arnold D. Robbins  <arnold@skeeve.com>
801
802         * configure.ac: Move call to AC_LANG([C]) into here from
803         m4/readline.m4.
804
805 Tue Jan  4 11:21:18 2011  Arnold D. Robbins  <arnold@skeeve.com>
806
807         Clean up some compiler warnings:
808
809         * array.c (do_delete): Cast for printf.
810         * builtin.c (do_bindtextdomain): Casts for const char *.
811         * io.c (rs1scan): Cast for indexing of array.
812         * re.c (add_char): Remove unused variables.
813
814 Fri Dec 31 11:05:11 2010  Michal Jaegermann  <michal@harddata.com>
815
816         * awk.h (strncasecmpmbs): Change parameters to const char *.
817         * builtin.c (strncasecmpmbs): Change parameters to const char *.
818         Add casts as appropriate in calls to other functions.
819         * eval.c (cmp_nodes): Add casts in calls to strncasecmpmbs.
820         * node.c (str2wstr): Ditto.
821
822 Tue Dec 28 21:13:31 2010  Eli Zaretskii  <eliz@gnu.org>
823
824         * gawkmisc.c: Restore inclusion of pc/gawkmisc.pc.
825
826 Tue Dec 28 21:00:36 2010  Arnold D. Robbins  <arnold@skeeve.com>
827
828         * ext.c (make_builtin): Make first parameter const char *.
829         Adjust code inside to fit.
830         * awk.h (make_builtin): Adjust declaration.
831
832 Mon Dec 27 19:55:10 2010  Arnold D. Robbins  <arnold@skeeve.com>
833
834         * io.c [AF_UNSPEC, AF_INET, AF_INET6]: Add definitions for systems
835         that don't define them.
836         (inetfile): Make IPv6 a fatal error if using the fake getaddrinfo,
837         since chances are good that IPv6 really isn't available.
838
839 Sat Dec 25 19:36:27 2010  Arnold D. Robbins  <arnold@skeeve.com>
840
841         Fixes for z/OS.
842
843         * awkgram.y (tokcompare): Change argument types to const void *.
844         (check_special): Add cast to void * in call to qsort.
845         * builtin.c (do_bindtextdomain): Change `directory' and `domain'
846         to const char *.
847         * custom.h (ZOS_USS): Undef HAVE_SYS_PARAM_H and HAVE_MCHECK_H.
848         Beats me why configure thinks it has those things.
849
850 Fri Dec 24 12:56:46 2010  Arnold D. Robbins  <arnold@skeeve.com>
851
852         * custom.h: Remove defs for MIPS RiscOS.
853         * configure.ac, aclocal.m4: Updated to Autoconf 2.68.
854
855 Wed Dec 22 21:21:28 2010  Arnold D. Robbins  <arnold@skeeve.com>
856
857         * gettext.h: Synchronized with gettext 0.18.1.
858
859 2010-12-22  gettextize  <bug-gnu-gettext@gnu.org>
860
861         * configure.ac (AM_GNU_GETTEXT_VERSION): Bump to 0.18.1.
862         * ABOUT-NLS, config.rpath: Updated from gettext 0.18.1.
863
864 Sun Dec 19 16:43:14 2010  Arnold D. Robbins  <arnold@skeeve.com>
865
866         * awk.h (update_PROCINFO_str, update_PROCINFO_num, make_str_node):
867         Change `char *' parameters to `const char *' to avoid some
868         compiler warnings.
869         * ext.c (do_ext): Remove cast in call to make_string.
870         * field.c (update_PROCINFO_str, update_PROCINFO_num): Adjust. 
871         * main.c (init_args): Remove casts in calls to make_string.
872         * node.c (r_make_str_node): Add cast in assignment if ALREADY_MALLOCED.
873
874 Sat Dec 18 20:12:59 2010  Eli Zaretskii  <eliz@gnu.org>
875
876         * array.c, gawkmisc.c, io.c, main.c, regex_internal.h,
877         awkgram.y, awk.h, array.c: Remove OS2 and _MSC_VER defines.
878
879 Sat Dec 18 19:56:17 2010  Arnold D. Robbins  <arnold@skeeve.com>
880
881         * builtin.c, eval.c, floatcomp.c, io.c: Remove all the crufty
882         old code for #ifdef CRAY.
883
884 Thu Dec 16 11:06:50 2010  Arnold D. Robbins  <arnold@skeeve.com>
885
886         Put strftime() default format into PROCINFO["strftime"].
887
888         * awk.h (def_strftime_format): Declare const char[] array.
889         * main.c (def_strftime_format): Define it.
890         (load_procinfo): Load it into PROCINFO.
891         * builtin.c (do_strftime): Use value in PROCINFO for format
892         string if it's there. Remove old def_format static array.
893
894 Mon Dec 13 17:12:44 2010  Arnold D. Robbins  <arnold@skeeve.com>
895
896         If not POSIX, turn [d-h] into [defgh].
897
898         * re.c (check_bracket_exp): Make warning about ranges under
899         lint control.
900         (expand_range): New routine to expand ranges.
901         (make_regexp): Check if might have range and call expand_range.
902         (add_char): New helper function for expand_range.
903
904 Thu Dec  9 22:12:48 2010  Arnold D. Robbins  <arnold@skeeve.com>
905
906         * io.c: Restored changes of 1 July 2010 to allow /inet4 and /inet6;
907         they got lost amongst the merges. Fixed checking of do_sandbox.
908         Also, removed the option for raw IP sockets since it was never
909         implemented and wasn't going to be.
910
911 Tue Dec  7 11:59:00 2010  Arnold D. Robbins  <arnold@skeeve.com>
912
913         * configure.ac: Remove test for return type of sprintf. Another
914         renegade from the late 1980's bites the dust!
915         * protos.h (sprintf): Remove declaration.
916
917 Sun Dec  5 15:01:35 2010  Arnold D. Robbins  <arnold@skeeve.com>
918
919         * eval.c (grow_stack): Change env var to GAWK_STACKSIZE.
920         * awk.h, main.c, eval.c, profile.c: Removed features added
921         for those who are Strong In The Ways of the Source.
922         * debug.c (comp_func): Moved to here from eval.c, where it's
923         no longer needed.
924
925 Sat Dec  4 21:44:38 2010  Arnold D. Robbins  <arnold@skeeve.com>
926
927         * node.c (init_btowc_cache): New function.
928         (btowc_cache): New array.
929         (str2wstr): Use is_valid_character in test instead of several isXXX
930         calls.
931         * awk.h [is_valid_character]: Macro to use btowc_cache.
932         * main.c (main): Call init_btowc_cache().
933         * io.c (rs1scan): Add call to is_valid_character when processing
934         characters byte by byte.
935
936 Wed Dec  1 08:10:21 2010  Arnold D. Robbins  <arnold@skeeve.com>
937
938         * awk.h, awkgram.y, debug.c: Change CONTEXT to AWK_CONTEXT
939         everywhere to avoid problems with libsigsegv on cygwin.
940
941 Tue Nov 30 13:48:34 2010  Arnold D. Robbins  <arnold@skeeve.com>
942
943         * main.c (MRL): Removed variable, not used since Tandem code nuked.
944         (main): Fix argument parsing for -m.
945         (usage): Make -m undocumented (already is the doc/* files).
946         * io.c (MRL): Remove declaration.
947
948 Mon Nov 29 21:59:21 2010  Arnold D. Robbins  <arnold@skeeve.com>
949
950         * re.c (check_bracket_exp): Add check and warning for ranges.
951         I may live to regret this.
952
953 Mon Nov 29 20:09:18 2010  Eli Zaretskii  <eliz@gnu.org>
954
955         * replace.c [!HAVE_STRFTIME]: For __MINGW32__, define
956         HAVE_STRFTIME while compiling missing_d/strftime.c.
957
958 Thu Nov 25 20:12:28 2010  John Haque          <j.eh@mchsi.com>
959
960         * awkgram.y (grammar): Bug fix in delete for loop efficiency hack.
961         * debug.c (do_info): Don't sort functions to avoid potential memory leak
962         in case A_FUNCTIONS.
963
964         Plug more potential leaks in the debugger eval/condition commands:
965         * builtin.c (POP_TWO_SCALARS): New macro to free first scalar in case
966         of a fatal error in the next.
967         (do_index, do_atan2, do_lshift, do_rshift, do_and, do_or, do_xor):  Use it
968         instead of two consecutive POP_SCALARs.
969
970         Execution context related code cleanups. Also, added descriptive
971         comments for functions.
972         * awkgram.y (get_context): Nuked. 
973         (push_context, pop_context, in_main_context): New functions.
974         (mk_program, parse_program, yylex): Updated.
975         * debug.c (condition_triggered, do_eval, parse_condition): Updated.
976         * eval.c (unwind_stack): Updated.
977         * main.c (main): Updated.
978         * awk.h (struct context): Removed member level, not needed.
979
980         * eval.c (op_assign): Initialize r to NULL, and declare x only
981         if HAVE_FMOD not defined to remove GCC warnings.
982
983 Thu Nov 25 08:32:31 2010  Arnold D. Robbins  <arnold@skeeve.com>
984
985         * eval.c (posix_compare): Do string comparison with strcoll() /
986         wcscoll().
987         (cmp_nodes): Call it if do_posix.  This may be a bad idea,
988         but what the heck.  Standards compatibility uber alles!
989
990 Wed Nov 24 20:09:23 2010  Arnold D. Robbins  <arnold@skeeve.com>
991
992         * ext.c (do_ext): Require definition of `plugin_is_GPL_compatible'
993         per GNU Coding standards.
994
995 Sun Nov 21 14:23:58 2010  John Haque          <j.eh@mchsi.com>
996
997         Debugger: Fix memory leak when quitting pager.
998         * awk.h (PUSH_BINDING, POP_BINDING): Generalize macro definitions.
999         * debug.c (print_array): save and restore bindings for pager.
1000         free list in case of an early exit in the pager.
1001         (do_dump_instructions): Don't sort functions to avoid potential
1002         memory leak.
1003         (execute_code): Adjust PUSH_BINDING and POP_BINDING macro invocations.
1004
1005         * awkgram.y (func_call): Avoid reading freed memory for indirect var
1006         name; do the special variable check before the call to 'variable'.
1007
1008         * eval.c (r_interpret): Fixes and cleanups. Change TOP to TOP_SCALAR
1009         in the case Op_store_field.
1010         (assign_common, assign, compare): Nuked macros.
1011         (cmp_scalar, op_assign): New functions as replacements for the macros.
1012
1013 Fri Nov 19 11:57:28 2010  Arnold D. Robbins  <arnold@skeeve.com>
1014
1015         * bootstrap.sh, Makefile.am: Remove treatment of CVS.
1016         * README.cvs: Updated further.
1017
1018 Thu Nov 18 23:28:23 2010  Arnold D. Robbins  <arnold@skeeve.com>
1019
1020         * configure.ac: Remove `--enable-portals' option. I don't think
1021         anyone ever used it.
1022         * io.c (two_way_open): Remove the code for portals.
1023         * README.cvs, README.git, bootstrap.sh: New files for storage
1024         in the Git repository.
1025
1026 Tue Nov 16 11:56:31 2010  Arnold D. Robbins  <arnold@skeeve.com>
1027
1028         * version.in: Removed descriptive comments. New features and
1029         so on are documented in the documentation and in NEWS.
1030
1031 Mon Nov 15 19:19:25 2010  Arnold D. Robbins  <arnold@skeeve.com>
1032
1033         * awkgram.y (LEX_LENGTH): Removed warning about length with
1034         no argument being deprecated.
1035         * awkprintf.h: Remove code for sun386. Fix %c to print multibyte
1036         character instead of first byte.
1037         * builtin.c (sub_common): Update commentary about POSIX.
1038         * io.c (nextfile): Add MAYBE_NUM to FILENAME.
1039
1040 Fri Nov 12 11:53:15 2010  Arnold D. Robbins  <arnold@skeeve.com>
1041
1042         * main.c (update_global_values): New routine, needed for correct
1043         operation of --dump-variables.
1044         * awk.h: Declared it.
1045         * awkgram.y (get_varlist): Call it.
1046         Thanks to Hermann Peifer <peifer@gmx.eu> for the bug report.
1047
1048         * debug.c (find_subscript): Initialize `r' to NULL, per
1049         Michal Jaegermann.
1050
1051 Thu Nov 11 16:31:49 2010  Arnold D. Robbins  <arnold@skeeve.com>
1052
1053         * awk.h: Restore decls of strcasecmp, strncasecmp.
1054         * builtin.c: Lots of general cleanups.
1055         (sub_common): Actually enable POSIX rules! (Wasn't done right
1056         earlier.)
1057
1058 Thu Nov  4 14:08:29 2010  Arnold D. Robbins  <arnold@skeeve.com>
1059
1060         * array.c, awkgram.y, awkprintf.h, builtin.c, debug.c, eval.c,
1061         field.c, io.c, main.c, node.c, profile.c, re.c: Remove register
1062         keyword everywhere.
1063         * node.c: Minor code cleanups.
1064
1065 Wed Nov  3 08:29:15 2010  Arnold D. Robbins  <arnold@skeeve.com>
1066
1067         * node.c (free_wstr): If argument is null string or null field,
1068         return. Thanks to Vojtech Vitek <vvitek@redhat.com>
1069
1070 Tue Nov  2 16:45:06 2010  Arnold D. Robbins  <arnold@skeeve.com>
1071
1072         Straighten out options more.  --lint --> -L, --lint-old --> -t
1073
1074         * main.c (optlist, optab, main, usage): Adjusted approrpiately.
1075
1076         Other:
1077         * awk.h: Lots more general cleanup.
1078         * builtin.c (strncasecmpmbs): Move mbstate vars into the routine.
1079         * awk.h (strncasecmpmbs): Adjust declaration.
1080         * eval.c (cmp_nodes): Adjust call.
1081         * awkgram.y, command.y: Remove unused variables.
1082
1083 Mon Nov  1 21:55:26 2010  Arnold D. Robbins  <arnold@skeeve.com>
1084
1085         * main.c (optlist, optab, main): Renamed -l option to -t
1086         so can eventually merge in xgawk's -l option.
1087         (usage): Adjusted approrpiately.
1088
1089 Mon Nov  1 16:23:52 2010  Arnold D. Robbins  <arnold@skeeve.com>
1090
1091         * array.c, awk.h, custom.h, eval.c, gawkmisc.c, io.c, main.c,
1092         protos.h, replace.c: Remove code related to: __amigaos__,
1093         atarist, BeOS, _MSC_VER, MSDOS, TANDOM, WIN32, and anything
1094         not for __STDC__.
1095
1096 Sun Oct 31 21:49:22 2010  Arnold D. Robbins  <arnold@skeeve.com>
1097
1098         * awk.h: Start on cleaning up. Remove stuff for DOS, WIN32,
1099         TANDEM, atarist, NeXT even!
1100
1101 Sun Oct 31 05:56:23 2010  John Haque          <j.eh@mchsi.com>
1102
1103         Add array of arrays.
1104
1105         * awk.h (Op_sub_array): New opcode.
1106         (POP_SCALAR, TOP_SCALAR): New macros. If the item is not a scalar,
1107         make it a fatal error.
1108         (POP_STRING, TOP_STRING): Use POP_SCALAR and TOP_SCALAR instead
1109         of POP and TOP.
1110         (force_string, force_number): Unrelated: simplify (remove) macros
1111         for older gcc and non-gcc compilers.
1112         * awkgram.y (grammar): New non-terminals for array subscripts.
1113         delete array subscripts are handled differently than array subscripts
1114         used as a variable.
1115         (SUBSCRIPT): New terminal symbol to indicate end of subscripts. 
1116         (yylex): Return SUBSCRIPT after all the subscripts has been read.
1117         (rules variable, LEX_DELETE and LEX_FOR): Adapt to these changes.
1118         (sub_counter): New global to count the number of subscripts in a
1119         delete statement.
1120         (optimize_assignment): Adjust code for assignment to an array element.  
1121         * array.c (make_aname): New function to construct a sub-array name.
1122         (get_array): Handle Node_val in the default case.
1123         (concat_exp): Issue fatal error message if each expression is not a
1124         scalar.
1125         (assoc_clear): Recursively clear sub-arrays.
1126         (do_delete, assoc_dump, assoc_sort_inplace, dup_table):
1127         Handle array of arrays.
1128         * builtin.c: Replace POP with POP_SCALAR as appropriate.
1129         * eval.c (optypes): Add entry for Op_sub_array.
1130         (r_interpret): Handle Op_sub_array. For case Op_subscript, increment
1131         reference count only if the result is a scalar. If type is not a
1132         scalar in Op_subscript_lhs, make it fatal. Adjust stack pointer
1133         after a call to do_delete in Op_K_delete. Change POP(TOP)
1134         to POP_SCALAR(TOP_SCALAR) as needed.
1135         * profile.c (pprint): Add case for Op_sub_array.
1136         * command.y (grammar): New non-terminals and rules to handle
1137         array of arrays.
1138         * debug.c (struct list_item): Redesigned. Field subs is NODE ** now,
1139         new fields num_subs and sname. New flags OLD_IS_ARRAY and CUR_IS_ARRAY;
1140         removed flag ARRAY_WATCH. Renamed macro IS_ARRAY() to WATCHING_ARRAY.
1141         (do_info): Adapt to the structural changes in cases A_WATCH and
1142         A_DISPLAY.
1143         (print_array): New function to print contents of an array.
1144         (print_subscript): New function to print an element of an array.
1145         (do_print_var): Use the new functions to print an array element 
1146         and contents.
1147         (do_set_var): Adapt to the structural changes in list_item for
1148         an array element.
1149         (delete_item, do_add_item, display): Ditto.
1150         (add_item): Ditto. Use field symbol, not subs to store field number and
1151         adjust accordingly everywhere.
1152         Unrelated: handle function parameter correctly, watch and display now
1153         prints the param name instead of the actual array name.
1154         (find_subscript): New function.
1155         (initialize_watch_item): Use the new function find_subscript
1156         to locate an array element NODE.
1157         (watchpoint_triggered): Redone.
1158         (cmp_val): Redone.
1159         (print_watch_code): Adjust code for printing subscript.
1160         (print_instruction): Add case for Op_sub_array.
1161         (serialize_subscript): New function.
1162         (serialize): Use the new function to serialize watch and display
1163         subscripts.
1164         (unserialize_list_item): Adapt to the structural changes. Also,
1165         simplify code.
1166         (do_print_f): Redo code for printting array element.
1167         (pre_execute_code, execute_code): Change POP to POP_SCALAR.
1168
1169         Unrelated:
1170
1171         * debug.c (unserialize_commands): New function for common code in
1172         unserialize_breakpoint and unserialize_list_item.
1173         (unserialize_breakpoint and unserialize_list_item): Use the new
1174         function.
1175
1176         * awkgram.y (grammar): Do not terminate parser if seen an empty(NULL)
1177         subscript. Install null string as subscript and continue parsing.
1178         (variable): Do not terminate parser if type is Node_func, change it
1179         to Node_var_new temporarily. Simplifies grammar and allows parser to
1180         continue.
1181
1182         * command.y (yylex): Add history entry when blank line repeats
1183         previous command.
1184
1185         * debug.c (pp_args): Removed. Pretty-printing SUBSEP
1186         seperated indexes can not be made to work reasonably in all cases. 
1187         (struct list_item): Removed field pp_subs.
1188         (concat_args): Move to file command.y.
1189         * command.y (grammar): Concatenate SUPSEP seperated     indexes.
1190
1191 Thu Oct 28 16:25:08 2010  Arnold D. Robbins  <arnold@skeeve.com>
1192
1193         Remove use of varargs.h everywhere:
1194
1195         * awkgram.y (yyerror): Fixed.
1196         * awk.h [CAN_USE_STADARG_H]: Removed, #error added if not available.
1197         (snprintf, Func_print, msg, error, warning): Fix declarations.
1198         * cmd.h (gprintf, d_error): Fix declaration.
1199         * command.y (yyerror): Fixed.
1200         * debug.c (d_error, gprintf): Fixed code.
1201         * main.c (lintfunc): Fix declaration.
1202         * msg.c (msg, warnning, error, r_fatal): Fixed code.
1203
1204 Wed Oct 27 16:45:29 2010  Arnold D. Robbins  <arnold@skeeve.com>
1205
1206         * awk.h [P]: Finally, nuked the `P' macro. Removed definitions
1207         and uses.
1208         [HAVE_DOPRNT]: Removed check for this, now require vfprintf.
1209         [BELL]: Nuked; require a compiler that supports '\a'.
1210         * array.c, awkgram.y, awkprintf.h, builtin.c, cmd.h, command.y,
1211         debug.c, eval.c, ext.c, field.c, io.c, main.c, protos.h [P]:
1212         Remove all uses.
1213         * node.c (r_force_number): Change check with strtod to `ptr == cpend',
1214         SunOS 3.5 compatibility no longer concerns us. Removed the comment.
1215         [P]: Removed all uses.
1216         (parse_escape): Change from BELL to '\a'.
1217         * profile.c (pp_string): Change from BELL to '\a'.
1218         [P]: Removed all uses.
1219
1220 Tue Oct 26 20:11:37 2010  Arnold D. Robbins  <arnold@skeeve.com>
1221
1222         * awkgram.y (fix_break_continue): New routine to make break and
1223         continue instructions point to where they should jump to. Adjusted
1224         grammar to call it for switch and loops.
1225         * eval.c (r_interpret): For Op_K_break and Op_K_continue, jump
1226         to pc->target_jmp.
1227         * command.y (cmdtab, do_help): Translate the help messages.
1228         * debug.c (option_list, option_help): Translate the help messages.
1229         Elsewhere, clean up / add calls to gettext.
1230
1231 Fri Oct 22 11:18:29 2010  Arnold D. Robbins  <arnold@skeeve.com>
1232
1233         * ChangeLog: Merged with ChangeLog.BYTECODE.
1234         * Makefile.am (EXTRA_DIST): Removed ChangeLog.BYTECODE.
1235         * ChangeLog.BYTECODE: Removed the file.
1236
1237 Thu Oct 21 12:16:35 2010  Arnold D. Robbins  <arnold@skeeve.com>
1238
1239         Make break and continue outside a loop not allowed at all,
1240         even with --traditional, as BWK awk no longer allows this.
1241
1242         * eval.c (r_interpret): For Op_K_break and Op_K_continue, make
1243         them fatal errors if not in a loop.
1244         * awkgram.y (break_allowed, continue_allowed): New variables.
1245         [BREAK, CONTINUE]: New flags for tokentab.
1246         (yylex): If set, increment the corresponding variable.
1247         (Grammar): Test variables when break/continue seen, decrement them
1248         at the end of productions for loops and switch.
1249
1250 Tue Oct 19 20:03:29 2010  Arnold D. Robbins  <arnold@skeeve.com>
1251
1252         * main.c (optab, usage): Remove --compat, --copyleft, and --usage extra
1253         option aliases.
1254
1255 Tue Oct 19 08:25:02 2010  Arnold D. Robbins  <arnold@skeeve.com>
1256
1257         * awkprintf.h (r_format_arg): Undouble "%" characters in
1258         error messages. Thanks to Scott Deifik for catching the problem.
1259
1260 Sat Oct 16 22:08:54 2010    Arnold Robbins      <arnold@skeeve.com>
1261
1262         Apply changes from John Haque:
1263
1264         * awk.h [ASSIGNED]: Remove unused flag.
1265         (Op_cond_pair_left): Remove.
1266         * debug.c (print_instruction): Remove Op_cond_pair_left.
1267         (do_trace_instruction): Fix print for Op_newfile.
1268         (parse_condition): Improve code.
1269         * eval.c (optypes): Add space to string for "!".
1270         (r_interpret): Remove Op_cond_pair_left and Node_instruction cases.
1271         Revise Op_cond_pair to handle left and right sides correctly.
1272         Simple code fixes in some other cases.
1273         * profile.c (pprint): Remove Op_cond_pair_left. Simplify Op_not.
1274
1275 Fri Oct 15 14:17:09 2010    Arnold Robbins      <arnold@skeeve.com>
1276
1277         * awk.h (Op_cond_pair_left): New op for left side of condition pair.
1278         * debug.c (print_instruction): Support it.
1279         * profile.c (pprint): Ditto.
1280         * eval.c (r_interpret): Split Op_cond_pair into two cases; they have
1281         to be handled differently.
1282
1283 Wed Oct 13 19:17:03 2010  Arnold D. Robbins  <arnold@skeeve.com>
1284
1285         * regex.h [RE_SYNTAX_AWK]: Add RE_CHAR_CLASSES, for compatibility
1286         with modern Unix awk.
1287
1288 Sun Oct 10 15:31:01 2010  Arnold D. Robbins  <arnold@skeeve.com>
1289
1290         * re.c (dfawarn): Do nothing in body, since gawk does it's
1291         own checking.
1292
1293 Sun Oct 10 15:30:34 2010  Arnold D. Robbins  <arnold@skeeve.com>
1294
1295         MERGE with bytecode version!  Many many files changed / added.
1296
1297 Sun Oct  3 08:41:25 2010    John Haque          <j.eh@mchsi.com>
1298
1299         * Lots of files: Indirect function call, FPAT, BEGINFILE/ENDFILE
1300         from gawk-devel.
1301
1302         * awk.h (defrule): New enum for rule types.
1303         (ruletab): Converts rule types to string constants.
1304         * awkgram.y: Use rule types to simplify code in grammar.
1305         * eval.c, debug.c, profile.c, awkgram.y routines: Update to use ruletab.
1306
1307         * Lots of files: New debugger command eval for evaluation of
1308         arbitrary (g)awk expression(s).
1309                         eval "awk statement(s)"
1310                                 OR
1311                         eval p1, p2
1312                         > awk statement
1313                         > more awk statement(s)
1314                         > end
1315         p1, p2 are eval locals.
1316         Conditional break/watch point:
1317                 break 1 "condition expression"
1318                         OR
1319                 break 1
1320                 condition "condition expression"
1321  
1322         * command.y: grammar clean-ups.
1323         (find_command): Redo to fix bugs in abbreviation/partial-string
1324         search.
1325
1326         * debug.c (command_source): New structure. Used to manage
1327         sources for debugger commands. 'source file' command can now
1328         include additional source commands.
1329         
1330         * awk.h: new enum type redirval for I/O redirection types;
1331         remove redirection types from OPCODE.
1332         * awkgram.y: Adjust grammar for redirection type changes.
1333         (yylex, mk_getline): Update for redirection type changes.
1334         * io.c (redirect, do_getline): Ditto.
1335         * profile.c (redir2str): New function to convert redirection types
1336         to string constants.
1337         (pprint): Use new function redir2str.
1338         * debug.c (print_instruction): Ditto.
1339         * eval.c (optypes): Remove redirection types from table.
1340
1341         * main.c (main): initialize do_optimize to 1, default optimizations.
1342         do_optimize > 1 for -O (--optimize) command line option.
1343         do_optimize = 0 turns off all optimizations, and is     for debugging
1344         purposes.
1345         * awkgram.y: Updated.
1346
1347         Lots of other cleanups and improvements.
1348
1349 Thu Sep 16 09:44:47 2010    John Haque          <j.eh@mchsi.com>
1350
1351         Lots of bug fixes & improvements, including work on
1352         profiling.
1353
1354 Wed Aug 18 22:15:06 2010    Arnold Robbins      <arnold@skeeve.com>
1355
1356         Lots of files: Sync fully with gawk-stable version, in particular
1357         documentation edits and all ChangeLog files.
1358
1359 Mon Aug  9 07:17:54 2010    John Haque          <j.eh@mchsi.com>
1360
1361         Fix the case when runtime stack can have a INSTRUCTION pointer
1362         while popping stack items (a next/nextfile statement inside a loop).
1363
1364         * awk.h: new NODETYPE Node_instruction. Remove instruction pointer
1365         from STACK_ITEM union, and all related macros.
1366         * eval.c (r_interpret): wrap code (INSTRUCTION) pointer inside
1367         a NODE for Op_push_loop. Change Op_pop_loop, Op_K_break
1368         and Op_K_continue accordingly.
1369         (unwind_stack): free Node_instruction.
1370         (nodetypes): add new entry for Node_instruction.
1371
1372 Thu Aug  5 15:05:22 2010    Arnold Robbins      <arnold@skeeve.com>
1373
1374         * awk.h: Remove redundant declaration of struct lconv loc;
1375         * awkprintf.h: Move ifdef for HAVE_LOCALE_H inside case '\''.
1376         * custom.h: Add macros for setenv and unsetenv for Z/OS.
1377         * main.c (main): Remove three argument version for Tiny CC after
1378         applying patches to local copy that fix the issue with environ.
1379
1380 Mon Jul 26 07:23:01 2010    John Haque          <j.eh@mchsi.com>
1381
1382         Started Byte Code version ChangeLog.
1383
1384         * awk.h, eval.c, debug.c, profile.c: Renamed opcode Op_exit to
1385         Op_atexit. Simplify exit value handling; use existing global
1386         exit_val from main.c.
1387         New opcode Op_stop.
1388
1389         * msg.c: New variables fatal_tag_valid, fatal_tag.
1390         (r_fatal): Use these new variables.
1391         (err): Change myname from dgawk to gawk when debugging;
1392         reflects the correct source of error messages.
1393
1394         * builtin.c, msg.c: Change stdout to output_fp.
1395         (do_fflush): Also flush output_fp if not stdout.
1396
1397         * command.y (yylex, yyparse): (Much) improved error recovery.
1398
1399         * awkgram.y (yylex): Add 'goto out' in 'check_special'
1400         for do_traditional or do_posix check, lost somewhere
1401         between 3.1.3 to 3.1.8.
1402         (pop_var): New name remove_symbol to go with mk_symbol.
1403         (install): New name install_symbol.
1404
1405         * debug.c:(set_gawk_output): Improved handling of /dev files
1406         including /dev/ttyN, /dev/pts/N.
1407         (pre_execute): Renamed execute, a pre_hook in r_interpret.
1408         (post_execute): New function, a post_hook in r_interpret;
1409         used to detect non-local jumps (next, nextfile, exit)
1410         with commands 'until' and 'finish', and to print the
1411         returned value for finish.
1412         (print_instruction): Redo function params initialization
1413         when trace is on. Hopefully, correct this time around.
1414         (close_all): New function to close all known files
1415         during quit and restart.
1416
1417         * eval.c(r_interpret): Redefine macro JUMPTO to include
1418         post_hook from above, and use it exclusively to move to
1419         the next instruction for execution.
1420
1421         * debug.c (do_run): Trap gawk fatal errors.
1422 Sun Sep  5 12:44:24 2010  Arnold D. Robbins  <arnold@skeeve.com>
1423
1424         * re.c (check_bracket_exp): Add `warned' flag to table and adjust
1425         code to only warn once about each candidate.
1426         (make_regexp): Always call check_bracket_exp, per discussion
1427         on comp.lang.awk.
1428
1429 Fri Aug  6 16:29:55 2010  Arnold D. Robbins  <arnold@skeeve.com>
1430
1431         * re.c (check_bracket_exp): Improved the code, again.
1432
1433 Thu Aug  5 18:41:27 2010  Arnold D. Robbins  <arnold@skeeve.com>
1434
1435         * re.c (check_bracket_exp): Improved the code.
1436
1437 Tue Aug  3 11:35:11 2010  Arnold D. Robbins  <arnold@skeeve.com>
1438
1439         * re.c (check_bracket_exp): New function.
1440         (make_regexp): Call it if do_lint.
1441
1442 Thu Jul  1 19:22:33 2010  Arnold D. Robbins  <arnold@skeeve.com>
1443
1444         Add support for /inet4/... and /inet6/... files.
1445
1446         * io.c (socketopen): New parameter `family' for address family.
1447         (inetfile): New function. Changed everywhere to use it and
1448         the values it sets.
1449
1450 Fri Jun 25 01:01:39 2010  Arnold D. Robbins  <arnold@skeeve.com>
1451
1452         * main.c (main): Added short option letters for all long options
1453         that didn't have them so that they can be used in #!. This
1454         reinstates -r, FWIW.
1455         (usage): Revised message to list standard options first, then
1456         options for extensions, sorted by short letter.
1457
1458 Mon Jun 21 23:05:20 2010  Arnold D. Robbins  <arnold@skeeve.com>
1459
1460         New FPAT variable and patsplit built-in function.
1461
1462         * awk.h (NODETYPE): Add Node_FPAT.
1463         (FPAT_node, do_patsplit, set_FPAT): Declare.
1464         (set_FPAT, update_PROCINFO_str, update_PROCINFO_num,
1465         current_field_sep): New functions.
1466         * awkgram.y (tokentab): Add patsplit.
1467         (snode): Add code for do_patsplit to default third arg to FPAT.
1468         (isnoeffect, isassignable): Add cases for Node_FPAT.
1469         * eval.c (nodetypes): Add FPAT.
1470         (r_tree_eval, r_get_lhs): Add cases for Node_FPAT.
1471         * field.c (fpat_parse_field, update_PROCINFO_num, set_FPAT,
1472         do_patsplit): New functions.
1473         (update_PROCINFO): Renamed to update_PROCINFO_str.
1474         (FPAT_re_yes_case, FPAT_re_no_case, FPAT_regexp): New variables.
1475         (using_FIELDWIDTHS): Replaced with current_field_sep and all calls.
1476         * io.c (set_RS): Call current_field_sep insead of using_fieldwidths.
1477         * main.c (main): Use update_PROCINFO_str and update_PROCINFO_num
1478         instead of manually updating the array.
1479         (varinit): Add FPAT.
1480         * profile.c (tree_eval, pp_lhs, is_scalar, pp_var): Add case for
1481         Node_FPAT.
1482
1483 Fri Jun 12 13:25:32 2009  Arnold D. Robbins  <arnold@skeeve.com>
1484
1485         Make command line arguments that are directories a warning.
1486         They remain a fatal error if --posix or --traditional.
1487
1488         * configure.ac: Remove the --disable-directories-fatal option.
1489         * io.c (nextfile): Rationalize the code that handles directories,
1490         including setting ERRNO correctly.
1491
1492 Thu Feb 26 20:57:52 2009  Arnold D. Robbins  <arnold@skeeve.com>
1493
1494         Changes from August 2008 through February 2009 to add
1495         BEGINFILE and ENDFILE, originally against 3.1.6, merged into
1496         development version.
1497
1498         * awk.h (in_beginfile_rule, in_endfile_rule): Add declarations.
1499         * awkgram.y (beginfile_block, endfile_block): Add declarations.
1500         (beginfile_or_endfile_rule, parsing_endfile_rule): New variables.
1501         (LEX_BEGINFILE, LEX_ENDFILE): New tokens, new rules for those tokens.
1502         (tokentab): Add new entries for BEGINFILE, ENDFILE.
1503         (LEX_NEXTFILE): Allow nextfile in BEGINFILE rule.
1504         (LEX_GETLINE): Allow only `getline var < file' inside BEGINFILE or
1505         ENDFILE.
1506         * eval.c (interpret): Check in_beginfile_rule and in_endfile_rule for
1507         errors for next and nextfile.
1508         (update_ERRNO_saved): When errno == 0, set to ERRNO to
1509         null string.
1510         (interpret): Allow nextfile in BEGINFILE rule.
1511         (update_ERRNO_saved): Check errcode paramater, not global errno.
1512         * io.c (beginfile_block, endfile_block, in_beginfile_rule,
1513         in_endfile_rule): New variables.
1514         (do_input): Set them.  Update ERRNO only if not do_traditional.
1515         Propogate error code down to fatal message.
1516         (run_beginfile_rule, run_endfile_rule): New functions.
1517         (iop_alloc): Use it instead of inline code.  Add fourth argument
1518         indicating that the open hooks should run. Adjust calls.  Point is
1519         to not call open hooks twice inside `nextfile'.
1520         (do_nextfile): Check it and also in_beginfile_rule and only longjump
1521         when both filebuf valid and not in a BEGINFILE rule.
1522         (nextfile): Call run_beginfile_rule and run_endfile_rule as
1523         appropriate.  Reorder the logic to set ERRNO and allow BEGINFILE
1524         to call nextfile to skip a bad data file.  Adjust calls to
1525         iop_open and find_open_hook.
1526         (nextfile): Call iop_alloc if there's a BEGINFILE block in case
1527         the hooks changed.
1528         (find_open_hook): New function.
1529         (get_a_record): On read error, just set *errcode and return. Let
1530         higher level logic decide if it's fatal.
1531         (inrec): Have error be fatal if traditional or if there isn't
1532         an ENDFILE rule.
1533         * profile.c (dump_prog): Add code for BEGINFILE / ENDFILE.
1534         * awk.h (dump_prog): Adjust declaration.
1535         * main.c (main): Adjust call to `dump_prog'.  Check beginfile_block and
1536         endfile_block also to be not NULL in order to call do_input. Thanks to
1537         Steffen Schuler for pointing out the bug.
1538
1539 Thu Feb 26 07:54:51 2009  Arnold D. Robbins  <arnold@skeeve.com>
1540
1541         Per advice from BWK and my own feelings, nuke additions from 2001
1542         of seek and tell functions. They were never documented anyway.
1543
1544         * awk.h (do_seek, do_tell): Remove declarations.
1545         (IOBUF): Remove save_start and rec_size members.
1546         * awkgram.y (tokentab): Remove "seek" and "tell" entries.
1547         * io.c (do_getline): Remove code setting save_start and rec_size.
1548         (iop_alloc): Remove code initializing save_start and rec_size.
1549         (do_seek, do_tell): Removed.
1550         * configure.ac: Remove --enable-seektell option.
1551
1552 Mon Feb 16 21:54:13 2009  Arnold D. Robbins  <arnold@skeeve.com>
1553
1554         * awkgram.y (tokentab): Enable switch / case by default.
1555         * configure.ac: Remove test for --enable-switch.
1556
1557 Thu Feb 12 22:06:17 2009  Arnold D. Robbins  <arnold@skeeve.com>
1558
1559         * main.c (optab): --gen-po becomes --gen-pot. -r goes away since it's
1560         now on by default.
1561         (usage): Similar changes.
1562         * regex.h [RE_SYNTAX_GNU_AWK, RE_SYNTAX_POSIX_AWK]: Adjust to support
1563         interval expressions.
1564         [RE_DEBUG]: Nuke: it is no longer used.
1565         * re.c (resetup): Adjust comment for do_intervals.
1566         (reflags2str): Remove RE_DEBUG.
1567
1568 Sat Jan 17 20:41:54 2009  Arnold D. Robbins  <arnold@skeeve.com>
1569
1570         * awk.h (WSTRCUR): Always define, no real need for ifdef.
1571         * eval.c (flags2str): Similar.
1572         * field.c (rebuild_record): Similar.
1573
1574 Sat Jan 17 19:59:39 2009  Arnold D. Robbins  <arnold@skeeve.com>
1575
1576         Add indirect function calls. They require a special
1577         syntax, which is an `@' in front of a function call.
1578
1579         * awk.h (NODETYPE): New Node_indirect_function_call value.
1580         (ASSIGNED): New flag value.
1581         * eval.c (nodetype2str): Add new node type.
1582         (flags2str): Add ASSIGNED.
1583         (func_call): Test the node type to determine
1584         what kind of call.  Cache the function body if a real function
1585         is called indirectly. Also get scoping right if called from a function.
1586         LOTS of work here to get this code right!
1587         (op_assign): Add ASSIGNED to flags.
1588         * awkgram.y (function_call, direct_function_call): New productions for
1589         creating indirect function calls. Only call func_use for direct call.
1590         (yylex): Add case for '@'. Only return it if not posix or traditional.
1591         * profile.c (tree_eval): Add case for Node_indirect_func_call.
1592         (pp_func_call): Check type and print '@' for indirect call.
1593
1594 Tue Dec 30 22:25:04 2008  Assaf Gordon       <gordon@cshl.edu>
1595
1596         * awk.h (do_sandbox): New variable declaration.
1597         * main.c (do_sandbox): Variable definition.
1598         (opttab): Add new option --sandbox.
1599         (usage): Add to usage message.
1600         * builtin.c (do_system): Disallow if sandboxed.
1601         * io.c (redirect): Disallow redirections if sandboxed.
1602
1603 Tue Dec 30 22:22:04 2008  Arnold D. Robbins  <arnold@skeeve.com>
1604
1605         * builtin.c (usage): Change --binary to --characters-as-bytes,
1606         per Karl Berry.
1607
1608 Thu Dec 18 05:29:46 2008  Steffen Schuler    <schuler.steffen@googlemail.com>
1609
1610         * field.c (*_parse_field): Add `sep_arr' argument and fill it.
1611         * field.c (do_split): Add handling of fourth argument of awk 
1612         builtin `split'.
1613         * field.c (get_field): Extend parse_field by default argument.
1614         * awkgram.y (tokentab): Extend `split' entry with fourth argument.
1615
1616 Wed Dec 17 09:54:00 2008  Arnold D. Robbins  <arnold@skeeve.com>
1617
1618         * main.c (do_binary): New variable for new option -b which
1619         makes gawk not mess with multibyte strings.
1620         (opttab): Add option entry for -b / --binary.
1621         (main): If do_binary, set gawk_mb_cur_max to 1.
1622
1623 Sat Oct 27 22:43:50 2007  Arnold D. Robbins  <arnold@skeeve.com>
1624
1625         * re.c (resetup): Add RE_INVALID_INTERVAL_ORD to syntax bits if
1626         doing interval expressions.
1627
1628 Thu Oct 25 23:11:10 2007  Arnold D. Robbins  <arnold@skeeve.com>
1629
1630         * awk.h (devopen): Add `isdir' pointer argument.
1631         * io.c (devopen): Ditto. Adjust logic that checks for directory.
1632         Adjust all calls.
1633         * main.c (main): Adjust call to devopen.
1634
1635 Sun Oct  3 23:18:44 2004  Arnold D. Robbins  <arnold@skeeve.com>
1636
1637         * dfa.c (lex): Enabled \s and \S escape sequences.
1638         * regcomp.c (peek_token): Ditto.
1639
1640 Tue Aug  3 13:29:53 2004  Arnold D. Robbins  <arnold@skeeve.com>
1641
1642         * builtin.c (sub_common): Make POSIX 2001 behavior the
1643         default for `sub' and `gsub'.
1644
1645 Wed Aug 21 13:39:08 2002  Dean Wakerly  <dean@wakerly.com>
1646
1647         * main.c (main): Add short option letter 'r' for --re-interval.
1648         Mainly for use in #! scripts.
1649
1650 Wed Dec 26 22:03:48 2001  Arnold D. Robbins  <arnold@skeeve.com>
1651
1652         Nuke /dev/pid etc. special files!
1653
1654         * awk.h (IOP_IS_INTERNAL, IOP_NO_FREE): Removed. Other defines
1655           renumbered.
1656         * io.c (iop_open, spec_setup, specfdopen, pidopen, useropen): Removed.
1657           (do_input, redirect): Change uses of iop_open() to devopen() +
1658           iop_alloc().
1659           (iop_close, get_a_record): Remove special handling for IOP_INTERNAL,
1660           IOP_NO_FREE.
1661           (devopen): Remove comment relating to iop_open.
1662           Add fstat check for valid fd for /dev/fd/N.
1663
1664 Sun Nov  4 10:27:58 2001  Arnold D. Robbins  <arnold@skeeve.com>
1665
1666         * awk.h, builtin.c, awkgram.y: Renamed mark/reset to tell/seek.
1667         * acconfig.h: Add `#undef SEEK_TELL'.
1668         * configure.in: Add `--enable-seektell' configure-time option.
1669         * io.c (do_seek, do_tell): renamed from do_reset, do_mark.
1670
1671 Thu Aug 16 12:21:28 2001  Arnold D. Robbins  <arnold@skeeve.com>
1672
1673         New feature, undocumented for now, use #define MARK_RESET to
1674         to turn it on.  New function  val = mark("/some/file")  to
1675         save start position of current record.  Use
1676         reset("/some/file", pos) to go back to it.  ONLY works
1677         with getline.
1678
1679         * awk.h (IOBUF): New members save_start and rec_size.
1680           (do_mark, do_reset): Add declarations.
1681         * awkgram.y (tokentab): Add entries for mark and reset.
1682         * io.c (specsetup): Initialize save_start and rec_size.
1683           (iop_alloc): Ditto.
1684           (do_getline): Update them as appropriate.
1685           (do_mark, do_reset): New functions.
1686
1687 Fri Sep 17 12:42:42 2010  Arnold D. Robbins  <arnold@skeeve.com>
1688
1689         * regcomp.c (btowc): Changed to use mbrtowc.
1690
1691 Wed Sep 15 08:26:55 2010  Arnold D. Robbins  <arnold@skeeve.com>
1692
1693         * dfa.c: Further sync with GNU grep.
1694
1695 Tue Sep 14 09:53:55 2010  Arnold D. Robbins  <arnold@skeeve.com>
1696
1697         * node.c (str2wstr): Per advice from Ulrich Drepper, when converting,
1698         if the current byte is isprint, isgraph, iscntrl or zero, then it
1699         can't start a multibyte character. This can save many calls to
1700         `mbrtowcs', and speed up the conversion considerably.
1701
1702 Mon Sep 13 11:19:21 2010  Arnold D. Robbins  <arnold@skeeve.com>
1703
1704         * dfa.h, dfa.c: Sync with GNU grep.
1705         * re.c (dfawarn): New routine for use by dfa.
1706
1707 Sun Sep 12 22:17:02 2010  Arnold D. Robbins  <arnold@skeeve.com>
1708
1709         * profile.c (tree_eval): Fix comment on for ... delete array loop.
1710         (pp_string_fp): Get escapes right on regex constant.
1711
1712 Sun Sep  5 20:38:42 2010  John E. Haque <j.eh@mchsi.com>
1713
1714         * re.c (str2wstr): Decrement src_count when skipping bad bytes.
1715
1716 Fri Aug 27 13:51:13 2010  Arnold D. Robbins  <arnold@skeeve.com>
1717
1718         * dfa.c: Sync with current GNU grep - minor edits only.
1719
1720 Fri Aug 20 16:26:14 2010  Arnold D. Robbins  <arnold@skeeve.com>
1721
1722         * profile.c (tree_eval): Always parenthesize Node_cond_exp.
1723         May add a few extra parens but guarantees the right semantics.
1724         Thanks to Hermann Peifer <peifer@gmx.eu> for the bug report.
1725
1726 Thu Aug 19 21:35:13 2010  Arnold D. Robbins  <arnold@skeeve.com>
1727
1728         * regex_internal.c (re_string_reconstruct): Move ifdef out to cover
1729         variable declarations, to avoid "unused variable" warnings.
1730         * regexec.c (check_arrival_add_next_nodes): Bracket declaration of
1731         `err' with ifdef for the same reason.
1732
1733         Thanks to avarab@gmail.com for the suggestions.
1734
1735 Wed Aug 18 22:13:30 2010  Arnold D. Robbins  <arnold@skeeve.com>
1736
1737         * Makefile.am (AUTOMAKE_OPTIONS): Added. Other minor cleanups.
1738
1739 Tue Aug 17 23:27:43 2010  Arnold D. Robbins  <arnold@skeeve.com>
1740
1741         * profile.c (pp_string_fp): Use different sets of escape characters
1742         if printing a string or a regex, based on delimiter. Thanks to
1743         Hermann Peifer <peifer@gmx.eu> for the bug report.
1744
1745 Sun Aug  8 23:05:09 2010  Arnold D. Robbins  <arnold@skeeve.com>
1746
1747         * re.c (make_regexp): Don't allocate rp->dfareg unless
1748         we're using dfa; causes a memory leak otherwise. Thanks to
1749         Antonio Columbo for reporting the bug.
1750
1751 Wed Jul 14 23:04:30 2010  Eli Zaretskii      <eliz@gnu.org>
1752
1753         * dfa.c: Include langinfo.h only if HAVE_LANGINFO_CODESET is
1754         defined.
1755
1756 Wed Jul 14 23:00:19 2010  Arnold D. Robbins  <arnold@skeeve.com>
1757
1758         * awkgram.y (yylex): Allow a backslash before CR-LF to also
1759         work for line continuation, for MS-DOS style source files.
1760         Thanks to (Vincent Belaiche) for pointing this out.
1761
1762 Wed Jul 14 22:31:53 2010  Arnold D. Robbins  <arnold@skeeve.com>
1763
1764         * node.c (str2wstr): Keep going if get a bad multibyte sequence.
1765         Allows match to give correct answers for RSTART, RLENGTH.
1766         Add a lint warning. Correctly set the length of the string
1767         based on pointer subtraction.
1768
1769 Wed Jun 16 21:52:09 2010  Arnold D. Robbins  <arnold@skeeve.com>
1770
1771         * awk.h (exec_count): Moved into NODE structure as standalone
1772         element since count on `/pat/ { ... }' was wrong. Thanks to
1773         Hermann Peifer <peifer@gmx.eu> for the bug report.
1774
1775         Note to self: DO NOT propogate this to the byte-code version.
1776
1777         Unrelated:
1778
1779         * awkgram.y (matchop): Made left associative to match behavior
1780         of other awks.
1781         (print_expression_list): Simplified so that something like
1782         `print ("a", "b") in B in A' will work. Again, to match what
1783         other awks do.
1784
1785 Fri Jun  4 15:56:59 2010  Arnold D. Robbins  <arnold@skeeve.com>
1786
1787         * dfa.c: Further merges with GNU grep.
1788
1789 Thu May 20 22:20:32 2010  Stepan Kasal       <skasal@redhat.com>
1790
1791         * Makefile.am [AUTOMAKE_OPTIONS]: Removed, contents now in ...
1792         * configure.ac [AM_INIT_AUTOMAKE]: ... here.
1793         Added dist-xz while I'm at it, per Karl Berry.
1794
1795 Tue May 18 14:52:04 2010  Marcin Szewczyk    <Marcin.Szewczyk@wodny.org>
1796
1797         * builtin.c (format_tree): Simplify code in pr_tail when multibyte
1798         and %s or %d.
1799
1800 Thu May  6 20:55:14 2010  Arnold D. Robbins  <arnold@skeeve.com>
1801
1802         * Release 3.1.8: Release tar file made.
1803
1804 Fri Apr 30 11:37:54 2010  Arnold D. Robbins  <arnold@skeeve.com>
1805
1806         * configure.ac: Remove check for libsnprintf.
1807
1808 Tue Apr 27 22:23:26 2010  Andreas Schwab  <schwab@linux-m68k.org>
1809
1810         * builtin.c (do_mktime): Make lint check more sane.
1811         Fix overflow check.  Removes GCC warning that Arnold
1812         incorrectly didn't like.
1813
1814 Mon Apr 26 20:16:07 2010  Arnold D. Robbins  <arnold@skeeve.com>
1815
1816         * ltmain.sh: Removed.
1817         * builtin.c (do_mktime): Restored old code to match the
1818         documentation. We now have a warning that we just have to
1819         live with. Sigh. Stupid GCC. Added a lint warning though.
1820         (format_tree): More code so that %'d acts like %d on systems
1821         without <locale.h>.
1822         * main.c (main): Add `&& #if defined(HAVE_LOCALE_H)' for
1823         call to setlocale.
1824
1825 Wed Apr 21 23:35:43 2010  Arnold D. Robbins  <arnold@skeeve.com>
1826
1827         * Makefile.am: Change quoting of -Dargs so that even tcsh
1828         users will be happy.
1829         * regex_internal.c (MAX): Add `#undef MAX', just in case.
1830         * configure.ac: Don't look for libsigsegv on OSF/1, gives
1831         us severe headaches.
1832
1833 Tue Apr 20 12:01:01 2010  Arnold D. Robbins  <arnold@skeeve.com>
1834
1835         * dfa.h, dfa.c: Sync with GNU grep. The long-standing x{0} bug
1836         is now gone.  Matching UTF-8 with "." is now much faster.
1837         * re.c (avoid_dfa): Remove call to dfabroken() which is now gone.
1838         * builtin.c (do_mktime): Simplify check of values passed in to be
1839         more readable and to avoid a weird compiler warning from GCC.
1840
1841 Fri Apr 16 15:02:26 2010  Arnold D. Robbins  <arnold@skeeve.com>
1842
1843         * array.c (assoc_lookup): Add cast in error message to turn
1844         off compiler warning.
1845         * dfa.c (is_blank): New function. Use it everywhere instead of
1846         ctype.h `isblank' macro which isn't available universally.
1847
1848 Tue Apr 13 22:36:31 2010  Arnold D. Robbins  <arnold@skeeve.com>
1849
1850         * array.c, awkgram.y, builtin.c, dfa.c, eval.c, ext.c, main.c,
1851         node.c, re.c: Remove old ISxxx and TOxxx macros in favor of
1852         standard versions.  ``We're two wild and crazy guys!''
1853
1854 Tue Apr 13 22:07:18 2010  Arnold D. Robbins  <arnold@skeeve.com>
1855
1856         * getopt.c, getopt.h, getopt1.c, getopt_int.h, regcomp.c, regex.c,
1857         regex.h, regex_internal.c, regex_internal.h, regexec.c: Sync with
1858         glibc. What the heck.
1859
1860 Thu Apr  8 21:33:09 2010  Arnold D. Robbins  <arnold@skeeve.com>
1861
1862         * dfa.h, dfa.c: All leading indentation is now spaces only. Yet
1863         another sync with grep.
1864
1865 Thu Apr  8 20:45:25 2010  Arnold D. Robbins  <arnold@skeeve.com>
1866
1867         Move dfa internals into dfa.c and sync with grep. Avoids VMS and
1868         z/OS compile problems in order to avoid cygwin issue when used
1869         with ligsigsegv.  ("Portability?  We don't need no stinkin'
1870         portability!")
1871
1872         * dfa.h: Move all the internals into dfa.c.
1873         (dfaalloc, dfamusts, dfabroken): Add declarations.
1874         * dfa.c: Accept all the internals.
1875         (dfaalloc, dfamusts, dfabroken): New functions.
1876         * awk.h (Regexp): Use a `struct dfa *'.
1877         * re.c (make_regexp): Call dfaalloc. Adjust uses of dfareg
1878         in other routines.
1879         (refree): Free the dfa struct too.
1880
1881 Tue Apr  6 23:06:55 2010  Arnold D. Robbins  <arnold@skeeve.com>
1882
1883         * dfa.h, dfa.c: Further sync with GNU grep for enum change
1884         and other misc changes.
1885
1886 Tue Apr  6 20:13:45 2010  Michal Jaegermann  <michal@harddata.com>
1887
1888         * main.c: Wrap declarations and bodies of `catchsegv' and
1889         `catchstackoverflow' in #ifdef HAVE_LIBSIGSEGV to avoid
1890         "not used" warnings.
1891
1892 Tue Apr  6 20:11:47 2010  Arnold D. Robbins  <arnold@skeeve.com>
1893
1894         * dfa.h: Move definition of token enum to dfa.c to avoid conflict
1895         with Windows WCHAR introduced by libsigsegv. Thanks to Corinna
1896         Vinschen.
1897         * dfa.c: Enum body here.
1898         (in_coll_range): z/OS fix: Initialize array to all zeros and assign
1899         values instead of putting them into the initializer. Thanks to Dave
1900         Pitts for reporting the problem.
1901
1902 Fri Apr  2 12:32:40 2010  Arnold D. Robbins  <arnold@skeeve.com>
1903
1904         * dfa.c: Sync with grep 2.6.3.
1905
1906 Wed Mar 31 15:50:34 2010  Arnold D. Robbins  <arnold@skeeve.com>
1907
1908         * dfa.c (dfaexec): Move decl of `saved_end' up to top of function.
1909         Fixes compilation on C89 compilers.
1910
1911 Mon Mar 29 08:40:29 2010  Arnold D. Robbins  <arnold@skeeve.com>
1912
1913         Remove local copy of libsigsegv. Use an external copy if available.
1914
1915         * Makefile.am: Remove SEGVSUBDIR and SEGVINCLUDE.
1916         * configure.ac: Remove previous code that handled the library and use
1917         gl_LIBSIGSEGV library.
1918         * custom.h: Remove code for HAVE_SIGSEGV_H.
1919         * main.c: Move to HAVE_LIBSIGSEGV.
1920         * libsigegv/ : Removed.
1921
1922 Mon Mar 29 05:41:35 2010  Corinna Vinschen  <vinschen@redhat.com>
1923
1924         * dfa.c: Include hard-locale.h after xalloc.h because it needs
1925         xmalloc.
1926         * hard-locale.h (xmalloc): Remove declaration.
1927         (hard_locale): Cast xmalloc to correct target type.
1928
1929 Mon Mar 29 05:38:47 2010  Arnold D. Robbins  <arnold@skeeve.com>
1930
1931         * io.c: (two_way_open): In counting down retries, test for > 0
1932         instead of >= 0 since retries is unsigned. Thanks to Pat Rankin
1933         for noticing.
1934         * configure.ac: Remove use of -export-dynamic on cygwin.
1935
1936 Thu Mar 25 21:48:13 2010  Arnold D. Robbins  <arnold@skeeve.com>
1937
1938         * dfa.c: Sync to grep 2.6.1.  That's probably enough for now.
1939
1940 Wed Mar 24 19:48:01 2010  Arnold D. Robbins  <arnold@skeeve.com>
1941
1942         * dfa.c: More sync with grep.
1943
1944 Tue Mar 23 19:42:48 2010  Jeff Chua          <jeff.chua.linux@gmail.com>
1945
1946         * io.c (two_way_open):  Bug fix in management of timeout value.
1947
1948 Tue Mar 23 19:40:04 2010  Arnold D. Robbins  <arnold@skeeve.com>
1949
1950         * dfa.h, dfa.c: Synced with released grep 2.6.  Oh Frabjous Day!
1951         Callou! Callay!
1952
1953 Mon Mar 22 22:49:44 2010  Arnold D. Robbins  <arnold@skeeve.com>
1954
1955         * awkgram.c: Regenerated using bison 2.4.2.
1956
1957 Fri Mar 19 10:19:20 2010  Arnold D. Robbins  <arnold@skeeve.com>
1958
1959         * dfa.c: Minor edits for compat with grep.
1960
1961 Fri Mar 19 09:19:56 2010  Arnold D. Robbins  <arnold@skeeve.com>
1962
1963         * io.c (two_way_open): Cleanup new code for socket opens.
1964         * replace.c: Include missing_d/usleep.c based HAVE_USLEEP.
1965         * configure.ac: Add usleep to list of functions to look for.
1966
1967 Thu Mar 18 23:30:33 2010  Arnold D. Robbins  <arnold@skeeve.com>
1968
1969         * dfa.h, dfa.c: Imported from GNU grep and merged. Passes "make test".
1970         * xalloc.h: New file, needed by dfa.c.
1971         * Makefile.am (base_sources ): Added xalloc.h.
1972
1973 Thu Mar 18 07:29:45 2010  Jeff Chua          <jeff.chua.linux@gmail.com>
1974
1975         * io.c (two_way_open):  Make failure to open a socket a non-fatal error.
1976         Allow the amount of time to sleep during socket retries to come from an
1977         undocumented env variable giving time in milliseconds.
1978
1979 Mon Mar  8 20:58:05 2010  Paolo Bonzini      <bonzini@gnu.org>
1980
1981         More fixes from GNU grep.
1982
1983         * dfa.c (dfaexec): Remove register keywords.
1984         (FETCH): Use do..while(0) idiom.
1985         (parse_bracket_exp_mb): Return MBCSET.
1986         (in_coll_range): New.
1987         (lex): Assign return value of parse_bracket_exp_mb to lasttok,
1988         return it.  Use in_coll_range instead of regcomp/regexec.
1989
1990 Mon Mar  8 20:36:35 2010  Jim Meyering       <jim@meyering.net>
1991
1992         Fixes from GNU grep development version:
1993
1994         build: avoid shadowing warnings
1995         * dfa.c (match_mb_charset): Rename parameter: s/index/idx/.
1996         (check_matching_with_multibyte_ops, match_anychar): Likewise.
1997
1998         build: avoid shadowing warning for unused "rs"
1999         * dfa.c (transit_state): Remove dead stores;
2000         Ignore transit_state_consume_1char return value.
2001
2002         syntax: remove trailing blanks
2003         * dfa.c: Remove trailing blanks, to ease synchronization with grep.
2004
2005         clean-up: limit visibility of an internal function
2006         * dfa.c (match_mb_charset): Declare static.
2007
2008         build: rename local to avoid shadowing global, dfa
2009         * dfa.c (dfamust): Rename parameter: s/dfa/d/.
2010
2011 Thu Feb 18 22:44:01 2010  Arnold D. Robbins  <arnold@skeeve.com>0
2012
2013         * eval.c (push_args): Clear the stack to NULL pointers after mallocing
2014         it. Fixes yesterday's problem when called from a rule.
2015         See test/fcall_exit2.awk.  Thanks to Seb <sbb@tuxfamily.org>.
2016
2017 Wed Feb 17 23:19:32 2010  Arnold D. Robbins  <arnold@skeeve.com>
2018
2019         * eval.c (pop_fcall): Check that argument on stack is not NULL before
2020         attempting to clear it; add comment explaining it.
2021         (push_args): Set nodes to zero for argument to make sure that values
2022         are NULL for testing later in pop_fcall. See test/fcall_exit.awk.
2023         Thanks to Seb <sbb@tuxfamily.org>.
2024
2025 Sun Jan 31 22:46:49 2010  Arnold D. Robbins  <arnold@skeeve.com>
2026
2027         * profile.c (prec_level): Add Node_regex to the switch so that
2028         `! /xxx/' works.  Thanks to Hermann Peifer <peifer@gmx.eu> for
2029         reporting the bug.
2030
2031 Thu Jan 28 17:40:14 2010  Arnold D. Robbins  <arnold@skeeve.com>
2032
2033         * configure, Makefile.am: Updated to Autoconf 2.65 and Automake 1.11.1,
2034         libsigsegv 2.8.
2035
2036 Thu Jan 21 23:24:56 2010  Arnold D. Robbins  <arnold@skeeve.com>
2037
2038         * profile.c (pprint): Separate out code for Node_switch_body and only
2039         print the lnode; avoids printing the default case twice. Thanks to
2040         Hermann Peifer <peifer@gmx.eu> for reporting the bug.
2041
2042 Sun Jan  3 21:03:01 2010  Arnold D. Robbins  <arnold@skeeve.com>
2043
2044         * dfa.c: Added casts as needed to silence warnings about
2045         signedness of pointers from GCC 4.x.
2046
2047 Fri Jan  1 11:41:50 2010  Arnold D. Robbins  <arnold@skeeve.com>
2048
2049         * builtin.c (format_tree): At pr_tail, remember to take the precision
2050         into account when determining how many characters to copy out.
2051         Thanks to tczy <cy@wre.ath.cx> for the bug report.
2052
2053 Tue Dec  8 12:29:30 2009  Arnold D. Robbins  <arnold@skeeve.com>
2054
2055         * configure.ac, awk.h: Remove use of <signum.h> header file.
2056
2057 Mon Dec  7 15:25:02 2009  Arnold D. Robbins  <arnold@skeeve.com>
2058
2059         * node.c (format_val):  Use <= and >= in the comparisons with
2060         LONG_xxx instead of < and > so that things work correctly on systems
2061         with 64 bit integers.  Thanks to Stephen Davies for pointing out
2062         the problem.
2063
2064 Sat Nov 21 23:14:59 2009  Arnold D. Robbins  <arnold@skeeve.com>
2065
2066         * builtin.c (format_tree): If there is not an actual thousands
2067         separator character, don't let `quote_flag' have an effect. Fixes
2068         test failure on Solaris 10, which bizarrely says to use the
2069         thousands separator character every three digits, but then doesn't
2070         actually supply one. Thanks to Nelson Beebe for the initial
2071         report.
2072
2073 Mon Nov 16 22:27:44 2009  Arnold D. Robbins  <arnold@skeeve.com>
2074
2075         * awk.h (getnode): If MPROF wrap body in parentheses; remove
2076         incorrect trailing semicolon.
2077         * bisonfix.awk: Convert "y.tab.c" to "awkgram.c" for those rare
2078         instances where we need to use a debugger on the parser so
2079         that gdb will find the right source file.
2080
2081 2009-10-26  Andreas Schwab  <schwab@linux-m68k.org>
2082
2083         * io.c (iop_open): Set errno when rejecting a directory.
2084
2085 Tue Oct 20 22:48:14 2009  Arnold D. Robbins  <arnold@skeeve.com>
2086
2087         * awkgram.y (constant_fold): Fix check for two strings to look
2088         at `right->flags'. Fix division code to check for division by
2089         zero first. Thanks to Stephen Davies <scldad@sdc.com.au>
2090         for both.
2091
2092 Fri Oct 16 08:41:29 2009  Arnold D. Robbins  <arnold@skeeve.com>
2093
2094         * io.c (redirect): Do the close-on-exec setting before
2095         attempt to get a FILE *. Thanks to Andreas Schwab.
2096
2097 Wed Oct 14 23:25:47 2009  Arnold D. Robbins  <arnold@skeeve.com>
2098
2099         * io.c (redirect): When opening a file, set the close-on-exec flag.
2100         Thanks to Chris Pearson <kermit4@gmail.com> for the bug report.
2101
2102 Tue Oct  6 21:07:23 2009  Arnold D. Robbins  <arnold@skeeve.com>
2103
2104         * main.c (main): When an option requires an argument and we print a
2105         message, call `usage' and exit.
2106
2107         Fix all calls to `usage' to use EXIT_FAILURE and EXIT_SUCCESS
2108         instead of 1 and 0.
2109
2110 Sun Oct  4 21:46:11 2009  Arnold D. Robbins  <arnold@skeeve.com>
2111
2112         * main.c (main): Don't reset argv[0] to myname. In call
2113         to `init_args', pass argv[0] if do_posix. Based on
2114         Fedora bug report.
2115
2116 Sun Oct  4 18:45:06 2009  Arnold D. Robbins  <arnold@skeeve.com>
2117
2118         * array.c (assoc_lookup): In lint warning, don't clobber
2119         the character at the end of the subscript; instead use the
2120         length to limit the number of characters printed. Thanks to
2121         Nick Hobson <nick.hobson@yahoo.com>.
2122
2123 Sun Aug 30 22:40:12 2009  Arnold D. Robbins  <arnold@skeeve.com>
2124
2125         * builtin.c (do_length): Handle the case where Node_var_new
2126         was passed in as a parameter via a function call parameter.
2127         Thanks to Greg Johnson <gregfjohnson@yahoo.com> for reporting
2128         the bug.
2129
2130 Tue Aug 11 19:23:51 2009  Arnold D. Robbins  <arnold@skeeve.com>
2131
2132         * profile.c (parenthesize_expr): New function.
2133         (tree_eval): Use it for Node_and and Node_or. Thanks to
2134         Hermann Peifer <peifer@gmx.eu> for reporting the bug.
2135
2136 Tue Aug  4 06:04:23 2009  Arnold D. Robbins  <arnold@skeeve.com>
2137
2138         * builtin.c (format_tree): zero_flag does not apply to
2139         %c and %s conversions. Thanks to Mike Brennan and Thomas Dickey
2140         for the bug report.
2141
2142 Tue Jul 21 22:28:56 2009  Arnold D. Robbins  <arnold@skeeve.com>
2143
2144         * Release 3.1.7: Release tar file made.
2145
2146 Fri Jul 17 08:35:10 2009  Arnold D. Robbins  <arnold@skeeve.com>
2147
2148         * awkgram.c: Rebuilt with current Bison (2.4.1).
2149
2150 Thu Jul  9 22:55:17 2009  Arnold D. Robbins  <arnold@skeeve.com>
2151
2152         * (NEWS README array.c awk.h awkgram.y builtin.c configure 
2153         configure.ac custom.h dfa.c ext.c field.c floatcomp.c io.c
2154         main.c node.c profile.c re.c replace.c): Update copyrights
2155         and other prep for a release.
2156
2157 Thu Jul  9 22:20:04 2009  Arnold D. Robbins  <arnold@skeeve.com>
2158
2159         * main.c (init_locale): New function to make a deep copy of the
2160         struct lconv. Thanks to KIMURA Koichi <kimura.koichi@canon.co.jp>
2161         for the info.
2162         * eval.c (r_tree_eval): Further improve Node_assign_concat code to
2163         temporarily to keep reference counts correct and to get the
2164         desired behavior.
2165
2166 Mon Jul  6 20:29:12 2009  Arnold D. Robbins  <arnold@skeeve.com>
2167
2168         * floatmagic.h: Remove @ signs copied from Texinfo.
2169         It would help if I were more awake.
2170
2171 Sat Jul  4 21:55:18 2009  Arnold D. Robbins  <arnold@skeeve.com>
2172
2173         * Makefile.am (base_sources): Add floatmagic.h so it'll
2174         go into the tar ball.
2175
2176 Fri Jul  3 13:47:36 2009  Arnold D. Robbins  <arnold@skeeve.com>
2177
2178         * profile.c (is_scalar): Add Node_func_call to list.
2179         (pp_concat): Make logic smarter for tree created by Node_assign_concat.
2180
2181 Fri Jul  3 13:01:49 2009  Arnold D. Robbins  <arnold@skeeve.com>
2182
2183         * awkgram.y (optimize_concat): New function that applies
2184         Node_assign_concat more generally.
2185         * eval.c (r_tree_eval): Improve Node_assign_concat code to temporarily
2186         increase the stref on `l' to avoid side effects during evaluation of
2187         `r'. This makes test/nasty.awk work. Ouch.
2188
2189 Tue Jun 30 22:10:37 2009  Arnold D. Robbins  <arnold@skeeve.com>
2190
2191         * floatmagic.h: New file.
2192         * builtin.c (format_tree): Use functions defined in floatmagic.h.
2193
2194 Tue Jun 30 21:57:47 2009  Arnold D. Robbins  <arnold@skeeve.com>
2195
2196         * configure.ac, Makefile.am: Add new --disable-libsigsegv command line
2197         option to configure.
2198         (LIBSIGSEGV, SEGVINCLUDE, SEGVSUBDIR): New variables that will be empty
2199         if libsigsegv is disabled so nothing will happen, and that will have the
2200         right values otherwise. They are then substituted into the Makefile.
2201
2202 Wed Jun 24 23:00:10 2009  Arnold D. Robbins  <arnold@skeeve.com>
2203
2204         * bootstrap.sh: Revised. Now works again. We think. (CVS-only file)
2205
2206 Wed Jun 24 21:57:30 2009  Arnold D. Robbins  <arnold@skeeve.com>
2207
2208         * custom.h: Move z/OS EXIT_FAILURE definition from here to ...
2209         * awk.h: Here. Define at end after regular definition.
2210
2211 Thu Jun 18 06:17:38 2009  Scott Deifik  <scottd@amgen.com>
2212
2213         * awk.h: Don't define HAVE_SIGSEGV_H for DJGPP.
2214
2215 Thu Jun 18 05:38:42 2009  Dave Pitts         <dpitts@cozx.com>
2216
2217         * custom.h: Changes needed for z/OS.
2218
2219 Wed Jun 10 08:22:53 2009  Arnold D. Robbins  <arnold@skeeve.com>
2220
2221         * node.c (parse_escape): Add a lint warning if \x.. has more than two
2222         hex digits.
2223
2224 2009-06-08  gettextize  <bug-gnu-gettext@gnu.org>
2225
2226         * configure.ac (AM_GNU_GETTEXT_VERSION): Bump to 0.17.
2227
2228 Mon Jun  8 22:13:49 2009  Arnold D. Robbins  <arnold@skeeve.com>
2229
2230         Update to Autoconf 2.63, Automake 1.11, Libtool 2.2.6a
2231
2232         * ltmain.sh: New file.
2233         * configure.ac: Changes to keep infrastructure tools happy.
2234         * alocal.m4, configure: Regenerated.
2235         * Makefile.in, */Makefile.in: Regenerated.
2236
2237 Mon Jun  8 07:43:25 2009  John DuBois        <spcecdt@armory.com>
2238
2239         * builtin.c (mbc_byte_count, mbc_char_count): Make sure all declarations
2240         come before executable code, for older compilers.
2241         * dfa.c (insert): Ditto.
2242         * io.c (devoopen): Ditto.
2243
2244 Thu May 21 21:11:44 2009  Arnold D. Robbins  <arnold@skeeve.com>
2245  
2246         Add simple constant folding.
2247  
2248         * awk.h (do_optimize): New declaration.
2249         (calc_exp): Add declaration.
2250         * eval.c (calc_exp): Make non-static.
2251         * main.c (do_optimize): New variable.
2252         (opttab): Add new entry for --optimize.
2253         (main): Add 'O' to optlist and code for argument parsing.
2254         (usage): Update for new option.
2255         * awkgram.y (Node_concat, Node_exp, Node_times, Node_quotient, Node_mod,
2256         Node_plus, Node_minus): Call `constant_fold' to create the node in
2257         the tree.
2258         (constant_fold): New function.
2259
2260 Fri May 15 16:02:01 2009  Arnold D. Robbins  <arnold@skeeve.com>
2261
2262         * awk.h (getnode): For MPROF: Fix a typo.
2263
2264 Fri May 15 14:10:44 2009  Arnold D. Robbins  <arnold@skeeve.com>
2265
2266         Function arguments cannot be reserved variable names, per POSIX.
2267
2268         * main.c (struct varinit): Add flags member.
2269         (varinit): Add values for flags member (one or both of NON_STANDARD
2270         or NO_INSTALL). Add entries for the rest of the gawk variables and
2271         sort them, so that the table can be searched by ...
2272         (is_std_var): New routine to see if a name is a standard variable.
2273         * awk.h (is_std_var): Add declaration.
2274         * awkgram.y (func_install): Use new routine and issue error.
2275
2276 Wed Apr 22 07:42:05 2009  Arnold D. Robbins  <arnold@skeeve.com>
2277
2278         * builtin.c (sub_common): In code for handling \<dig> replacements,
2279         first make sure that <dig> is within the range of parentheses sets
2280         given, and then make sure that the subpattern start is not -1, meaning
2281         that something actually matched. Thanks to  Martin Olsson
2282         <mnemo@minimum.se> for the bug report.
2283         (do_length): Add a lint warning if `length' is passed an untyped
2284         argument.
2285
2286 Thu Apr 16 22:59:32 2009  Arnold D. Robbins  <arnold@skeeve.com>
2287
2288         * eval.c (func_call): Save nloops_active; if after function returns
2289         the actual nloops_active is greater than the saved value, it means
2290         there was a return inside the loop body, so pop off the necessary
2291         number of loops.  Bug reported by Aleksey Cheusov <a.cheusov@gmail.com>.
2292         Gawk was not leaking memory - that is, things were still pointed
2293         to, but memory use could keep on growing.
2294
2295 Fri Mar 27 10:59:11 2009  Arnold D. Robbins  <arnold@skeeve.com>
2296
2297         * builtin.c (format_tree): Add lint warnings for fieldwidth and/or
2298         precision in %%, and add lint warning for unknown format specifier
2299         (e.g. %b). Thanks to "joanes.polus" <joanes.polus@laposte.net> for
2300         the report.
2301
2302 Wed Mar 18 18:15:41 2009        Pat Rankin      <rankin@pactechdata.com>
2303
2304         * awk.h (EXIT_SUCCESS, EXIT_FAILURE): Move VMS-specific values
2305         to vms/vms-conf.h.
2306         (EXIT_FATAL): Define here instead of in msg.c.
2307         * msg.c (EXIT_FATAL): Move definition to awk.h.
2308
2309 Mon Mar 16 18:58:09 2009        Pat Rankin      <rankin@pactechdata.com>
2310
2311         * main.c [#if HAVE_SIGSEGV_H]: For the #else case (VMS),
2312         (stackoverflow_context_t): Dummy typedef for use in prototypes;
2313         (stackoverflow_install_handler): Make macro expand to 0 rather
2314         than nothing so that (void) cast on invocation of it works.
2315
2316         * main.c (catchstackoverflow): Don't return 0 from void function.
2317
2318 Wed Feb 25 21:34:14 2009  Arnold D. Robbins  <arnold@skeeve.com>
2319
2320         * awkgram.y (tokentab): Have only one copy of BEGIN / END.
2321         (tokcompare): New function.
2322         (check_special): Sort tokentab for EBCDIC systems.
2323
2324 Sun Feb 15 22:39:30 2009  Arnold D. Robbins  <arnold@skeeve.com>
2325
2326         * profile.c (pp_delete): Print tree->exec_count to actually get
2327         the value printed. Thanks to Hermann Peifer <peifer@gmx.eu>
2328         for reporting the bug.
2329
2330 Thu Feb 12 21:54:34 2009  Arnold D. Robbins  <arnold@skeeve.com>
2331
2332         * awkgram.y: Change to use EXIT_FAILURE.
2333         * msg.c [EXIT_FATAL]: New macro.
2334         * msg.c (r_fatal): Change to use EXIT_FATAL.
2335         Thanks to Pat Rankin for pointing these out.
2336         * re.c (reflags2str): Account for RE_SYNTAX_EMACS.
2337         * awk.h: If not VMS, define HAVE_SIGSEGV_H.
2338         * main.c: Check HAVE_SIGSEGV_H before including <sigsegv.h>. If not
2339         there, define dummy macros.
2340         (catchsegv, catchstackoverflow): Remove unneeded comment. Add return 0
2341         for compilers that care.
2342
2343 Mon Feb  9 05:24:52 2009  Arnold D. Robbins  <arnold@skeeve.com>
2344
2345         * awk.h [CONST]: Renamed CONSTANT to avoid conflict with libsigsegv
2346         on Windows.
2347         * awkgram.y, field.c, re.c: Update all uses.
2348
2349 Tue Feb  3 22:46:59 2009  Arnold D. Robbins  <arnold@skeeve.com>
2350
2351         * io.c (do_close): Wrap updating of ERRNO in check for not
2352         do_traditional.
2353
2354 Sat Jan 31 23:14:00 2009  Arnold D. Robbins  <arnold@skeeve.com>
2355
2356         * builtin.c (format_tree): For '%s', don't count the multibyte
2357         characters if we are just copying all the characters. Gives
2358         big speedup. Thanks to Hirofumi Saito <hi_saito@yk.rim.or.jp>
2359         for reporting the problem.
2360
2361 Thu Jan 29 21:14:30 2009  Arnold D. Robbins  <arnold@skeeve.com>
2362
2363         * field.c (parse_field, re_parse_field, def_parse_field,
2364         posix_def_parse_field, null_parse_field, sc_parse_field,
2365         fw_parse_field): Add new last arg `in_middle'.  Ignored by all
2366         except re_parse_field.
2367         (re_parse_field): Enhance logic to only allow ^ in a regex to match
2368         if indeed at the beginning of a record.
2369         (getfield): Adjust call to parse_field.
2370
2371 Tue Jan 27 21:42:47 2009  Arnold D. Robbins  <arnold@skeeve.com>
2372
2373         Changes suggested by Toni Schilling <Schilling@equicon.de>,
2374         as modified by feedback from Pat Rankin, and some help
2375         from me.
2376
2377         * awk.h [WEXITSTATUS]: Improve definition for MSC and VMS.
2378         [EXIT_SUCCESS, EXIT_FAILURE]: Define if they aren't.
2379         * io.c, main.c, profile.c: Switch to using EXIT_xxx instead of
2380         0 and 1.
2381         (main): Use constants instead of 0/1 for exit_val variable.
2382         * eval.c (interpret): Map exit value from `exit' statement into
2383         success / fail constants for VMS for exit_val variable.
2384
2385 Tue Jan 20 07:35:34 2009  Arnold D. Robbins  <arnold@skeeve.com>
2386
2387         * regex.h: Define __USE_GNU if not _LIBC; needed for non-GLIBC
2388         systems such as, oh say, Mac OS X.
2389
2390 Tue Jan 13 09:23:40 2009  Arnold D. Robbins  <arnold@skeeve.com>
2391
2392         * regex.c, regex_internal.h: Remove some changes that are no
2393         longer needed after sync with GLIBC.
2394
2395 Mon Jan 12 22:27:10 2009  Arnold D. Robbins  <arnold@skeeve.com>
2396
2397         Bi-annual sync with GLIBC.
2398
2399         * regexec.c, regex.h, regex_internal.c, regcomp.c, regex_internal.h,
2400         regex.c: Reapply any portability patches specific to gawk.
2401         * getopt.c: Sync with GLIBC.
2402
2403         Base versions:
2404                 getopt.c                1.57    Thu Jan  8 20:02:05 2009                
2405                 getopt.h                1.21    Fri Mar 19 00:19:32 2004                
2406                 getopt1.c               1.10    Tue Mar  9 10:35:37 2004                
2407                 getopt_int.h            1.1     Tue Mar  9 10:31:19 2004                
2408                 regex.c                 1.129   Tue Sep  6 20:49:44 2005                
2409                 regexec.c               1.99    Thu Jan  8 20:02:06 2009                
2410                 regexec.c               1.99    Thu Jan  8 20:02:06 2009                
2411                 regex.h                 1.43    Wed Jan 16 10:09:47 2008                
2412                 regex_internal.c        1.69    Thu Jan  8 20:02:06 2009                
2413                 regex_internal.h        1.76    Thu Jan  8 20:02:06 2009                
2414                 regcomp.c               1.120   Thu Jan  8 20:02:06 2009                
2415
2416 Mon Jan  5 23:07:58 2009  Arnold D. Robbins  <arnold@skeeve.com>
2417
2418         * io.c (devopen): Add a retry to calls to socketopen. Tunable
2419         via undocumented GAWK_SOCK_RETRIES environment variable. Based
2420         on code from Juergen Kahrs <Juergen.Kahrs@vr-web.de> after a
2421         suggestion from Hermann Peifer <peifer@gmx.eu>.
2422
2423 Mon Jan  5 22:48:39 2009  Arnold D. Robbins  <arnold@skeeve.com>
2424
2425         * io.c (redirect): A getline from a directory is no longer
2426         fatal; instead it returns -1. Thanks to Paolo <oopla@users.sf.net>
2427         for the report.
2428
2429 Mon Dec 29 22:04:57 2008  Arnold D. Robbins  <arnold@skeeve.com>
2430
2431         * builtin.c (format_tree): Case for 's', improve logic for setting
2432         the number of characters to copy, also at pr_tail. Based on
2433         bug report by Hermann Peifer <peifer@gmx.net>.
2434
2435 Thu Dec 11 21:23:50 2008  Arnold D. Robbins  <arnold@skeeve.com>
2436
2437         * builtin.c (do_length): If the wide string has zero length
2438         but the bytes are more than zero, use the number of bytes.
2439         (do_index): Similar also: fall back to byte count if the
2440         bytes don't make a wide-character string.
2441         Bug reported by "Carlos G." <charlie.brown.uy@gmail.com>
2442
2443         (do_substr): If defaulting to length of rest of the string,
2444         do it based on the wide char string if it's valid.
2445
2446 Fri Dec  5 11:12:11 2008  Arnold D. Robbins  <arnold@skeeve.com>
2447
2448         * io.c (free_rp): New function.
2449         (redirect): Improved logic for yesterday's change, including
2450         use of free_rp.
2451         (close_redir): Use free_rp.
2452
2453 Thu Dec  4 22:35:05 2008  Arnold D. Robbins  <arnold@skeeve.com>
2454
2455         * io.c (redirect): Only put the new struct redirect into
2456         the list if the file or pipe could actually be opened. Fixes
2457         a bug with the wrong return value of close, noticed by
2458         Seb <sbb@tuxfamily.org>.
2459         * dfa.c (parse_bracket_exp_mb): Don't zero out work_mbc->chars
2460         after we malloc'ed it. Fixes a leak found by valgrind when
2461         using UTF-8.  (Hmmm. This got fixed in January 2007; It seems
2462         to have crept back into the code in the August 2007 merge with
2463         GNU grep. Sigh.)
2464
2465 Mon Oct 20 11:47:59 2008  Arnold D. Robbins  <arnold@skeeve.com>
2466
2467         * configure.ac: Add -g3 and -gdwarf-2 to CFLAGS if compiling with
2468         GCC and doing development. Should have done this ages ago.
2469
2470 Sun Aug 31 22:03:55 2008  Arnold D. Robbins  <arnold@skeeve.com>
2471
2472         * eval.c (set_BINMODE): Tighten up the code even more so
2473         that it matches the documentation.
2474
2475 Mon Aug 25 22:41:47 2008  Arnold D. Robbins  <arnold@skeeve.com>
2476
2477         * eval.c (set_BINMODE): Tighten up the code to only allow
2478         certain reasonable values when setting BINMODE.
2479
2480 Fri Aug 22 14:43:49 2008  Arnold D. Robbins  <arnold@skeeve.com>
2481
2482         * io.c (nextfile): Users Strong In The Ways Of The Source can use
2483         non-existant files on the command line without it being a fatal error.
2484
2485 Wed Jul 30 23:10:51 2008  Arnold D. Robbins  <arnold@skeeve.com>
2486
2487         * re.c (research): Don't ever use DFA if need_start. It can
2488         break on some weird cases.  Reported by
2489          "T. X. G." <leopardie333@yahoo.com>.
2490
2491 Wed Jul 30 22:27:20 2008  Arnold D. Robbins  <arnold@skeeve.com>
2492
2493         * builtin.c (do_match): Add MAYBE_NUM flag to elements of array
2494         created by `match' since data could come from user. Similar
2495         semantics to `split'. Thanks to Dr. Dirk Zimoch <dirk.zimoch@psi.ch>
2496         for reporting the bug.
2497
2498 Tue Jun 24 07:44:06 2008  Arnold D. Robbins  <arnold@skeeve.com>
2499
2500         * dfa.c (insert): Reworked for significant speed improvement
2501         by Johan Walles <johan.walles@gmail.com>. Imported from grep
2502         bug list.
2503         * profile.c (tree_eval): Do a return after all the built-in
2504         variables instead of a break. Thanks again to Hermann Peifer
2505         <peifer@gmx.eu> for finding the problem.
2506
2507 Sun Jun 22 23:08:14 2008  Arnold D. Robbins  <arnold@skeeve.com>
2508
2509         * node.c (format_val): Restore old code to use %ld when the value
2510         is within the range of a long; improves performance noticably for
2511         applications that convert integers to strings.  Use %.0f only for
2512         integral values that are outside the range of a long. Thanks to
2513         Hermann Peifer <peifer@gmx.eu> for pointing out the existence
2514         of a problem.
2515
2516 Fri May 23 12:08:24 2008  Arnold D. Robbins  <arnold@skeeve.com>
2517
2518         * dfa.c (epsclosure): Change type of `visited' from int to char for
2519         potential speedup. Based on bug report to bug-grep list from
2520         Johan Walles <johan.walles@gmail.com>.
2521
2522 Wed May 14 05:55:48 2008  Arnold D. Robbins  <arnold@skeeve.com>
2523
2524         * builtin.c (format_tree): For `%c' case, add a lint warning
2525         if the value is greater than 255.
2526         (mbc_byte_count, mbc_char_count): Remove unused variable `i'.
2527
2528 Thu Apr 24 20:31:03 2008  Bruno Haible       <bruno@clisp.org>
2529
2530         * main.c (main): Move call to catch SIGBUS to before installation of
2531         libsigsegv handler, since on some systems libsigsegv installs its
2532         own handler for SIGBUS.
2533         [STACK_SIZE]: Add a constant instead of inline. ADR.
2534
2535 Wed Apr 23 22:30:27 2008  Duncan Moore       <duncan.m00re@btinternet.com>
2536
2537         * builtin.c (state): Do as an integer array for systems that need it.
2538         (do_rand, init_rand): Modify call to `initstate' as needed.
2539
2540 Wed Apr 23 22:22:06 2008  Arnold D. Robbins  <arnold@skeeve.com>
2541
2542         * dfa.c (prednames): Add an extra zero to final initializer to
2543         silence a compiler warning. Reported by Duncan Moore
2544         <duncan.m00re@btinternet.com>.
2545
2546 Wed Apr 23 21:36:06 2008  Steffen Schuler    <schuler.steffen@googlemail.com>
2547
2548         * field.c (fw_parse_field): Add code for multibyte case.
2549
2550 Sat Mar 15 22:17:21 2008  Arnold D. Robbins  <arnold@skeeve.com>
2551
2552         * builtin.c (do_length): Handle the case of the parameter being
2553         an array that was a function parameter.
2554
2555 Tue Mar 11 22:49:11 2008  Kimura Koichi      <kimura.koichi@canon.co.jp>
2556
2557         * builtin.c (format_tree): Fix call to mbc_byte_count to pass the
2558         right number of characters based on the format type.
2559
2560 Tue Mar 11 22:31:58 2008  Arnold D. Robbins  <arnold@skeeve.com>
2561
2562         * libsigsegv: Incorporated into the dist.
2563         * Makefile.am (SUBDIRS): Added. Make it first so that the library
2564         is built before gawk is.
2565         (LDADD): Add the library.
2566         (AM_CPPFLAGS): Add -I option to find <sigsegv.h> header.
2567         * configure.ac: Add call to AC_CONFIG_SUBDIRS for libsigsegv.
2568         * main.c (catchsegv, catchstackoverflow): New functions.
2569         (main): Call into sigsegv library with them.
2570
2571 Tue Mar  4 21:02:25 2008  Arnold D. Robbins  <arnold@skeeve.com>
2572
2573         * builtin.c (mbc_char_count, mbc_byte_count): New functions to return
2574         the number of m.b. chars there are and the number of bytes needed to
2575         copy them.
2576         (format_tree): Use them for %s and %c cases to adjust precision and
2577         for copying characters at pr_tail label.
2578
2579 Thu Feb 14 14:05:01 2008  Arnold D. Robbins  <arnold@skeeve.com>
2580
2581         * main.c (init_args): Adjust type of third arg to remove warning from
2582         GCC 4.2, add cast in call to make_string.  Bleah.
2583
2584 Fri Jan 25 12:13:39 2008  Dave Pitts         <dpitts@cozx.com>
2585
2586         * README_d/README.zos: New file.
2587         * Makefile.am: Add sed on y.tab.c to convert older Bison "parse error"
2588         messages to "syntax error" messages.
2589         * configure.ac: Added ZOS_USS changes.
2590         * m4/arch.m4: Added ZOS_USS changes.
2591         * m4/inttypes_h.m4: Added ZOS_USS changes.
2592         * m4/inttypes.m4: Added ZOS_USS changes.
2593         * m4/stdint_h.m4: Added ZOS_USS changes.
2594         * awkgram.y: Added USE_EBCDIC changes for EBCDIC collating sequence.
2595         * awk.h: Added ZOS_USS compile changes.
2596         * eval.c: Added EBCDIC casetable and ZOS_USS changes.
2597         * regcomp.c: Added btowc function for ZOS_USS.
2598         * regex.h: Changed __string to __cstring to avoid ZOS_USS header usage.
2599         * regex_internal.h: Added ZOS_USS changes and type defines.
2600
2601 Sun Jan 13 08:16:38 2008  Arnold D. Robbins  <arnold@skeeve.com>
2602
2603         * dfa.c (epsclosure): Replace MALLOC + zero-out-loop with CALLOC for
2604         large potential speedup, based on bug report to bug-grep list from
2605         Johan Walles <johan.walles@gmail.com>.
2606         (dfaanalyze): Made a similar change.
2607
2608 Fri Dec 21 11:22:16 2007  Arnold D. Robbins  <arnold@skeeve.com>
2609
2610         * profile.c (pprint): Add a missing `#ifdef PROFILING'.
2611
2612 Thu Dec 13 22:19:19 2007  Arnold D. Robbins  <arnold@skeeve.com>
2613
2614         * profile.c (parenthesize): Remove "!" from output string.
2615         (tree_eval): Fix quotes for delete array case.
2616         (pp_var): New function, call it as appropriate everywhere else.
2617
2618 Fri Nov 30 11:11:52 2007  Arnold D. Robbins  <arnold@skeeve.com>
2619
2620         * io.c (socketopen): Use NULL as first argument to `getaddrinfo'
2621         if any_remote_host is true. Should help on Non-GLIBC systems.
2622
2623 Thu Nov 15 22:01:36 2007  Arnold D. Robbins  <arnold@skeeve.com>
2624
2625         * io.c (two_way_open): Case for ptys. Change search for letters
2626         to avoid ASCII / EBCDIC problems.
2627
2628 Mon Oct 22 08:49:05 2007  Arnold D. Robbins  <arnold@skeeve.com>
2629
2630         * Release 3.1.6: Release tar file made.
2631
2632 Sun Oct 14 23:19:12 2007  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
2633
2634         * Makefile.am: Avoid GNU make-specific `make -C'.
2635
2636 Sun Oct 14 19:37:01 2007  Arnold D. Robbins  <arnold@skeeve.com>
2637
2638         * configure.ac: Add check for `atexit', needed by replacement
2639         version of `snprintf'.
2640
2641 Sun Sep 30 21:50:59 2007  Arnold D. Robbins  <arnold@skeeve.com>
2642
2643         Rationalize locale's influence on %'g, strtonum, and input.
2644
2645         * awk.h (use_lc_numeric): Add declaration.
2646         * builtin.c (format_tree): Add check for quote_flag and set
2647         LC_NUMERIC so that The Right Thing gets done, then reset it.
2648         (do_strtonum): Pass use_lc_numeric as second arg to isnondecimal.
2649         * main.c (main): Have do_posix set use_lc_numeric also.
2650
2651 Thu Sep 27 21:36:23 2007  Stepan Kasal       <skasal@redhat.com>
2652
2653         * configure.ac: Do not instantiate version.c; remove the hack
2654         to keep version.c from being removed upon `make distclean'.
2655         * Makefile.am (version.c): New rule.
2656         (.c.i, SUFFIXES): Remove, `.i' is unused.
2657         (MAINTAINERCLEANFILES): Remove awkgram.c; Automake takes care of that.
2658
2659 Wed Sep 26 14:40:13 2007  Eli Zaretskii      <eliz@gnu.org>
2660
2661         * builtin.c (format_tree): Handle non-standard snprintf that
2662         returns a negative value when the buffer is too small.
2663
2664 Tue Sep 25 23:27:41 2007  Arnold D. Robbins  <arnold@skeeve.com>
2665
2666         * ChangeLog: Removed all leading spaces. Fixed up formatting of
2667         entries to have capital letter after the colon. Fixed a number of
2668         entries to have the '*' in the right place. ASCII instead of ascii.
2669         Capitalize Linux. (Is this anal-retentive or what? Sheesh.)
2670
2671 Tue Sep 25 08:24:11 2007  KIMURA Koichi      <kimura.koichi@canon.co.jp>
2672
2673         * awk.h: Add include of <io.h> for Visual Studio.
2674         * regex_internal.h: Do the right thing for replacing alloca.
2675
2676 Sat Sep 22 23:26:27 2007  Arnold D. Robbins  <arnold@skeeve.com>
2677
2678         * field.c (set_FIELDWIDTHS): Restore behavior of 3.1.4 that allowed
2679         FIELDWIDTHS to be "" without crashing, and such a value has NF = 0.
2680         Yet Another Dark Corner. Thanks to Glenn Zazulia <gnu@t1.zazu.com>
2681         for pointing out the problem.
2682
2683         Unrelated:
2684
2685         * builtin.c (format_free): Make `quote_flag' not sticky. Thanks to
2686         Ulrich Drepper for pointing this out.
2687         * main.c (main): Adjust calls to `setlocale' and `localeconv' so that
2688         the %'d flag will work even if not using the locale's decimal point.
2689
2690 Thu Sep 20 21:02:41 2007  Arnold D. Robbins  <arnold@skeeve.com>
2691
2692         * array.c (hash, awk_hash, gst_hash_string): Add fourth argument
2693         pointer to retrieve code. Only assign a value if not NULL.
2694         Fix most places to pass NULL for fourth argument.
2695         (assoc_lookup): Save the code in the node for use in growing the
2696         array later.
2697         (grow_table): Use the saved code instead of recomputing each time.
2698         * awk.h (NODE hash): Add `code' member and `ahcode' macro.
2699         (hash): Revise declaration.
2700         * awkgram.y: Revise calls to `hash'.
2701
2702 Tue Aug 21 17:47:07 2007  Arnold D. Robbins  <arnold@skeeve.com>
2703
2704         * main.c (copyleft): Cite version 3 of the license.
2705         * dfa.c: Minor edits to sync with grep 2.5.3.
2706
2707 Sat Aug 11 22:48:11 2007  Arnold D. Robbins  <arnold@skeeve.com>
2708
2709         * COPYING: Replaced with GPL 3.
2710         * All other relevent files: Upgraded to GPL 3.
2711
2712 Fri Aug  3 15:01:38 2007  Andrew J. Schorr <ajschorr@users.sourceforge.net>
2713
2714         * builtin.c (format_tree): Free `obuf' before call to `fatal'
2715         to keep valgrind happy.
2716
2717 Mon Jun  4 01:12:21 2007  Arnold D. Robbins  <arnold@skeeve.com>
2718
2719         * All relevant files: Updated copyright year to 2007.
2720
2721 Mon May 28 08:06:15 2007  Arnold D. Robbins  <arnold@skeeve.com>
2722
2723         * main.c (use_lc_numeric): New variable, true for new
2724         option `--use-lc-numeric'.
2725         (optab): Add option "use-lc-numeric".
2726         (usage): Add to usage message.
2727         (main): Allow the --use-lc-numeric option to also use the
2728         local decimal point.
2729
2730 Fri May 18 16:26:00 2007  Arnold D. Robbins  <arnold@skeeve.com>
2731
2732         * awk.h (_TANDME_SOURCE): Add test for ! _SCO_DS for
2733         SCO systems.  Thanks to John DuBois <spcecdt@armory.com>
2734
2735 Tue May 15 13:14:04 2007  Arnold D. Robbins  <arnold@skeeve.com>
2736
2737         General capability suggested by Michael May <mmlpz@t-online.de>.
2738
2739         * configure.ac: New option --disable-directories-fatal. Makes gawk
2740         silently skip directories on the command line.
2741         * io.c (iop_open): Add fourth parameter, pointer to flag which is set
2742         to true if the file is a directory. In this case, close the fd and
2743         return NULL.
2744         (nextfile): Modify call to iop_open. Add logic to check for directory
2745         and skip if --disable-directories-fatal was used. If the configure flag
2746         was not used, then if do_traditional also skip.
2747         (redirect): Modify call to iop_open and call fatal if isdir is true.
2748
2749 Mon May  7 14:51:54 2007  Arnold D. Robbins  <arnold@skeeve.com>
2750
2751         * POSIX.STD: Updated.
2752
2753 Wed May  2 19:29:56 2007  Stepan Kasal  <kasal@ucw.cz>
2754
2755         Revert precedence of concatenation and | getline.
2756         From mail dated 2005-10-31.
2757
2758         * awkgram.y (common_exp): Move the two rules for naked regexp and
2759         the rule for "(...) in arr" to ...
2760         (non_post_simp_exp): ... here ...
2761         (simp_exp): ... and here, respectively. Fixes test/parsefld.awk/.
2762         (simp_exp_nc): New nonterminal, needed to fix the
2763         precedence of concatenation over "|getline".
2764         (common_exp): Can also start with simp_exp_nc.
2765
2766 Tue May  1 19:53:11 2007  Arnold D. Robbins  <arnold@skeeve.com>
2767
2768         Work around problem with /ab{0}c/.
2769         * dfa.h (struct dfa): Add member `broken'.
2770         * dfa.c (dfainit): Initialize it to false.
2771         (lex): Set it if `minrep == maxrep && minrep == 0'.
2772         * re.c (avoid_dfa): Check flag and return TRUE if set.
2773
2774 Tue May  1 05:34:53 2007  Arnold D. Robbins  <arnold@skeeve.com>
2775
2776         * configure.ac: Add calls to AM_LANGINFO_CODESET, and gt_LC_MESSAGES.
2777         Thanks to Matthew Burgess <matthew@linuxfromscratch.org>.
2778
2779 Sun Apr 29 22:55:12 2007  Arnold D. Robbins  <arnold@skeeve.com>
2780
2781         * regcomp.c (utf8_sb_map): Remove const if not __GNUC__ >= 3.
2782         * regex_internal.h (re_dfa_t): Bracket bizarre macro call with
2783         check for _LIBC.
2784         Thanks to Nelson Beebe for finding both problems.
2785
2786 Sun Apr 29 13:10:31 2007  Arnold D. Robbins  <arnold@skeeve.com>
2787
2788         * builtin.c (do_strftime): Add optional third argument to strftime()
2789         which if non-zero or non-null means to use UTC.
2790         * awkgram.y (tokentab): Allow three arguments to strftime.
2791
2792 Fri Apr 27 11:44:27 2007  Arnold D. Robbins  <arnold@skeeve.com>
2793
2794         * README.cvs, bootstrap.sh: Added to CVS archive, not for
2795         inclusion in tarballs.
2796
2797 Fri Apr 20 16:48:30 2007        Pat Rankin      <rankin@pactechdata.com>
2798
2799         * awk.h: Move inclusion of redirect.h before HAVE_func blocks.
2800
2801 Tue Apr 24 21:55:36 2007  Arnold D. Robbins  <arnold@skeeve.com>
2802
2803         * re.c (research): In the multibyte case, fall back to the full
2804         matcher if need_start, since there are bugs in the dfa matcher
2805         in some obscure cases.  Sigh.
2806         * builtin.c (format_tree): When using %.0f instead of %d, assert
2807         that we're not malloc-ing zero.
2808
2809 Tue Apr 17 21:51:40 2007  Arnold D. Robbins  <arnold@skeeve.com>
2810
2811         Portability fixes for lsbcc from Nelson Beebe.
2812
2813         * configure.ac: Check for stddef.h header.
2814         * regex.h: Use check and include header to get size_t definition.
2815         * main.c: Update UPDATE_YEAR, add #ifdef for HAVE_MTRACE.
2816
2817 Tue Apr 17 13:49:13 2007  Arnold D. Robbins  <arnold@skeeve.com>
2818
2819         * configure.ac: Add test for struct sockaddr_storage.
2820         * io.c: Add macro to redefine sockaddr_storage as sockaddr.
2821
2822 Tue Apr 17 05:45:19 2007  Arnold D. Robbins  <arnold@skeeve.com>
2823
2824         * io.c (get_a_record): Make it static, to match declaration at the
2825         top of the file.  (Thank you GCC for not reporting this. Grr.)
2826
2827 Fri Apr 13 00:29:24 2007  Arnold D. Robbins  <arnold@skeeve.com>
2828
2829         * replace.c: Only include missing/getaddrinfo.c if HAVE_SOCKETS
2830         is defined. Avoids problems on VMS. Thanks to Pat Rankin.
2831
2832 Tue Apr 10 18:53:04 2007  Arnold D. Robbins  <arnold@skeeve.com>
2833
2834         * awkgram.y, builtin.c, eval.c, ext.c, field.c, io.c,
2835         node.c: Added some sanity to the lint warnings, to only
2836         print them once if they are syntactic or of the type where
2837         they don't need to be repeated. Switch to `short' instead
2838         of `int', and in general use a variable named `warned', for
2839         consistency.
2840
2841 Sun Apr  8 16:49:28 2007  Arnold D. Robbins  <arnold@skeeve.com>
2842
2843         * awkgram.y: Add guard code to ifdef out "signed" for VMS. Thanks for
2844         the heads-up to Pat Rankin.
2845         * regcomp.c (utf8_sb_map, init_dfa): Move non-GCC code to initialize
2846         this array into code, to preserve word-size independance.
2847         * configure.ac: Add check for <arpa/inet.h>.
2848         * io.c: Include <arpa/inet.h> if we have it, instead of keyed off
2849         Tandem, needed on some Unix systems.
2850         * awk.h, main.c, msg.c, awkgram.y: Move to use of CAN_USE_STDARG_H
2851         instead of continuously repeating check for header and defined STDC
2852         and STDC. Thanks to Pat Rankin.
2853
2854 Fri Apr  6 15:28:09 2007  Arnold D. Robbins  <arnold@skeeve.com>
2855
2856         * builtin.c (do_length): Only print `length(array)' lint warning once.
2857         * node.c (dump_wstr): Restore from being ifdef'ed out. Useful in case
2858         it needs to be called from a debugger.
2859         * regcomp.c (utf8_sb_map): Fix gcc-specific code.
2860         * awk.h (snprintf): Add declaration in case not available on the system.
2861         (Ceil, Floor): Add macros changing the name for VMS, in an attempt to
2862         fix linkage problems.
2863         * io.c: Simplify includes for internet headers and for getaddrinfo
2864         defines.
2865
2866 Wed Apr  4 23:38:24 2007  Arnold D. Robbins  <arnold@skeeve.com>
2867
2868         * io.c [AI_ADDRCONFIG]: Add a definition in case it's not available.
2869         * main.c (usage): Add comment for translators to add translation
2870         bug report address.
2871
2872 Wed Apr  4 18:26:45 2007        Pat Rankin      <rankin@pactechdata.com>
2873
2874         * regexec.c (build_trtrable): Add missing #if HAVE_ALLOCA.
2875
2876 Thu Mar 29 19:30:20 2007        Pat Rankin      <rankin@pactechdata.com>
2877
2878         * re.c (make_regexp): Cast casetable to RE_TRANSLATE_TYPE.
2879
2880 Mon Mar 19 12:35:00 2007  Arnold D. Robbins  <arnold@skeeve.com>
2881
2882         Finish removing references to STRTOD_NOT_C89.
2883
2884         * awk.h (gawk_strtod): Use now if there is no strtod.
2885         * replace.c (strtod.c): Include if there is no strtod.
2886         * configure.ac [GAWK_AC_FUNC_STRTOD_C89]: Removed.
2887
2888 Mon Mar 19 12:17:16 2007  Kimura Koichi    <kimura.koichi@canon.co.jp>
2889
2890         * dfa.c (dfaexec): Add check for half-width katakana characters in
2891         character classes in ShiftJIS locale.
2892         From mail originally sent Mon, 01 Aug 2005 09:07:55 +0900
2893
2894 Fri Mar  9 11:53:25 2007  Arnold D. Robbins  <arnold@skeeve.com>
2895
2896         * field.c (rebuild_record): Assert that wide string is off when
2897         creating new fields. Inspired by Karel Zak.
2898
2899 Fri Mar  9 11:26:01 2007  Matthew Woehlke   <mwoehlke@tibco.com>
2900
2901         * io.c (get_a_record): Limit the max amount read to SSIZE_MAX. Needed
2902         on Tandem systems where this amount is incredibly small.
2903
2904 Tue Mar  6 08:17:49 2007  Paul Eggert  <eggert@cs.ucla.edu>
2905
2906         * node.c (is_ieee_magic_val): Don't rely on strncasecmp; it mishandles
2907         ASCII bytes in some locales.
2908         (get_ieee_magic_val): Use strtod if it works, relying on our handbuilt
2909         code only if it doesn't work.  This is more likely to do the right
2910         thing with strings like "-nan".
2911
2912 Tue Feb 27 20:51:29 2007  Arnold D. Robbins  <arnold@skeeve.com>
2913
2914         * configure.ac (AM_PROG_CC_STDC): Removed, per email suggestion
2915         from Stepan Kasal some time ago.
2916
2917 Tue Feb 27 20:44:07 2007  Aleksey Cheusov    <vle@gmx.net>
2918
2919         * awk.h: Revise checks for MEMCPY_ULONG and MEMSET_ULONG
2920         for MS Interix using MSVC.
2921         * configure.ac (AC_CHECK_FUNCS): Add checks for memcopy_ulong
2922         and memset_ulong.
2923         From mail dated Tue Aug 30 12:38:39 2005.
2924
2925 Mon Feb 26 12:47:10 2007  Tony Leneis        <tleneis@cvrreg.com>
2926
2927         * dfa.c (dfacomp): Check that regexp is non-zero in length
2928         also. Avoids problems with empty regex and IGNORECASE on
2929         systems where `malloc(0)' returns a non-NULL pointer.
2930         From mail dated Wed, 26 Oct 2005 15:42:07 -0700.
2931
2932 Wed Feb 21 10:23:12 2007  Arnold D. Robbins  <arnold@skeeve.com>
2933
2934         * floatcomp.c (Floor, Ceil): Restore correct expression for Cray.
2935         Then ifdef out the whole business, since it's likely to be obsolete.
2936         Thanks to Paul Eggert.
2937
2938 Mon Feb 19 12:28:47 2007  Arnold D. Robbins  <arnold@skeeve.com>
2939
2940         * node.c (format_val): Simplify code: always format the value
2941         ourselves. Use %.0f if the value is integral.
2942         * floatcomp.c (dval_out_of_range): Remove function, not needed.
2943         (awknum_fraction_bits): Removed.
2944         (adjust_uint): New function, defined IFF have uintmax_t.
2945         * builtin.c (tmp_integer): Use adjust_uint.
2946         Move include of <inttypes.h> and <stdint.h> ...
2947         * awk.h: to here.
2948         (awknum_fraction_bits): Removed.
2949         (adjust_uint): Declare, or define as do-nothing macro.
2950
2951 Sun Feb 18 17:43:33 2007  Arnold D. Robbins  <arnold@skeeve.com>
2952
2953         * node.c, floatcomp.c: Add include of <math.h> to get
2954         correct declarations of math functions.
2955         * configure.ac: If doing development, add -DYYDEBUG and also
2956         -fno-builtin for GCC.
2957
2958 Wed Feb 14 19:42:08 2007  Arnold D. Robbins  <arnold@skeeve.com>
2959
2960         Add support for special infinity and NaN values in non-POSIX
2961         mode, and in POSIX mode, just call system `strtod'.
2962
2963         * configure.ac [GAWK_AC_FUNC_STRTOD_C89]: Comment out.
2964         * node.c (is_ieee_magic_val, get_ieee_magic_val): New functions.
2965         (r_force_number): Adapt logic and use new functions.
2966
2967 Tue Feb 13 13:02:32 2007  Arnold D. Robbins  <arnold@skeeve.com>
2968
2969         Move Paul's numeric stuff to a separate file to make code cleaner.
2970
2971         * floatcomp.c (awknum_fraction_bits): New variable.
2972         (Floor, Ceil): Functions, moved here from macros in builtin.c.
2973         (dval_out_of_range): New function for checking if double is in range
2974         of long.
2975         (FLT_RADIX, FLT_MANT_DIG, DBL_MANT_DIG, AWKSMALL_MANT_DIG,
2976         AWKNUM_MANT_DIG, AWKNUM_FRACTION_BITS): Moved here from awk.h.
2977         * awk.h: Add decls of stuff now in floatcomp.c.
2978         * Makefile.am[base_sources]: Add floatcomp.c.
2979         * builtin.c (tmp_integer): Refer to `awknum_fraction_bits'
2980         instead of AWKNUM_FRACTION_BITS.
2981         * node.c (format_val): Call `dval_out_of_range' instead of
2982         inline coding the test.
2983
2984 2007-02-06  Paul Eggert  <eggert@cs.ucla.edu>
2985
2986         * node.c (format_val): Fix bug when handling numbers close to
2987         LONG_MIN and LONG_MAX.
2988         * awk.h (FLT_RADIX, FLT_MANT_DIG, DBL_MANT_DIG, AWKSMALL_MANT_DIG,
2989         AWKNUM_MANT_DIG, AWKNUM_FRACTION_BITS): Moved here from builtin.c.
2990         * builtin.c: Move those macros to awk.h.
2991         * awk.h (DBL_FRACTION_BITS): New macro.
2992
2993 Fri Feb  9 13:40:10 2007  Matthew Woehlke    <mw_triad@users.sourceforge.net>
2994
2995         More Tandem fixes.
2996
2997         * configure.ac: Check in Tandem's zrldsrl library for dlopen.
2998         * regex_internal.h: Move <alloca.h> include into ifdef.
2999         * regexec.c: Bracket alloca uses. Fix GCC use of `?:'.
3000
3001 Fri Feb  9 13:30:15 2007  Arnold D. Robbins  <arnold@skeeve.com>
3002
3003         * replace.c: Add include of snprintf.c. Ooops!
3004         * configure.ac: Add check for mkstemp and tmpfile for replacement
3005         snprintf.c.
3006
3007 Tue Feb  6 14:33:51 2007  Arnold D. Robbins  <arnold@skeeve.com>
3008
3009         * node.c (format_val): Restructure a bit to remove need for and
3010         use of goto.
3011
3012 Sun Feb  4 16:35:21 2007  Arnold D. Robbins  <arnold@skeeve.com>
3013
3014         * awkgram.y (field_spec, opt_incdec): New terminals.
3015         (variable): Change definition of field reference to use field_spec.
3016         See test/parse1.awk.
3017
3018 Thu Feb  1 17:38:38 2007  Arnold D. Robbins  <arnold@skeeve.com>
3019
3020         * main.c: Allow YYDEBUG to enable the `-D' option, not just
3021         GAWKDEBUG.
3022
3023 Wed Jan 31 19:30:26 2007  Arnold D. Robbins  <arnold@skeeve.com>
3024
3025         * node.c (format_val): Restore my test for numeric values
3026         being representable, as it includes more conditions than
3027         Andrew's, pending a thorough review of undealt-with emails on
3028         the topic.
3029         * regexec.c (proceed_next_node): Move check for NULL to after
3030         variable declarations inside initial `if'.
3031
3032 Wed Jan 31 19:25:21 2007  Andrew J. Schorr <ajschorr@users.sourceforge.net>
3033
3034         * configure.ac (getaddrinfo): Improve test, since this function
3035         can be in libsocket on some systems.
3036
3037 Mon Jan 29 15:33:10 2007  Andrew J. Schorr <ajschorr@users.sourceforge.net>
3038
3039         * Makefile.am (valgrind): Also call new valgrind-scan target.
3040
3041 Mon Jan 29 12:44:54 2007  Andreas Schwab  <schwab@suse.de>
3042
3043         * dfa.c (copytoks): Adjust index into multibyte csets when
3044         copying an MBCSET token.
3045
3046 Fri Jan 26 20:01:38 2007  Andrew J. Schorr <ajschorr@users.sourceforge.net>
3047
3048         * node.c (format_val): Test whether a numeric value is integral
3049         simply by converting it to long and then back again, and checking
3050         if the value matches.  That's more robust than trying to test
3051         whether the floating-point value is representable as a long.
3052         * builtin.c (format_tree): Fix buffer overflow bug, off-by-one errors
3053         in checking snprintf return codes, and use "%.0f" to implement "%d"
3054         formatting.  For octal or hex formatting, test whether the value
3055         is integral by trying to convert back to floating point and seeing
3056         if the value matches.  This is more robust than trying to test
3057         whether the floating-point value is representable as an integer.
3058
3059 Tue Jan 23 17:49:28 2007  Arnold D. Robbins  <arnold@skeeve.com>
3060
3061         * io.c (socketopen): Initialize socketfd to avoid "may be used
3062         uninitialized" warning.
3063         * regexec.c (regexec, re_search_stub): Removed unused variable `dfa'.
3064         * builtin.c (wide_tolower_toupper): Fix signedness of pointer in
3065         allocation calls and in call to make_str_node.
3066
3067 Mon Jan 22 12:57:19 2007  Kimura Koichi    <kimura.koichi@canon.co.jp>
3068
3069         Deal with halfwidth katakana in SJIS locale inside character ranges.
3070         Based on http://sources.redhat.com/bugzilla/show_bug.cgi?id=1149.
3071         Changes affect non-__LIBC code only.
3072
3073         * regcomp.c (re_compile_fastmap_iter): Handle half-size characters.
3074         * regexec.c (check_node_accept_bytes): Same.
3075
3076 Thu Jan 18 22:19:01 2007  Karel Zak          <kzak@redhat.com>
3077
3078         * node.c (free_wstr): Assert that type is Node_val.
3079
3080 Thu Jan 18 12:18:47 2007  Arnold D. Robbins  <arnold@skeeve.com>
3081
3082         * regcomp.c (re_compile_fastmap_iter): Declare `dfa' to be
3083         be volatile. Fixes valgrind problem with the ignrcase test.
3084         Sheesh.  Gawk should now be valgrind-clean. We hope.
3085
3086 Mon Jan 15 14:28:04 2007  Arnold D. Robbins  <arnold@skeeve.com>
3087
3088         Use getaddrinfo instead of gethostbyname, to handle IPV6
3089         format addresses. Based on patch submitted by
3090         Jan Pazdziora <jpazdziora@redhat.com>.
3091
3092         * configure.ac: Add getaddrinfo to list of checked functions.
3093         * configh.in, configure: Regenerated.
3094         * io.c: Rework includes based on HAVE_GETADDRINFO.
3095         (socketopen): Reworked for getaddrinfo.
3096         (devopen): Modified for new socketopen.
3097         * replace.c: Include getaddrinfo.c if necessary.
3098
3099 Sun Jan 14 12:19:53 2007  Arnold D. Robbins  <arnold@skeeve.com>
3100
3101         * awkgram.y: For bad name in array subscripting, build a
3102         valid node anyway to avoid invalid reads reported by valgrind.
3103         * dfa.c (parse_bracket_exp_mb): Remove assignment of NULL
3104         to work_mbc->chars, was losing data malloc'ed earlier. Thanks
3105         to valgrind.
3106         (state_index): Alway initialize d->states[i].mbps elements to zero.
3107         (dfafree): Free allocated d->states[i].mbps.elems if needed.
3108         * regex.c: Try harder to undef alloca.
3109         * regex_internal.h (__mempcpy): Undef before redefinining for
3110         more recent versions of GLIBC.
3111
3112 Sat Jan 13 22:10:43 2007  Arnold D. Robbins  <arnold@skeeve.com>
3113
3114         * node.c (str2wstr): For count of zero from mbrtowc, set count to 1
3115         and fall through to code that copies. Originally from Paul Eggert.
3116
3117         Unrelated:
3118         * configure.ac: Add call to AC_USE_SYSTEM_EXTENSIONS, should help
3119         on Tandem. This lets us remove AC_AIX and AC_MINIX.
3120
3121         From Matthew Woehlke <mwoehlke@tibco.com> for Tandem:
3122
3123         * awk.h (_TANDEM_SOURCE): Also define _XOPEN_SOURCE_EXTENDED.
3124         * io.c (_TANDEM_SOURCE): Include more headers.
3125
3126 Sat Jan 13 21:53:48 2007  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
3127
3128         * field.c (set_FIELDWIDTHS): Avoid writing one past the end of
3129         the array.
3130         * node.c (r_force_number): Avoid reading uninitialized variable.
3131
3132 Sat Jan 13 21:37:15 2007  Arnold D. Robbins  <arnold@skeeve.com>
3133
3134         * Makefile.am (valgrind): New target based on idea from
3135         Ralf Wildenhues for running valgrind on test suite.
3136
3137 Sat Jan 13 21:24:54 2007  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de> 
3138
3139         Enable more `--lint-old' warnings.
3140         * awkgram.y: Warning about multiple BEGIN or END rules,
3141         `index in array' outside of for loops, multidimensional arrays.
3142         * field.c (set_FS): Warn about regex FS.
3143         * node.c (parse_escape): Warn about `\b', `\f', `\r'. 
3144
3145 Sat Jan 13 20:56:56 2007  Arnold D. Robbins  <arnold@skeeve.com>
3146
3147         * node.c (wcasestrstr): Revert use of continue, reinstate goto.
3148         Thanks to Andrew Schorr.
3149         (free_wstr): Move zeroing of wsptr and wslen and clearing of flag
3150         back outside the if.
3151         * field.c (rebuild_record): In loop that copies fields to new record,
3152         add call to `free_wstr'. This ensures that flag values are correct
3153         and avoids double free later. Thanks to Karel Zak for pointing out
3154         the problem.
3155
3156 Fri Jan 12 14:01:51 2007  Dmitry V. Levin  <ldv@altlinux.org>
3157
3158         * builtin.c (do_match): In addition to "gawk_mb_cur_max > 1" check,
3159         check for positive string length.
3160
3161 Fri Jan 12 13:57:20 2007  Arnold D. Robbins  <arnold@skeeve.com>
3162
3163         Sync with GLIBC. Bi-annual this time.
3164
3165         * regexec.c, regex.h, regex_internal.c, regcomp.c:
3166         Reapply any portability patches specific to gawk.
3167         * regex_internal.h (build_wcs_upper_buffer): Fix return type
3168         in declaration. Reapply any portability patches specific to gawk.
3169         * regex.c: Add definitions for `bool', `true' and `false'.
3170         Define `alloca' to something invalid to keep it from linking
3171         in case a usage of `alloca' slipped through. Reapply any portability
3172         patches specific to gawk.
3173
3174         Base versions:
3175                 getopt1.c       1.10    Tue Mar  9 10:35:37 2004
3176                 getopt.c        1.55    Fri Mar 24 10:59:56 2006
3177                 getopt.h        1.21    Fri Mar 19 00:19:32 2004
3178                 getopt_int.h    1.1     Tue Mar  9 10:31:19 2004
3179                 regex.c         1.129   Fri Mar 24 10:59:57 2006
3180                 regexec.c       1.97    Fri Mar 24 10:59:57 2006
3181                 regex.h         1.40    Mon Sep 25 20:03:05 2006
3182                 regex_internal.c        1.67    Mon Sep 25 20:03:05 2006
3183                 regex_internal.h        1.73    Fri Mar 24 10:59:57 2006
3184                 regcomp.c       1.112   Fri Mar 24 10:59:57 2006
3185
3186 Fri Jan 12 12:28:51 2007  Arnold D. Robbins  <arnold@skeeve.com>
3187
3188         * ABOUT-NLS, INSTALL, Makefile.in, aclocal.m4, config.guess,
3189         config.rpath, config.sub, configh.in, configure, configure.ac,
3190         depcomp, gettext.h, install-sh, missing, mkinstalldirs, ylwrap:
3191         Updated to current autotools, Autoconf 2.61, Automake 1.10,
3192         gettext 0.16.1.
3193
3194 Thu Jan  4 18:23:50 2007  Dmitry V. Levin    <ldv@altlinux.org>
3195
3196         * node.c (free_wstr): Zero wstptr and wstlen only if WSTRCUR
3197         flag is set.
3198         (str2wstr): Replace invalid `free' call with `free_wstr' call.
3199
3200 Thu Jan  4 16:49:21 2007  Arnold D. Robbins  <arnold@skeeve.com>
3201
3202         * builtin.c (do_match): Move freeing of wc_indices to outside if.
3203         Thanks to Sven Wegener <swegener@gentoo.org> for the report.
3204
3205 Thu Dec 21 14:32:13 2006  Arnold D. Robbins  <arnold@skeeve.com>
3206
3207         * main.c (arg_assign): Reassign the '=' only if not initing.
3208         * profile.c (varname): Deleted.
3209         (pp_concat): New function to print concatenations.
3210         (tree_eval): Don't use `varname' anymore. Use `pp_concat'.
3211
3212 Mon Dec 11 12:43:04 2006  Arnold D. Robbins  <arnold@skeeve.com>
3213
3214         * builtin.c (sub_common): Clear numeric flags on result
3215         unconditionally.
3216         * node.c (wcasestr): Replace `goto' with `continue'.
3217
3218 Thu Nov 30 15:54:07 2006  Bruno Haible       <bruno@clisp.org>.
3219
3220         * builtin.c: Change use of HAVE_LC_MESSAGES to defined(LC_MESSAGES).
3221         Bruno suggested only for dcngettext, I did it everywhere (ADR).
3222
3223 Wed Sep  6 02:04:32 2006  Andrew J. Schorr   <aschorr@telemetry-investments.com>
3224
3225         * awkgram.y (get_src_buf): Adjust `source' and `sourceline' to
3226         correctly handle mixed -f and --source options.
3227
3228 Mon Aug 28 21:17:20 2006  Arnold D. Robbins  <arnold@skeeve.com>
3229
3230         * AUTHORS, FUTURES, LIMITATIONS, NEWS, POSIX.STD, PROBLEMS, README:
3231         Added FSF copyright for no other reason than to satisfy the flunkies
3232         running Savannah.
3233         * Makefile.am: Removed `ansi2knr' from AUTOMAKE_OPTIONS also.
3234
3235 Fri Aug 11 15:07:45 2006  Arnold D. Robbins  <arnold@skeeve.com>
3236
3237         * field.c (set_field, rebuild_record, set_record): Remove calls to
3238         `free_wstr' since they're not needed.
3239
3240 Sat Aug  5 22:04:24 2006  Arnold D. Robbins  <arnold@skeeve.com>
3241
3242         * node.c (unref): Call `free_wstr' for fields also. Thanks to
3243         Andrew Schorr.
3244
3245 Tue Jul  4 22:43:05 2006  Arnold D. Robbins  <arnold@skeeve.com>
3246
3247         * eval.c (interpret): Node_assign_concat case: Turn off NUMBER and
3248         NUMCUR flags in result.  Sheesh. Thanks to
3249         <Heiner.Marxen@DrB.Insel.DE> for finding the problem.
3250
3251 Mon Jul  3 22:49:44 2006        Pat Rankin      <rankin@pactechdata.com>
3252
3253         * main.c (load_environ): When AWKPATH is missing from ENVIRON[],
3254         try to find it with getenv("AWKPATH") before resorting to DEFPATH.
3255         Suggested by Galen Tackett.
3256
3257 Mon Jul  3 00:27:59 2006  Arnold D. Robbins  <arnold@skeeve.com>
3258
3259         * io.c (INTERNAL_HANDLE): New constant for use by `iop_alloc'
3260         when allocating an internal IOBUF.
3261         (pidopen, useropen): Use it.
3262         (iop_alloc): Add check for it and just return iop.
3263
3264 Fri Jun 23 15:48:34 2006  Arnold D. Robbins  <arnold@skeeve.com>
3265
3266         * awkgram.y (subn): At end for `do_sprintf' check, verify
3267         that lnode is not NULL before using it to assign through.
3268
3269 Sun Jun 18 22:27:25 2006  Arnold D. Robbins  <arnold@skeeve.com>
3270
3271         Repair internal names like /dev/user, /dev/pid, as well as /dev/fd/N,
3272         which have been broken for a long time but noone noticed.
3273
3274         * io.c (is_internal): New macro to check for internal file like
3275         `/dev/user'.
3276         (spec_setup): Reduce to two parameters, allocate logic is always true.
3277         Add IOP_NO_FREE to flag.
3278         (pidopen, useropen): Return `IOBUF *' instead of int. Fix
3279         logic to test if `iop' parameter is NULL and if so to allocate it.
3280         (specfdopen,): Return `IOBUF *' instead of int. Fix
3281         logic to test if `iop' parameter is NULL and if so to allocate it.
3282         Don't set IOP_NO_FREE in flag.
3283         (iop_open): Remove `IOBUF iob' field from `struct internal' and its use
3284         and the use of `spec_setup' from the code here. Change the check in the
3285         call to the open function to look for NULL.
3286         (get_a_record): Use `is_internal' in initial check for filling the
3287         buffer to not try to call `read' on internal files. If true, set
3288         the IOP_AT_EOF in the flag and return EOF.
3289
3290 Fri Mar 24 13:05:56 2006  Arnold D. Robbins  <arnold@skeeve.com>
3291
3292         * awkgram.y (get_src_buf): Remove function argument types from
3293         declaration of `readfunc' to avoid bugaboos with VMS declaration
3294         of `read' system call.
3295
3296 Fri Mar 10 06:28:23 2006  Arnold D. Robbins  <arnold@skeeve.com>
3297
3298         * awk.h (free_wstr): New declaration if MBS_SUPPORT, empty macro
3299         otherwise.
3300         * node.c (free_wstr): New function, inside MBS_SUPPORT. Frees the wide
3301         string part of a node. Provided so that it can be used consistently
3302         everywhere.
3303         (format_val, r_dupnode, mk_number, make_str_node, unref): Use it.
3304         * builtin.c (sub_common): Call `free_wstr' instead of doing it manually.
3305         * eval.c (r_tree_eval): Same in Node_assign_concat case.
3306         * field.c (set_field, rebuild_record, set_record): Add calls to
3307         `free_wstr'.
3308
3309 Mon Feb 13 22:45:34 2006  Arnold D. Robbins  <arnold@skeeve.com>
3310
3311         * eval.c (r_tree_eval): Node_assign_concat. Release any
3312         wide string value and reset the WSTRCUR flag. Based on
3313         bug report by Karel Zak.
3314
3315 2006-01-03  Paul Eggert  <eggert@cs.ucla.edu>
3316
3317         * Makefile.am (awkgram.c): Use $(AWK), not awk, so that the rule
3318         works on Solaris too (e.g., Solaris 10).  Problem reported by
3319         Andrew J. Schorr.
3320
3321 Mon Dec 19 05:39:46 2005  Arnold D. Robbins  <arnold@skeeve.com>
3322
3323         * node.c (format_val): Account for overlow of conversion
3324         from double to long. Shows up worse on 64-bit systems.
3325
3326 Wed Dec 14 18:57:34 2005  Arnold D. Robbins  <arnold@skeeve.com>
3327
3328         * eval.c (set_BINMODE): Fix logic of test for no numeric value.
3329         Makes `gawk -v BINMODE=1 ...' work again. Thanks to Eli Zaretskii
3330         <eliz@gnu.org> for pointing out the problem.
3331
3332 Wed Oct 19 10:58:27 2005  Arnold D. Robbins  <arnold@skeeve.com>
3333
3334         * main.c (main, arg_init): Only use the locale's decimal
3335         point if do_posix is set. Too many people the world over
3336         have complained about this.
3337
3338 Fri Oct  7 13:54:09 2005  Arnold D. Robbins  <arnold@skeeve.com>
3339
3340         Enhancement to fix from 23 Sept 2005, suggested by Pat Rankin.
3341
3342         * awkgram.y (one_line_close): New function, closes open FILE * used
3343         by `read_one_line'.
3344         (fp): Static FILE * used by `read_one_line' and `one_line_close'.
3345         * awkgram.y (read_one_line): Simplify check for call to `fdopen'.
3346         (get_src_buf): New variable `closefunc' which is a pointer to a
3347         function implementing the `close' system call interface.
3348
3349 Fri Oct  7 13:23:29 2005  Arnold D. Robbins  <arnold@skeeve.com>
3350
3351         * field.c (set_FIELDWIDTHS): Fix off-by-one error in assignment
3352         of sentinel value at end of FIELDWIDTHS array.
3353
3354 Fri Sep 23 16:05:13 2005  Arnold D. Robbins  <arnold@skeeve.com>
3355
3356         * awkgram.y (read_one_line): New function, mainly for debugging,
3357         that reads one line of data at a time to pass back as a buffer.
3358         Emulates the variable-length record filesystem of VMS, where
3359         we first saw the problem fixed here.
3360         (get_src_buf): New variable `readfunc' which is a pointer to a
3361         function implementing the `read' system call interface. Based on
3362         an environment variable, use `read_one_line' instead of `read'
3363         for testing.   Make the test for expanding the buffer smarter,
3364         so that it doesn't grow unnecessarily.
3365
3366         Thanks to Galen Tackett (tackett_galen@bah.com) for reporting
3367         the problem and to Anders Wallin and Pat Rankin for help
3368         tracing and reproducing the problem and testing the fix.
3369
3370 Fri Sep  9 15:06:07 2005  Arnold D. Robbins  <arnold@skeeve.com>
3371
3372         * hard-locale.h (xmalloc): Move declaration to file scope
3373         for non-glibc systems and gcc 4. Thanks to Kito Danya Dietrich
3374         <kito@gentoo.org>.
3375
3376 Thu Aug 25 22:40:40 2005  Arnold D. Robbins  <arnold@skeeve.com>
3377
3378         * regcomp.c (build_range_exp): Avoid `btowc' for single-byte
3379         characters. Fedora Core 2, maybe others, have a broken version
3380         that can't handle values > 127.
3381
3382 Fri Aug 19 16:13:28 2005  Arnold D. Robbins  <arnold@skeeve.com>
3383
3384         * regexec.c (proceed_next_node): Added a band-aid check at the
3385         top of the first `if' to make sure that `mctx->state_log[*pidx]'
3386         isn't NULL.
3387
3388 Fri Aug 12 13:10:33 2005  Arnold D. Robbins  <arnold@skeeve.com>
3389
3390         * io.c (iop_alloc): Only free `iop' if it was malloc'ed in
3391         the first place.
3392
3393 Tue Jul 26 21:46:16 2005  Arnold D. Robbins  <arnold@skeeve.com>
3394
3395         * Release 3.1.5: Release tar file made.
3396
3397 Tue Jul 26 21:44:54 2005  Arnold D. Robbins  <arnold@skeeve.com>
3398
3399         Copyright dates on all relevant files updated to 2005.
3400
3401 Wed Jul  6 17:09:02 2005  Arnold D. Robbins  <arnold@skeeve.com>
3402
3403         Minor cleanups:
3404
3405         * io.c (do_index): Remove unused variables `mbclen', `mbs1' and `mbs2'.
3406         * node.c (wstrstr): Remove unsed variable `j'.
3407         (dump_wstr): `#ifdef' out, not currently needed.
3408         * eval.c (op_assign): Move decl of `t1' and `t2' into a separate block
3409         for the `! HAVE_FMOD' case. Keeps the compiler quiet. Similar for
3410         `ltemp'.
3411
3412 Wed Jul  6 16:51:31 2005  Arnold D. Robbins  <arnold@skeeve.com>
3413
3414         * io.c (close_io): Now takes pointer to boolean parameter indicating
3415         if there was a problem closing standard output or standard error.
3416         Update it in the right places.
3417         * awk.h (close_io): Update the declaration.
3418         * main.c (main): New variable `stdio_problem'. Pass it to `close_io'.
3419         Check the result and exit non-zero if there was a problem.
3420         (usage, version): Print warning message if problems with stdout.
3421
3422         Unrelated:
3423
3424         * main.c (main): For call to `setlocale' for LC_MESSAGES, just use
3425         `#ifdef LC_MESSAGES'.  Per Bruno Haible <bruno@clisp.org>.
3426
3427 Wed Jul  6 16:44:58 2005  Jim Meyering  <jim@meyering.net>
3428
3429         * main.c (init_fds): If any of the STDIN_FILENO, STDOUT_FILENO,
3430         STDERR_FILENO are initially closed, reopen them with permissions
3431         contrary to common usage so that any reasonable attempt to use
3432         them will evoke the same sort of error as reading or writing to
3433         a closed file descriptor would.
3434
3435 Mon Jul  4 09:38:29 2005  Arnold D. Robbins  <arnold@skeeve.com>
3436
3437         More multibyte fixes from Kimura Koichi, <kimura.koichi@canon.co.jp>.
3438
3439         * node.c (format_val, r_dupnode): Spell `wstptr' correctly.
3440         * regex_internal.c (build_wcs_upper_buffer): Label `offsets_needed'
3441         should not be inside `#ifdef _LIBC'.
3442         * regcomp.c (build_charclass): Fix declaration of `class_name' in
3443         prototype to not be unsigned.
3444
3445 Thu Jun 30 11:52:34 2005  Arnold D. Robbins  <arnold@skeeve.com>
3446
3447         * profile.c (tree_eval): Node_not: Remember to print the exclamation
3448         point!  Thanks to Dan Nielsen <Dan.Nielsen@corporate.ge.com>
3449         for the bug report.
3450         * mbsupport.h: Fix spelling of HAVE_ISWUPPER. Thanks to
3451         Kimura Koichi, <kimura.koichi@canon.co.jp>.
3452
3453 Sun Jun 26 16:37:59 2005  Arnold D. Robbins  <arnold@skeeve.com>
3454
3455         Unrelated changes:
3456
3457         * builtin.c (do_length): Allow array argument to length().
3458         Returns number of elements in array.
3459
3460         * awkgram.y (yylex): Ignore carriage returns in source code. Sigh.
3461
3462 Wed Jun 15 22:12:15 2005  Arnold D. Robbins    <arnold@skeeve.com>
3463
3464         * node.c (isnondecimal): Check loc.decimal_point before using it.
3465         Avoids problems with command line assignment when locale info may
3466         not be set up all the way yet.
3467
3468 Wed Jun 15 21:59:54 2005  Arnold D. Robbins    <arnold@skeeve.com>
3469
3470         * node.c (make_str_node): If working with multibyte characters, while
3471         parsing string constants, keep multibyte characters together. This
3472         avoids problems in cases where one of the bytes is backslash. Initial
3473         patch supplied by Kimura Koichi, <kimura.koichi@canon.co.jp>.
3474
3475 Tue Jun 14 21:50:37 2005  Andrew J. Schorr     <ajschorr@users.sourceforge.net>
3476
3477         Use Exponentiation By Squaring for integer powers for ^ and ^=.
3478
3479         * eval.c (calc_exp, cal_exp_posint): New functions.
3480         (r_tree_eval): Use them.
3481
3482 Fri Jun  3 12:15:54 2005  Arnold D. Robbins    <arnold@skeeve.com>
3483
3484         * configure.ac: Further change the hack at the end so that
3485         it works on Mac OS X `sed'. Sigh.
3486
3487 Thu Jun  2 22:44:01 2005  Arnold D. Robbins    <arnold@skeeve.com>
3488
3489         * configure.ac (TYPE_SOCKLEN_T): Use `int' as default type if can't
3490         figure one out.
3491         * awkgram.y: Warn that `//' is not a C++ comment. (:-)
3492
3493 Thu Jun  2 20:55:27 2005  Arnold D. Robbins    <arnold@skeeve.com>
3494
3495         From: Benno Schulenberg <benno@nietvergeten.nl>
3496
3497         * eval.c (func_call): Take message out of gettext call since it's for
3498         debugging.
3499         * ext.c (get_actual_argument): Fix formatting of message.
3500
3501 Wed May 25 09:19:37 2005  Arnold D. Robbins    <arnold@skeeve.com>
3502
3503         * configure.ac: Change hack at end that fixes Makefile to keep
3504         version.c to use `sed' and not `ed'. More portable to OS/2, probably
3505         other systems.
3506
3507 Mon May 23 09:01:26 2005  Arnold D. Robbins    <arnold@skeeve.com>
3508
3509         Portability help from Jim Meyering.
3510
3511         * io.c: Rework ifdefs for <inttypes.h> and <stdint.h>. Test them
3512         individually.
3513         * configure.ac: Add AC_C_RESTRICT and code for socklen_t from rsync.
3514         Check for isascii and btowc for regex.
3515
3516 Sat May 14 22:49:54 2005  Arnold D. Robbins    <arnold@skeeve.com>
3517
3518         * wait_any (errno): Remove decl.
3519         * gawk_popen: The pipe-simulated but not VMS or DOS version. Remove
3520         decl/use of `strdup' in favor of `emalloc' and `strcpy'.
3521
3522 Wed May 11 18:33:30 2005  Arnold D. Robbins    <arnold@skeeve.com>
3523
3524         All files: Updated address of FSF to:
3525
3526         51 Franklin Street, Fifth Floor
3527         Cambridge, MA  02110-1301
3528
3529 Wed May 11 18:19:03 2005  Jim Meyering  <jim@meyering.net>
3530
3531         * configure.ac: Use AM_GNU_GETTEXT([external]).
3532         Reflect upgrade to gettext-0.14.4.
3533         Reflect renaming of `jm_'-prefixed macros.
3534         (AC_CONFIG_FILES): Remove intl/Makefile.
3535
3536         * Makefile.am (SUBDIRS): Remove intl.
3537         (AM_CPPFLAGS): Remove -Iintl.
3538
3539 Wed May 11 11:42:06 2005  Arnold D. Robbins    <arnold@skeeve.com>
3540
3541         Straighten out mess with `isblank' which is C99 <ctype.h> function.
3542
3543         * configure.ac: Remove check for `isblank' in call to AC_CHECK_FUNCS.
3544         * regex_internal.h: #ifdef out definition of `isblank' and provide
3545         `is_blank' function a la dfa.c.
3546         * field.c: Ditto.
3547         * regcomp.c: #ifdef use of `isblank' and add `is_blank' use instead.
3548
3549 Mon May  9 08:29:37 2005  Arnold D. Robbins    <arnold@skeeve.com>
3550
3551         * configure.ac: Add type check for `socklen_t', fixes compile
3552         warning on AMD/64 Linux.
3553         * io.c (socketopen): Change type of socket length variables
3554         to `socklen_t' from `size_t'.
3555
3556 Thu May  5 22:00:03 2005  John E. Haque <j.eh@mchsi.com>
3557
3558         * io.c (iop_alloc): Let an input processor hook installed via
3559         `register_open_hooks' open its own fd in case gawk does not know
3560         how to open it.
3561         (iop_open): Call `os_close_on_exec' after `iop_alloc'.
3562         ADR: If `iop_alloc' returns NULL but the fd is valid, close
3563         the fd to avoid an fd leak.
3564
3565 Mon May  2 08:05:59 2005  Arnold D. Robbins    <arnold@skeeve.com>
3566
3567         * eval.c (update_ERRNO): Don't use `return' in a `void' function.
3568         * awk.h (AWKNUM): Back out use of `long double' based on LDBL_MANT_DIG.
3569         * builtin.c (tmp_integer): Back out extra ifdefs.
3570
3571 Fri Apr 29 13:01:05 2005  Arnold D. Robbins    <arnold@skeeve.com>
3572
3573         * configure.ac: Look for `isblank' function.
3574         * field.c: Add define for `isblank' if we don't have it.
3575
3576 Fri Apr 29 12:01:33 2005  Julian Foad  <julianfoad@btopenworld.com>
3577
3578         From grep.  Doesn't seem to affect awk.
3579
3580         * dfa.c (lex): Fix bug #9519: "echo do^re | grep do^re" was
3581         failing to find a match. [Towards end, set `lasttok' before
3582         returning `c'.]
3583
3584 Fri Apr 29 00:28:46 2005  Arnold D. Robbins    <arnold@skeeve.com>
3585
3586         * configure.ac: Jump through an amazingly convoluted hoop to get
3587         config.status to keep version.c upon `make distclean'. Seems to
3588         work though.
3589
3590 Thu Apr 28 23:40:02 2005  Stepan Kasal  <kasal@ucw.cz>
3591
3592         * configure.ac (PRINTF_HAS_F_FORMAT): Some cosmetic changes.
3593         (custom.h): Don't cat custom.h at the end of config.h; instead, use
3594         AH_BOTTOM([#include "custom.h"])
3595         * awklib/Makefile.am (AM_CPPFLAGS): Add $(top_srcdir) so that
3596         custom.h can be found.
3597
3598 Thu Apr 28 23:21:22 2005  Jim Meyering  <jim@meyering.net>
3599
3600         * field.c (set_FIELDWIDTHS): Tighten up the code to accept FIELDWIDTHS
3601         values in [1..INT_MAX], e.g., detect overflow and invalid strings,
3602         and reject strings starting with `-'.
3603
3604 Thu Apr 28 23:05:33 2005  Stepan Kasal  <kasal@ucw.cz>
3605
3606         * dfa.c (parse_bracket_exp_mb): Shorten one part of the code, to get
3607         closer to grep's copy.
3608
3609 Thu Apr 28 23:00:58 2005  Pat Rankin    <rankin@pactechdata.com>
3610
3611         * builtin.c (format_tree) [#if VAXCRTL]:  For floating point
3612         formatting, reject zero_flag if using old VAXCRTL run-time
3613         library to avoid getting erroneous results which appear as if
3614         numerically incorrect (due to an embedded space in some cases,
3615         extra trailing zeroes in others) rather than just misformatted.
3616         `hsprint' test still fails, but not as badly.
3617
3618 Thu Apr 28 19:12:03 2005  Arnold D. Robbins    <arnold@skeeve.com>
3619
3620         * re.c (reflags2str): Add three new RE_ flags from current regex.h
3621         to bring the table up to date.
3622
3623         * builtin.c (format_tree): Save 2 spare bytes instead of one. Suggested
3624         by Stepan Kasal.
3625
3626 Thu Apr 28 18:16:09 2005  Andrew J. Schorr     <ajschorr@users.sourceforge.net>
3627
3628         * awk.h (IOBUF): Add new fields `opaque', `get_record', and
3629         *close_func', to support insertion of an alternate input processor.
3630         This is used by the XML extension.
3631         (register_deferred_variable, register_open_hook, update_ERRNO_saved):
3632         Declare new functions.
3633         (load_environ, load_procinfo): Remove declarations -- these functions
3634         are no longer global, since we use register_deferred_variable instead.
3635         * awkgram.y (register_deferred_variable): New function to allow
3636         calling code to register special variable names that trigger a callback
3637         upon the first reference.  This is now used to implement ENVIRON
3638         and PROCINFO.
3639         (variable): Search the list of deferred variables instead of hardcoded
3640         tests for ENVIRON and PROCINFO.
3641         * eval.c (set_BINMODE): Fix spelling of "arbitrary" in warning message.
3642         (update_ERRNO_saved): New function that allows the caller to specify
3643         the errno value instead of using the current value.
3644         (update_ERRNO): Implement by calling update_ERRNO_saved(errno).
3645         * io.c (iop_close): Call `iop->close_func' if non-NULL.
3646         (close_redir): Should save `errno' value, otherwise `lintwarn' messages
3647         might update it.  Then use `update_ERRNO_saved' to set ERRNO.
3648         (do_getline): Call `update_ERRNO_saved' to set ERRNO based on the
3649         error code returned by the redirect function (instead of the current
3650         value of errno).  Similarly, use `update_ERRNO_saved' to set ERRNO
3651         based on the value returned by `get_a_record'.  But add a special
3652         check to avoid updating ERRNO if `get_a_record' returns an error
3653         code value of -1 (this is used by the XML extension which already
3654         sets ERRNO before returning).
3655         (register_open_hook): New function to register a function to be
3656         called whenever a new data file is opened.  This can be used to
3657         install a special input processor (as in the XML extension).
3658         (iop_alloc): Call registered open hook.
3659         (get_a_record): If a `get_record' method has been set, call that instead.
3660         * main.c (init_vars): Use `register_deferred_variable' to implement
3661         ENVIRON and PROCINFO.
3662         (load_environ, load_procinfo): Now static instead of global.
3663         * doc/gawk.texi: Document new internal functions `update_ERRNO_saved',
3664         `register_deferred_variable', and `register_open_hook'.
3665
3666 Thu Apr 28 10:50:10 2005  Arnold D. Robbins    <arnold@skeeve.com>
3667
3668         * array.c (assoc_find, do_delete): Change incorrect uses of STREQN
3669         to memcmp.
3670         * builtin.c (do_index): Same.
3671         * field.c (set_FS): Same.
3672         * io.c (redirect, getredirect, do_close, set_RS): Same.
3673         * re.c (reisstring): Same.
3674
3675 Wed Apr 27 21:35:57 2005  Arnold D. Robbins    <arnold@skeeve.com>
3676
3677         Allow for long double. Initial changes from  Jean-Marc Saffroy
3678         <jean-marc.saffroy@ext.bull.net>.
3679
3680         * awk.h (AWKNUM): If have long doubles (LDBL_MANT_DIG), define AWKNUM
3681         as long double, otherwise just use double.
3682         * builtin.c (format_tree): Change type of tmpval to double.
3683         (do_strtonum): Same for `d' and types used in casts.
3684         (tmp_integer): Don't do bit shifting if have long doubles.
3685
3686         Unrelated, from Andrew J. Schorr:
3687
3688         * io.c (close_one): Check for RED_FILE|RED_WRITE, not just RED_FILE.
3689
3690 Mon Apr 25 12:23:18 2005   Andrew J. Schorr     <aschorr@telemetry-investments.com>
3691
3692         * eval.c (r_tree_eval): In Node_assign_concat case, when copying string
3693         constants, include the terminating zero byte.
3694
3695 Fri Apr  1 06:26:31 2005   Arnold D. Robbins    <arnold@skeeve.com>
3696
3697         Update to Automake 1.9.5.
3698
3699         * INSTALL, aclocal.m4, depcomp, install-sh, missing,
3700         mkinstalldirs, ylwrap: Updated.
3701
3702         Unrelated:
3703
3704         * builtin.c (do_tolower, do_toupper): Remove old code
3705         based on 8-bit character table.
3706
3707 Wed Feb 23 08:23:22 2005   Arnold D. Robbins    <arnold@skeeve.com>
3708
3709         * bisonfix.awk: New file, fixes continued #ifdef for dumb compilers.
3710         * Makefile.am (awkgram.c): Fix rule to use it.
3711         (EXTRA_DIST): Include bisonfix.awk.
3712
3713 Tue Feb 22 21:18:50 2005   Arnold D. Robbins    <arnold@skeeve.com>
3714
3715         * random.h: Remove include of config.h and move it to ...
3716         * random.c: Here.  Move include of random.h back to where it was.
3717
3718         * regcomp.c, regex.c, regexec.c: NUKED all use of alloca not inside
3719         `_LIBC' ifdef. Hooray!
3720
3721 Sat Feb 19 20:13:28 2005   Pat Rankin    <rankin@pactechdata.com>
3722
3723         Workarounds for bugs and missing C89 features in old VAX C compiler.
3724
3725         * regex_internal.h "mbsupport.h": Suppress inclusion if NO_MBSUPPORT
3726           is defined.
3727         [MB_CUR_MAX]: Define as 1 if mbsupport.h hasn't defined it.
3728         [ER_ERRMSG, ERRMSG_TYPE, ERRMSG_OFFSET, ERRMSG_SEPARATOR]: New macros
3729           conditionalized upon gawk's NO_TOKEN_PASTING macro.
3730         * regcomp.c: Use them.
3731         (parse_dup_op): Use alternate initialization of start_token if
3732           RE_TOKEN_INIT_BUG is defined.
3733         * regexec.c (proceed_next_node): Compare push_fail_stack() result
3734           explicitly against REG_NOERROR rather than implicitly against 0.
3735
3736 Sat Feb 19 20:05:50 2005   Pat Rankin    <rankin@pactechdata.com>
3737
3738         * dfa.c "mbsupport.h": Suppress inclusion if NO_MBSUPPORT is defined.
3739
3740 Wed Feb 16 20:43:07 2005   Pat Rankin    <rankin@pactechdata.com>
3741
3742         * awk.h "mbsupport.h": Suppress inclusion if NO_MBSUPPORT is defined.
3743         * regex.h <sys/types.h>: Guard inclusion with HAVE_SYS_TYPES_H.
3744         * regex.c <sys/types.h>: Likewise.
3745         * random.c "random.h": Include this first to get config.h setup.
3746           <fcntl.h>: Guard inclusion with HAVE_FCNTL_H.
3747           <unistd.h>: Guard inclusion with HAVE_UNISTD_H.
3748         * io.c [#if defined(MSDOS) ||... defined(__CYGWIN__)]: Splice the
3749           backslash continuation back into one long line.
3750
3751 Wed Feb 16 10:11:21 2005   Arnold D. Robbins    <arnold@skeeve.com>
3752
3753         * node.c (unref, format_val): Add assertions checking that both
3754         `tmp->wstptr != NULL' and `(tmp->flags & WSTRCUR) != 0' before
3755         freeing `tmp->wstptr'. Thanks to kimura.koichi@canon.co.jp.
3756
3757         * random.c (HAVE_UNISTD_H): Conditionalize include of <unistd.h>.
3758         Thanks to Scott Deifik <scottd@amgen.com>.
3759
3760 Sun Feb 13 18:24:50 2005   Arnold D. Robbins    <arnold@skeeve.com>
3761
3762         * io.c (socketopen): Move `#ifdef MSG_PEEK' up to above
3763         declarations too.  Thanks to Michal Jaegermann.
3764
3765         * config.guess, config.sub: Updated from Savannah.
3766
3767 Thu Feb 10 15:48:48 2005   Arnold D. Robbins    <arnold@skeeve.com>
3768
3769         * regex_internal.c (re_dfa_add_node): Remove variable `type'
3770         and just use `token.type' directly in RE_ENABLE_I18N code below.
3771         Saves a compiler warning, and a good compiler will handle it anyway.
3772         * regexec.c (check_arrival_add_next_nodes): Move decl of `err'
3773         inside #ifdef RE_ENABLE_I18N code where it's used.
3774         * awkgram.y (yylex): Add casts to int before use of `strlen' results
3775         for printf-style precision. Avoid a compiler warning.
3776         * io.c (redirect, do_close): Same for use of tmp->stlen.
3777
3778         Thanks to Michal Jaegermann <michal@harddata.com>.
3779
3780 Wed Feb  9 10:19:15 2005   Stepan Kasal  <kasal@ucw.cz>
3781
3782         * Makefile.am (datadir, libexecdir): Removed.
3783         (awkdatadir): Renamed to pkgdatadir.
3784         (pkgdatadir, LDADD): Use the make syntax to refer to other variables,
3785         not @...@.
3786
3787 Wed Feb  9 10:05:46 2005   Arnold D. Robbins    <arnold@skeeve.com>
3788
3789         * node.c (r_dupnode): Assign NULL to r->wstr after `getnode'.
3790         Fix count of bytes to copy in call to `memcpy'.
3791         Thanks to Kimura Koichi, <kimura.koichi@canon.co.jp>.
3792
3793 Tue Feb  8 19:26:22 2005   Pat Rankin  <rankin@pactechdata.com>
3794
3795         * regcomp.c (init_dfa): Avoid strcasecmp() since regex.c doesn't
3796         use awk.h and none of the assorted other included header files
3797         are guaranteed to declare it.
3798         (parse_expression): Modify casts for the string arguments passed to
3799         build_charclass_op() to fix char * vs unsigned char * mismatch.
3800         (parse_bracket_exp): Likewise add cast for the string argument
3801         passed to build_charclass().
3802
3803 Mon Feb  7 15:04:09 2005   Arnold D. Robbins    <arnold@skeeve.com>
3804
3805         * eval.c (make_scalar): Don't use P() macro in definition.
3806         Thanks to Juergen Kahrs <Juergen.Kahrs@barco.com>.
3807
3808 Wed Feb  2 16:36:19 2005   Arnold D. Robbins    <arnold@skeeve.com>
3809
3810         * main.c (main):  Call `close_io', without its result affecting
3811         the exit status.  Super small, super dark corner.
3812
3813         See test/exitval2.awk.
3814
3815 Tue Feb  1 11:58:29 2005   Arnold D. Robbins    <arnold@skeeve.com>
3816
3817         * regex.h (__APPLE_CC__): Removed test and definition of __restrict.
3818         Not needed for current MacOS X compiler.
3819
3820 Sun Jan 30 13:56:37 2005   Arnold D. Robbins    <arnold@skeeve.com>
3821
3822         Fresh merge with CVS regex routines. Fixes handling of \B.
3823         See tests/gnureop3.awk and also
3824         http://sources.redhat.com/bugzilla/show_bug.cgi?id=693.
3825
3826         CVS base versions:
3827
3828         * regcomp.c: Version 1.92, Thu Jan 27 19:05:20 2005.
3829         * regexec.c: Version 1.77, Thu Jan 27 19:06:34 2005.
3830         * regex_internal.c: Version 1.49, Thu Jan 27 19:07:15 2005.
3831         * regex_internal.h: Version 1.60, Wed Jan 26 22:40:50 2005.
3832         * regexec.c: Version 1.77, Thu Jan 27 19:06:34 2005.
3833
3834 Sat Jan 22 22:30:40 2005   Arnold D. Robbins    <arnold@skeeve.com>
3835
3836         Reinstate patch of 18 Nov 2001, for VMS, at least:
3837
3838         * random.c (srandomdev): ifdef-out.  Lots of compile time
3839           problems on multiple platforms, and gawk doesn't even
3840           use the routine.  The heck with fine-grained solutions.
3841
3842 Thu Jan 20 14:15:32 2005   Arnold D. Robbins    <arnold@skeeve.com>
3843
3844         * awkgram.y (LEX_FOR): Free NAME tokens in transformation of
3845         `for (iggy in foo) delete foo[iggy]' into `delete foo'.
3846         Thanks and a tip of the hatlo to Valgrind.
3847
3848         * dfa.c (_): Clean up stuff here by just including "gettext.h".
3849         Per Bruno Haible.
3850
3851 Wed Jan 19 18:29:23 2005   Arnold D. Robbins    <arnold@skeeve.com>
3852
3853         * awkgram.y (yylex): Improve parsing of numeric constants
3854         and hex values, via a push from Paul Eggert. See test/hex.awk.
3855
3856         * regex_internal.c (re_node_set_alloc): If `size' is 0, just
3857         zero out the structure. From valgrind.
3858
3859 Tue Jan 18 17:23:25 2005   Arnold D. Robbins    <arnold@skeeve.com>
3860
3861         Make gawk multibyte aware.  This means that index(), length(),
3862         substr() and match() all work in terms of characters, not bytes.
3863
3864         * awk.h (NODE): Add `wsp' and `wslen' elements to value for wide
3865         string.
3866         (WSTRCUR, wstptr, wstlen, force_wstring): New macros.
3867         (str2wstr, wstrstr, wcasestrstr): New declarations.
3868         * builtin.c (do_index, do_length, do_substr, do_match): Handle wide
3869         strings.
3870         * eval.c (flags2str): Add WSTRCUR.
3871         * node.c (format_val, r_dupnode, mk_number, make_str_node, unref):
3872         Add code to deal with wide strings.
3873         (str2wstr, dump_wstr, wstrstr, wcasestrstr): New functions.
3874
3875 Sun Jan 16 15:10:35 2005   Arnold D. Robbins    <arnold@skeeve.com>
3876
3877         * random.h (int32_t): Define this type.
3878
3879 Thu Jan 13 14:38:13 2005   Arnold D. Robbins    <arnold@skeeve.com>
3880
3881         Cause `configure --disable-nls' to still allow locale-correct
3882         formating of numeric values.
3883
3884         * builtin.c (format_tree): Change #ifdefs to only test HAVE_LOCALE_H.
3885         Improve code for ' flag so that extraneous separator is not included if
3886         number of digits is multiple of locale separater count (3, 6, 9, etc.)
3887         * dfa.c (dfaparse): Change ifdef to only test #ifdef LC_COLLATE.
3888         * eval.c (fmt_ok): Remove ENABLE_NLS from #ifdef test.
3889         * gettext.h: Include <locale.h> on both sides of test. Should really
3890         be factored out.
3891         * main.c (loc): Remove ENABLE_NLS from #ifdef test.
3892         (main): Same in call to localeconv().
3893         * node.c (isnondecimal): Remove ENABLE_NLS from #ifdef test.
3894
3895         Unrelated:
3896
3897         * regcomp.c (init_dfa): Change `codeset' to `codeset_name' in two
3898         places.
3899
3900 Mon Jan 10 11:49:56 2005   Arnold D. Robbins    <arnold@skeeve.com>
3901
3902         Annual sync with glibc.
3903
3904         * getopt_int.h: New file.
3905         * Makefile.am (base_sources): Add it.
3906         * getopt.h, getopt.c, getopt1.c: Updated.
3907         * regcomp.c, regex.c, regex.h, regex_internal.c, regex_internal.h,
3908         regexec.c: Updated.
3909
3910         Original versions:
3911
3912         getopt_int.h, 1.1, Tue Mar 9 10:31:19 2004
3913         getopt1.c, 1.10, Tue Mar 9 10:35:37 2004
3914         getopt.h, 1.21, Fri Mar 19 00:19:32 2004
3915         getopt.c, 1.53, Wed Mar 10 23:13:26 2004
3916         regcomp.c, 1.87, Mon Dec 6 02:56:42 2004
3917         regex.c, 1.126, Fri Jan 30 05:19:58 2004
3918         regex.h, 1.33, Thu Nov 18 23:50:57 2004
3919         regex_internal.c, 1.46, Thu Jan 6 20:59:49 2005
3920         regex_internal.h, 1.57, Mon Dec 27 16:29:05 2004
3921         regexec.c, 1.75, Mon Dec 27 16:29:52 2004
3922
3923         * regex.h: Add check for __APPLE_CC__ and definition of __restrict.
3924         * regex.c: Add check for _MSC_VER and include <stdio.h>.
3925         * regex_internal.h (_RE_ENABLE_I18N): Change test.
3926         (re_realloc): Add check/fix for SunOS 4.1.x.
3927         * regex_internal.c (build_wcs_upper_buffer): ifdef label
3928         `offsets_needed', add cast in call to `wcrtomb'.
3929         * regcomp.c (build_charclass, build_charclass_op): Remove `unsigned'
3930         from declarations of `char *' params.
3931         (regerror): Remove use of mempcpy.
3932         (peek_token): Disallow \s and \S for gawk.
3933         (build_charclass): Change decl of `class_name' and use it directly.
3934         Nuke variable `name'.
3935         (build_charclass_op): Change decl of `class_name' and `extra'.
3936
3937 Thu Jan  6 16:44:32 2005   Arnold D. Robbins    <arnold@skeeve.com>
3938
3939         Improve autoconfiscation stuff for wide character use.
3940
3941         * builtin.c (do_tolower, do_toupper): Conditionally compile
3942         call to `wide_tolower_toupper'.
3943         (wide_tolower_toupper): Conditionally compile typedefs and function.
3944         * mbsupport.h: Add check for having `wint_t', and `iswlower',
3945         `iswupper', `towlower' and `towupper'.
3946         * configure.ac (HAVE_WINT_T): Add test.
3947         (AC_CHECK_FUNCS): Add `wint_t', `iswlower', `iswupper', `towlower'
3948         and `towupper'.
3949
3950         Unrelated change:
3951
3952         * hard-locale.h (hard_locale): Add decl of `xmalloc' to prevent
3953         redeclaration problems on some compilers.
3954
3955 Wed Jan  5 10:20:17 2005   Arnold D. Robbins    <arnold@skeeve.com>
3956
3957         Update to Bison 2.0.
3958
3959         * bisonfix.sed: Removed, no longer needed.
3960         * Makefile.am (EXTRA_DIST): Removed bisonfix.sed.
3961         (awkgram.c): Fix build rule.
3962         * awkgram.c: Regenerated.
3963
3964 Tue Jan  4 18:47:56 2005   Arnold D. Robbins    <arnold@skeeve.com>
3965
3966         Update to Automake 1.9.4.
3967
3968         * alocal.m4, config.guess, config.sub, install-sh: Updated.
3969
3970 Mon Jan  3 14:08:27 2005   Arnold D. Robbins    <arnold@skeeve.com>
3971
3972         Update to Automake 1.9.3.
3973
3974         * INSTALL, alocal.m4, config.guess, config.sub, depcomp,
3975         install-sh, missing, ylwrap: Updated.
3976
3977 Mon Jan  3 11:23:36 2005   Arnold D. Robbins    <arnold@skeeve.com>
3978
3979         Fix obscure issue. ^ in RS should only match at the very
3980         beginning of the input.  Essentially, the file is one long
3981         string.  To do this, use the `not_bol' flag in the `struct
3982         pattern_buffer'.  Thanks to Stepan Kasal for pointing out the
3983         problem and to Andreas Schwab for pointing out the mechanism
3984         for a solution.
3985
3986         * awk.h (RE_NEED_START, RE_NO_BOL): New flags for `research'.
3987         (IOP_AT_START): New flag for IOBUF.
3988         (research): Last parameter is now `flags'.
3989         * builtin.c (do_match, sub_common): Change calls to `research'.
3990         * eval.c (interpret, match_op): Same.
3991         * field.c (re_parse_field): Same.
3992         * io.c (spec_setup): Add IOP_AT_START flag.
3993         (iop_alloc): Same.
3994         (rsrescan): Modify logic to check IOP_AT_START and if not on to
3995         add RE_NO_BOL to flags value in call to `research'.
3996         (get_a_record): Clear IOP_AT_START upon return from `*matchrec'.
3997         (iopflags2str): Add IOP_AT_START to table.  Also IOP_CLOSED,
3998         which was missing. (Ooops.)
3999         * re.c (research): Last paramater is now flags.  Modify logic to
4000         handle RE_NO_BOL case by setting the right bit initially. Clean
4001         up control flow so that it's cleared before returning.  If RE_NO_BOL,
4002         don't bother with the dfa matcher, as it doesn't have an analogous
4003         capability.
4004
4005 Wed Dec 22 12:33:48 2004   Arnold D. Robbins    <arnold@skeeve.com>
4006
4007         For --exec, don't allow x=y assignments where filenames would be.
4008         Do allow -v.  This is because we assume --exec is used mainly for
4009         CGI stuff and we don't want var assigns to affect the code.
4010
4011         Suggested by Stepan Kasal; motivated by reading about web security.
4012
4013         * main.c (disallow_var_assigns): New variable.
4014         (main): Set the var for --exec.
4015         (arg_assign): Check it appropriately.
4016
4017 Sun Dec 19 17:27:09 2004   Arnold D. Robbins    <arnold@skeeve.com>
4018
4019         * builtin.c (do_gensub): Make `global' flag smarter, such that
4020         a string numeric constant (e.g., "3") acts like a numeric
4021         constant.
4022         * node.c (r_force_number): Not really related: Only set NUMCUR
4023         if we actually convert some digits.
4024
4025 Sun Dec 19 16:08:50 2004   Arnold D. Robbins    <arnold@skeeve.com>
4026
4027         * dfa.h, dfa.c: Synchronize with what's happening in GNU grep
4028         development.  Effectively only minor whitespace changes and some
4029         slight code motion of ifdefs and includes.
4030         * hard-locale.h: New file, extracted from old dfa.c.
4031         * Makefile.am (base_sources): Add hard-locale.h.
4032
4033 Sun Dec 19 11:13:45 2004   Arnold D. Robbins    <arnold@skeeve.com>
4034
4035         * io.c (socketopen): Change type of `readle' and `namelen'
4036         variables to size_t.  For QNX, but a good idea anyway. Thanks
4037         to `Anthony' (rz1a@mail.ru).
4038
4039 Mon Dec  6 11:11:22 2004   Arnold D. Robbins    <arnold@skeeve.com>
4040
4041         Undid change of Mar 9 2004, to add gofast patch.  It gets things
4042         wrong for gawk.  This removes the bandaid of ifdef-ing out the
4043         main check.  Eventually this'll all get straightened out in the
4044         GNU grep code.
4045
4046         * dfa.c (buf_offset): Removed.
4047         (SKIP_REMAINS_MB_IF_INITIAL_STATE): Removed use of buf_offset, do
4048         free `mblen_buf', `inputwcs'.
4049         (match_anychar, match_mb_charset, transit_state_consume_1char,
4050         transit_state): Remove use of buf_offset in mblen_buf.
4051         (dfaexec): Use `free' and `malloc', not `realloc'.
4052
4053 Mon Dec  6 10:55:37 2004   Fumitoshi UKAI       <ukai@debian.or.jp>
4054
4055         Forwarded from james@nocrew.org, the Debian contact.
4056
4057         * dfa.c (parse_bracket_exp_mb): 
4058         1. Build range correctly when IGNORECASE for [a-a] to also get 'A'.
4059         2. For [:lower:] and [:upper:], if ignoring case, set type string
4060            to "alpha".  This parallels code in the regex routines.
4061         3. Reset wc1 to EOF when parsing bracket expressions.
4062
4063 Mon Nov 29 18:36:25 2004   Arnold D. Robbins    <arnold@skeeve.com>
4064
4065         * io.c (redirect): When allocating a new struct redirect, set
4066         rp->pid to -1, not 0, so that code checking for EOF on an
4067         input pipe works correctly.
4068
4069 Thu Nov 25 14:22:41 2004  Stepan Kasal  <kasal@ucw.cz>
4070
4071         * Makefile.am (MAINTAINERCLEANFILES): Add.
4072         * version.in (version_string): Use PACKAGE_STRING.
4073
4074 Tue Nov 23 17:27:38 2004  Stepan Kasal  <kasal@ucw.cz>
4075
4076         * re.c: Fix a typo in a comment.
4077
4078 Mon Nov 22 16:47:00 2004   Arnold D. Robbins    <arnold@skeeve.com>
4079
4080         * awkgram.y (yylex): Add lint check for tawk style modifiers on
4081         regexes, /.../i and /.../s.  Not that it'll help anyone.
4082
4083 Wed Oct 27 14:25:18 2004  Stepan Kasal  <kasal@ucw.cz>
4084
4085         * builtin.c (do_tolower, do_toupper): Fix the wide char handling,
4086           especially when the lowercased char doesn't ocuppy the same
4087           number of bytes as its uppercase equivalent.  Make use of ...
4088         (wide_tolower_toupper): ... this new static function.
4089
4090 Mon Oct 25 11:51:14 2004   Arnold D. Robbins    <arnold@skeeve.com>
4091
4092         * builtin.c (bchunk, bchunk_one, cksize): Change type of `olen'
4093         to size_t from long.  It is the 21st century now, after all...
4094         Thanks to Stepan Kasal.
4095
4096 Mon Oct 11 10:49:09 2004   Arnold D. Robbins    <arnold@skeeve.com>
4097
4098         * awkgram.y (yylex): Improve lint warnings for non-decimal constants.
4099         * node.c (isnondecimal): Made a little smarter, thanks to Stepan Kasal.
4100
4101 Thu Oct  7 21:59:38 2004   Arnold D. Robbins    <arnold@skeeve.com>
4102
4103         * dfa.c (dfamust): Redo fix of 22 Sep to match code from
4104         current GNU grep.
4105
4106 Sun Oct  3 23:06:00 2004   Arnold D. Robbins    <arnold@skeeve.com>
4107
4108         * node.c (isnondecimal): Made smarter, so that 0xEE does
4109         register as non-decimal. Added parameter to indicate use of
4110         locale's decimal point and changed declaration and callers.
4111
4112 Tue Sep 28 18:38:17 2004   Arnold D. Robbins    <arnold@skeeve.com>
4113
4114         * node.c (isnondecimal): New function, now smarter.
4115         * awk.h (isnondecimal): Changed from macro to function.
4116
4117 Wed Sep 22 11:24:46 2004   Arnold D. Robbins    <arnold@skeeve.com>
4118
4119         * dfa.c (dfamust): At end, check results of `malloc'.
4120         Based on bug report from Sorav Bansal <sbansal@stanford.edu>
4121         for grep.
4122
4123 Mon Sep 20 13:18:18 2004   Arnold D. Robbins    <arnold@skeeve.com>
4124
4125         New --exec option.  Needed for gawk CGI scripts to prevent
4126         arbitrary options and/or source getting passed in from the web.
4127
4128         * main.c (optab): New long option, --exec.
4129         (main): Catch it.  Like -f but end option processing.
4130         (usage): Add it to the usage message.
4131
4132         Thanks to John DuBois and Don Stokes for their input.
4133
4134         Unrelated:
4135
4136         * dfa.c (dfaexec): Disabled caching into buffer that bypasses
4137         multibyte initialization, since it can get things wrong. Thanks
4138         to Andreas Schwab <schwab@suse.de>.
4139
4140 Mon Sep 20 12:59:42 2004   Andreas Schwab  <schwab@suse.de>
4141
4142         * awkgram.y (nextc): Check for end of lexer buffer before
4143         advancing ring buffer index.
4144
4145 Wed Sep  8 09:54:53 2004   Arnold D. Robbins    <arnold@skeeve.com>
4146
4147         * main.c (main): Force LC_NUMERIC locale to "C" before parsing
4148         the program, since a variable assignment with -v can leave the 
4149         locale set incorrectly.
4150
4151         Thanks to Sirix <sirix@poczta.onet.pl> for reporting the problem.
4152
4153 Wed Aug 25 18:55:30 2004   Arnold D. Robbins    <arnold@skeeve.com>
4154
4155         * main.c (UPDATE_YEAR): New constant at top of file, where we
4156         won't miss it.
4157         (copyleft): Use it.
4158
4159 Sun Aug 22 17:26:39 2004   Stepan Kasal  <kasal@ucw.cz>
4160
4161         Define gawk_mb_cur_max even if there is no mbs support, as
4162         ``const int'' and assign 1 to it.
4163         This fixes a bug in re.c where #ifdef MBS_SUPPORT was missing.
4164
4165         * awk.h (gawk_mb_cur_max): Declare.
4166         * main.c (gawk_mb_cur_max): Define.
4167         * awkgram.y (nextc_is_1stbyte): Without mbs support, define to 1.
4168         * builtin.c (index_multibyte_buffer): Define a dummy function
4169           when there is no mbs support.
4170         * awkgram.y, builtin.c, re.c: Remove some `#ifdef MBS_SUPPORT'.
4171
4172 Sun Aug 15 22:08:04 2004   Arnold D. Robbins    <arnold@skeeve.com>
4173
4174         Import current FreeBSD random.c.  Make it work for gawk.
4175         Needed for cases where long is more than 32 bits.
4176
4177         * random.c: Imported from FreeBSD. Header includes tweaked.
4178         * random.h: Typdef gawk_uint32_t appropriately and #define uint32_t
4179           to it.
4180         * configure.ac: Add calls to AC_CHECK_SIZEOF for unsigned int
4181         and unsigned long.
4182
4183         Started with
4184         http://www.freebsd.org/cgi/cvsweb.cgi/src/lib/libc/stdlib/random.c
4185         Thanks to Andreas Schwab <schwab@suse.de> for the pointer.
4186
4187 Thu Aug 12 13:09:53 2004   Arnold D. Robbins    <arnold@skeeve.com>
4188
4189         * main.c (copyleft): Fix copyright year.
4190
4191 Mon Aug  2 12:18:15 2004   Arnold D. Robbins    <arnold@skeeve.com>
4192
4193         * Release 3.1.4: Release tar file made.
4194
4195 Mon Aug  2 12:17:40 2004   Arnold D. Robbins    <arnold@skeeve.com>
4196
4197         * configure.ac: Fix the hack. Do the sed on `Makefile',
4198         not `Makefile.in'.  Sigh.
4199
4200 Sun Aug  1 14:48:30 2004   Arnold D. Robbins    <arnold@skeeve.com>
4201
4202         * configure.ac: MAJOR HACK: At end, remove version.c from Makefile.in
4203         variable `CONFIG_CLEAN_FILES' so that `make distclean' doesn't
4204         remove version.c.
4205
4206 Mon Jul 19 17:07:27 2004   Arnold D. Robbins    <arnold@skeeve.com>
4207
4208         * config.guess, config.sub: Updated from Savannah CVS.
4209
4210 Fri Jul 16 10:59:07 2004   Arnold D. Robbins    <arnold@skeeve.com>
4211
4212         * re.c (make_regexp): Bracket code using `gawk_mb_cur_max'
4213         inside `#ifdef MBS_SUPPORT'.
4214
4215 Thu Jul 15 12:36:25 2004   Arnold D. Robbins    <arnold@skeeve.com>
4216
4217         * dfa.c (parse_bracket_exp_mb):  If doing case folding,
4218         include the other case for regular characters inside [...].
4219
4220         * re.c (make_regexp): Smarten up handling of IGNORECASE,
4221         particularly for multibyte character sets. Sigh.
4222
4223 Wed Jul 14 16:25:23 2004  John Haque  <mary1john8@earthlink.net>
4224
4225         * eval.c (interpret): For `Node_K_return', use `copynode'
4226         and not `dupnode' for non-PERM, non-TEMP values.
4227         (func_call): Don't add TEMP flag to returned value.
4228
4229         These two fix a problem uncovered by the July 8 change in
4230         `assoc_lookup'.
4231
4232 Wed Jul 14 16:14:09 2004  Arnold D. Robbins  <arnold@skeeve.com>
4233
4234         * awkgram.y (node_common): Add check `lexeme >= lexptr_begin',
4235         from valgrind run.
4236
4237 Wed Jul 14 16:00:51 2004  John Haque  <mary1john8@earthlink.net>
4238
4239         * io.c (rsrescan): Fix off by one error at end of record.
4240
4241 Thu Jul  8 16:59:51 2004  Stepan Kasal  <kasal@ucw.cz>
4242
4243         * awkgram.y (output_redir): Make sure not to dereference NULL
4244           pointer.  The bug was triggered by the following code:
4245
4246                 gawk 'BEGIN{print "date" |& getline}'
4247
4248         No test case created, beacuse of the following:
4249         Correct interpretation involves executing "1" or "0" -- as the user
4250         may have defined this, we would have to override this in the test
4251         script.  It's not worth the hassle.
4252
4253 Thu Jul  8 12:59:49 2004  Arnold D. Robbins  <arnold@skeeve.com>
4254
4255         * awk.h (load_casetable): Name changed from `load_ignorecase'.
4256         * eval.c (load_casetable): Name changed from `load_ignorecase'.
4257         Fix all uses.
4258
4259 Thu Jul  8 12:32:13 2004  John Haque  <mary1john8@earthlink.net>
4260
4261         * awkgram.y (get_src_buf): Fix off-by-one error to avoid "does not end
4262         in newline" messages.
4263         * array.c (assoc_lookup): Small performance hack: for TEMP subs nodes,
4264         use its string memory for ahname.
4265         * ext.c (get_actual_argument): Minor code cleanup.
4266         * builtin.c (do_lshift, do_rshift, do_and, do_or, do_xor, do_compl):
4267         fixed to issue "non-numeric argument" lint warnings before using
4268         `force_number'.
4269
4270 Mon Jun 21 16:53:35 2004  Arnold D. Robbins  <arnold@skeeve.com>
4271
4272         More changes from John Haque to rationalize extension functions.
4273
4274         * awk.h (get_curfunc_arg_count): Name changed from
4275         `get_curfunc_parm_count'.
4276         * eval.c (get_curfunc_arg_count): Ditto, body redone to count actual
4277         args passed at call time.
4278         * ext.c (get_argument): Update range check.
4279         (get_actual_argument): Simplify the code.
4280
4281 Mon Jun 14 14:01:16 2004  Arnold D. Robbins  <arnold@skeeve.com>
4282
4283         Changes from John Haque and ADR to rationalize extension functions.
4284
4285         * awk.h (check_special, get_curfunc_parm_count, get_actual_argument):
4286         new function declarations.
4287         (get_scalar_argument, get_array_argument): New macros.
4288         * awkgram.y (check_special): New function.
4289         (yylex): Use `check_special' to search `tokentab'.
4290         (dump_funcs): Always count functions, in order to get dynamic ones.
4291         Removed bogus use of `static' on `tab' variable.
4292         * eval.c (struct fcall): Change type of `count' to `size_t'.
4293         (get_curfunc_parm_count): New function.
4294         (push_args): Set `r->rnode' to NULL for local variable.
4295         * ext.c (make_builtin): Add sanity checking for presence and
4296         name of new function, and that it's not a redefinition.
4297         (get_argument): Check that requested arg is within range of actual
4298         number of parameters.  Also clean up logic for Node_var_new,
4299         Node_var_array, Node_array_ref.
4300         (get_actual_argument): New function.
4301         * profile.c (pp_builtin): Better handling of dynamic extension function.
4302
4303 Sun Jun 13 14:32:22 2004  Arnold D. Robbins  <arnold@skeeve.com>
4304
4305         * io.c (redirect): Conditionalize checking for process recovery
4306         on `#ifdef PIPES_SIMULATED'.  Needed for MS-DOS and VMS.
4307         * builtin.c (tmp_integer): Change bracketing of magic test to
4308         `#ifdef HAVE_UINTMAX_T' which is more general and more correct.
4309
4310 Wed Jun  9 21:36:01 2004  Arnold D. Robbins  <arnold@skeeve.com>
4311
4312         * re.c (make_regexp): Add dfa matching into IGNORECASE handling.
4313
4314 Tue Jun  8 15:38:56 2004  Arnold D. Robbins  <arnold@skeeve.com>
4315
4316         * awk.h (casetable): Remove `const'.
4317         * eval.c (casetable): Remove `const'.
4318         (load_ignorecase): New function.  Loads locale-correct values in
4319         upper 128 bytes.
4320         (set_IGNORECASE): Call `load_ignorecase'.
4321
4322 Tue Jun  8 14:04:19 2004  Arnold D. Robbins  <arnold@skeeve.com>
4323
4324         * awkgram.y (get_src_buf): Make sure that value from
4325         `optimal_bufsize' is reasonable.  Increase it if not.
4326
4327 Tue Jun  8 13:54:28 2004  John E. Haque      <mary1john8@earthlink.net>
4328
4329         * awkgram.y (statement:LEX_FOR): Fix bug in loop to `delete a'
4330         optimization.
4331         * io.c (format_tree): Check for out of range values for
4332         positional specifiers.
4333
4334 Mon Jun  7 17:02:48 2004  Arnold D. Robbins  <arnold@skeeve.com>
4335
4336         * builtin.c (tmp_integer): Bracket the magic test inside
4337         `#ifndef VMS'.
4338
4339         * awk.h (child_catcher): Remove declaration.
4340         * main.c (main): Remove `signal' calls for SIGCLD, SIGCHLD.
4341         * io.c (child_died, child_signo, child_catcher): Removed.
4342         (get_a_record): Remove code checking for death of child.
4343         (redirect): If `rp' matches and is at EOF and type is input
4344         pipe, and `rp->pid' is not -1, call `wait_any' to reap the
4345         child.  This is a heuristic, but it works pretty well.
4346
4347 Sun Jun  6 18:35:17 2004  Arnold D. Robbins  <arnold@skeeve.com>
4348
4349         * io.c (get_a_record): Restore use of `memmove' instead of
4350         memcpy. Otherwise some tests break on some systems. We think.
4351         (child_died): Don't reset signal handler; breaks on some S5 systems.
4352         (get_a_record): Reset handler if child_died. Still flaky on Solaris.
4353         * configure.ac (version.c): Made from version.in again, for
4354         non-Unix systems.
4355         * Makefile.am (base_sources): Add version.c back.
4356         * version.in: Include config.h for definition of const.
4357         * main.c (version_string): Add back declaration, don't
4358         include "version.i".
4359         (main): Don't install child_catcher on Sun. (HACK)
4360
4361 Thu Jun  3 14:06:06 2004  Arnold D. Robbins  <arnold@skeeve.com>
4362
4363         * main.c (version_string): Removed declaration, since
4364         version.i is included directly.
4365         * version.in: Removed test for definition of const.
4366
4367 Tue Jun  1 19:23:53 2004  Stepan Kasal  <kasal@ucw.cz>
4368
4369         * Makefile.am (base_sources): Don't mention version.c, so that
4370         it doesn't get distributed.
4371         * po/POTFILES.in: Remove version.c
4372         * configure.ac: Create version.i from version.in.
4373         * main.c: Include version.i.
4374
4375 Tue Jun  1 18:33:32 2004  Arnold D. Robbins  <arnold@skeeve.com>
4376
4377         Fix problem reported by Stephen Marchant <Stephen.Marchant@Cognex.com>
4378         on Thu, 30 Oct 2003 13:11:42 -0500.
4379
4380         * regex_internal.h (re_realloc): Allow for SunOS pre-Standard C
4381         `realloc' which doesn't accept NULL pointers.
4382         * awk.h (erealloc): Same.
4383
4384         Unrelated. Change suggested by Peter Sobisch <petersob@gmx.net>, have
4385         PROCINFO["version"] be the version of gawk:
4386
4387         * main.c (load_procinfo): Add in version.
4388
4389         Unrelated: Avoid warning:
4390
4391         * main.c (main): Cast calls to `bindtextdomain' and `textdomain' to
4392         void.  Avoids diagnostic with `configure --disable-nls'.
4393         * dfa.c (check_matching_with_multibyte_ops): Remove unneeded nested
4394         #ifdef, per Scott Deifik (scottd@amgen.com).  Also fix some spelling
4395         errors in comments.
4396
4397 Tue Jun  1 18:26:45 2004  Paul Eggert  <eggert@twinsun.com>
4398
4399         Fix a bug reported by Mike Romaniw <msr@micromonumental.com>
4400         to bug-gnu-utils on 2003-09-27: compl(compl(0xf0f)) returned 0xfff
4401         on hosts with 64-bit uintmax_t and 64-bit IEEE-764 double, due to
4402         rounding errors.
4403
4404         * doc/gawk.texi (Bitwise Functions): Leading nonzero bits are
4405         removed in order to fit the result into a C 'double' without rounding
4406         error.
4407         * builtin.c: Include <float.h> if available.
4408         (FLT_RADIX, FLT_MANT_DIG, DBL_MANT_DIG): Define if not already defined.
4409         (AWKSMALL_MANT_DIG, AWKNUM_MANT_DIG, AWKNUM_FRACTION_BITS): New macros.
4410         (tmp_integer): New function.
4411         (do_lshift, do_rshift, do_and, do_or, do_xor, do_compl): Use them.
4412
4413 Tue Jun  1 17:40:47 2004  Stepan Kasal  <kasal@ucw.cz>
4414
4415         * eval.c (push_args): Set var_value to Nnull_string for
4416         local variables.
4417
4418 Mon May 31 11:49:20 2004  Stepan Kasal  <kasal@ucw.cz>
4419
4420         * replace.c: #undef DEBUG before including mktime.c, it has
4421           different meaning there.
4422
4423 Mon May 31 08:25:30 2004  Arnold D. Robbins  <arnold@skeeve.com>
4424
4425         * array.c (get_actual): Add extra error message for `delete f'
4426         inside body of function `f'.
4427
4428 Mon May  3 09:53:34 2004  Arnold D. Robbins  <arnold@skeeve.com>
4429
4430         * Makefile.in, */Makefile.in: Updated to automake 1.8.4.
4431         * config.guess, config.sub: Same.
4432         * aclocal.m4, depcomp, install-sh: Same.
4433
4434 Mon May  3 09:24:45 2004  Arnold D. Robbins  <arnold@skeeve.com>
4435
4436         * configure.ac: Look for missing `strtoul'.
4437         * replace.c: Include missing_d/stroul.c if not HAVE_STRTOUL.
4438         * io.c (devopen): Use `strtoul' instead of `strtod' for
4439           extracting fd number from "/dev/fd/N".  (Thanks to Jim Meyering.)
4440         * field.c (set_FIELDWIDTHS): Use `strtoul' instead of `strtod'
4441           when parsing FIELDWIDTHS values.  (Thanks to Jim Meyering.)
4442
4443 Mon Apr 19 20:12:57 2004  Arnold D. Robbins  <arnold@skeeve.com>
4444
4445         * Makefile.in, */Makefile.in: Updated to automake 1.8.3.
4446         * config.guess, config.sub: Same.
4447
4448 2004-03-18  Stepan Kasal  <kasal@ucw.cz>
4449
4450         * eval.c (make_scalar): Comment clarification.
4451
4452         * array.c (get_actual): Remove the condition ``canfatal''
4453           before ``cant_happen()''; if the data are consistent, we
4454           simply cannot get there with a non-func Node_param_list,
4455           no matter whether we are called via get_array or not.
4456
4457         * awkgram.y (variable): Make one longer message, to help translators.
4458
4459 Tue Mar  9 17:34:10 2004  Arnold D. Robbins  <arnold@skeeve.com>
4460
4461         Adapted `gofast' patch from Redhat Enterprise version of grep
4462         to current dfa.c.
4463
4464         * dfa.c (buf_offset): New variable.
4465         (SKIP_REMAINS_MB_IF_INITIAL_STATE): Modified to use it, don't
4466         free `mblen_buf', `inputwcs'.
4467         (match_anychar, match_mb_charset, transit_state_consume_1char,
4468         transit_state): Use buf_offset in mblen_buf.
4469         (dfaexec): Realloc things instead of free and malloc.
4470
4471 Thu Mar  4 16:46:55 2004  Arnold D. Robbins  <arnold@skeeve.com>
4472
4473         * configure.ac (AC_FUNC_MBRTOWC): Added.
4474         (AC_CHECK_FUNCS): Removed `mbrtwoc'.
4475         (REGEX_MALLOC): Removed. Not needed for new regex* routines.
4476
4477         * re.c (research): Removed comment and check for return of -2
4478         since that was for old regex using alloca or REGEX_MALLOC.
4479
4480 Wed Mar  3 17:10:16 2004  Arnold D. Robbins  <arnold@skeeve.com>
4481
4482         * io.c (close_one): Don't close stdout or stderr; can happen if
4483         /dev/stdout or /dev/stderr are used in redirection and all the
4484         open files get used.
4485
4486 Sun Feb 29 12:17:37 2004  Arnold D. Robbins  <arnold@skeeve.com>
4487
4488         * regcomp.c (build_charclass, build_charclass_op): Change type of
4489         `class_name' parameter to `const char *' from `const unsigned char *'
4490         and adjust callers.
4491
4492 Thu Feb 26 15:20:22 2004  Arnold D. Robbins  <arnold@skeeve.com>
4493
4494         * awkgram.y (get_src_buf): Rewritten to better manage input and
4495         supplying newlines on command line programs.  Fixes problems reading
4496         source files on Cygwin.
4497
4498         Unrelated fixes from mary1john8@earthlink.net:
4499
4500         * node.c (format_val): For no malloc case, free s->stptr if necessary.
4501         * io.c (nextfile): Add missing call to `unref(FILENAME_node->var_value)'
4502         for no files case.
4503         (close_redir): Remove file from redirection list even if fp is
4504         stdout or stderr.
4505
4506 Tue Feb 24 12:11:34 2004  Arnold D. Robbins  <arnold@skeeve.com>
4507
4508         * regex_internal.c (build_wcs_upper_buffer): Enclose `offsets_needed'
4509         label in `#ifdef _LIBC' to silence `unused label' compiler warning.
4510
4511 Tue Feb 24 11:57:18 2004  Nelson H.F. Beebe  <beebe@math.utah.edu>
4512
4513         * regcomp.c (parse_expression): Add cast to (unsigned char *) in calls
4514         to `build_charclass_op'.
4515         * regex_internal.c (build_wcs_buffer): Add cast to char* in call to
4516         `wcrtomb'.
4517         * regex_internal.h (bitset_not, bitset_merge, bitset_not_merge,
4518         bitset_mask, re_string_char_size_a, re_string_wchar_at,
4519         re_string_elem_size_at): Change to use prototypes.
4520         (re_string_char_size_at, re_string_wchar_at, re_string_elem_size_at):
4521         Declare as `internal_function'.
4522
4523         * Makefile.am: Add rule to make .i files.  This assists in debugging.
4524         * awk.h (m_tree_eval): Add casts to NULL.  (Some compilers are just
4525         dumb. ADR)
4526
4527 Mon Feb 23 15:58:39 2004  Arnold D. Robbins  <arnold@skeeve.com>
4528
4529         Clean up occupied process slots of children that have died:
4530
4531         * awk.h (child_catcher): New function, declare it.
4532         * main.c (main): Catch SIGCHLD/SIGCLD with `child_catcher'.
4533         * io.c (child_died): New static variable.
4534         (child_catcher): New function, sets `child_died', reinstalls self
4535         as signal handler.
4536         (close_rp): New function: isolates actual fp/iop closing logic.
4537         (close_redir): Call `close_rp'.
4538         (get_a_record): Check `child_died' and call `wait_any(0)' if so.
4539         Add descriptive comment.
4540
4541         Unrelated clean up:
4542
4543         * eval.c (fcalls): Renamed from `fcall_list'. All uses changed.
4544         (pop_fcall, push_args, dump_fcall_stack): Adjusted to use indexing
4545         on `fcalls' instead of a pointer into it. Avoids hassles if `fcalls'
4546         is realloc-ed during recursive tree_evals. Thanks to BWK.
4547
4548         * config.guess, config.sub: Updated from Savannah.
4549
4550 2004-02-19  gettextize  <bug-gnu-gettext@gnu.org>
4551
4552         * configure.ac (AM_GNU_GETTEXT_VERSION): Bump to 0.14.1.
4553
4554 Wed Feb 18 12:40:09 2004  Arnold D. Robbins  <arnold@skeeve.com>
4555
4556         * awkgram.y (rule): Use `msg' not `warning' for `must have an
4557         an action part' message.  `warning' is wrong, since it's a real error.
4558
4559 Mon Feb 16 12:17:39 2004  Arnold D. Robbins  <arnold@skeeve.com>
4560
4561         * main.c, eval.c, builtin.c: Change test for `#ifdef HAVE_LOCALE_H'
4562         to `#if ENABLE_NLS && defined(HAVE_LOCALE_H)' so that builds with
4563         `configure --disable-nls' will actually work on non-glibc systems.
4564
4565 Thu Feb 12 02:05:34 2004  Stepan Kasal  <kasal@ucw.cz>
4566
4567         Lots of misc changes from Stepan Kasal integrated.
4568
4569         * array.c: Various variables and parameters of static functions
4570         changed from int to long, in order to prevent overflow.
4571
4572         * eval.c (make_scalar): New function; takes care of everything
4573         that has to be done when a node of type Node_var_new or
4574         Node_array_ref changes to a scalar variable.
4575         (tree_eval, get_lhs): Call it.
4576         (tree_eval): From now on, tree_eval(NULL) doesn't work;
4577         it reports an internal error.
4578         * awk.h (m_tree_eval): Likewise for the two macro versions.
4579         * awkgram.y (statement): Make sure the Node_K_return's lnode is
4580         always the return value, never NULL.
4581
4582         * Makefile.am (install-exec-hook, uninstall-links): Make use of
4583         $(VERSION).
4584         (INCLUDES): Renamed to AM_CPPFLAGS.
4585         (AM_CPPFLAGS): The file libintl.h is generated in the
4586         build subdirectory intl, not in the directory $(srcdir)/intl.
4587         (diffout): New target is an alias for ``make -C test diffout.''
4588         * awklib/Makefile.am (INCLUDES): Renamed to AM_CPPFLAGS.
4589
4590         * README_d/README.hpux: Change the whitespace in the appended patch,
4591         so that it applies to the current source.
4592         * posix/gawkmisc.c: Change a tab to a space (needed for the above).
4593
4594         Make version control more in the style of current autotools:
4595
4596         * configure.ac: Remove obsolete versions of macros:
4597         AM_INIT_AUTOMAKE doesn't need any parameters.
4598         AC_OUTPUT shouldn't have any parameters either.
4599         Its parameters go to a new macro: AC_CONFIG_FILES.
4600         AC_CONFIG_HEADERS moved near the end of the file.
4601         * configure.ac: Add [version.c:version.in] to AC_CONFIG_FILES
4602         * version.in: Modify for autoconf substitutions.
4603         * version.c: Remove, it's generated at configure time now.
4604         * fixvers, patchlev.h, unsupported/tandem/ptchlvl.h: Nuke and ...
4605         * Makefile.am, main.c: ... forget them.
4606
4607 Mon Feb  9 12:57:00 2004  Arnold D. Robbins  <arnold@skeeve.com>
4608
4609         * awk.h builtin.c eval.c field.c (HUGE): Changed to `UNLIMITED'.
4610         Avoids possible conflict with constant in svid-mode math.h. Thanks to
4611         Roman.Putanowicz@iecn.u-nancy.fr for pointing out the problem.
4612
4613 Fri Feb  6 12:09:55 2004  Arnold D. Robbins  <arnold@skeeve.com>
4614
4615         * configure.ac: Check for `wctype', `wcscoll' and `iswctype'.
4616         * mbsupport.h: New file. Merges and centralizes testing for MBS support.
4617         * Makefile.am (base_sources): Add mbsupport.h to list.
4618         * dfa.c, dfa.h, awk.h (MBS_SUPPORT): Include "mbsupport.h" and use the
4619         test there.
4620         * regex_internal (RE_ENABLE_I18N): Same.
4621
4622         * Makefile.am (CLEANFILES): Added.
4623
4624 Thu Feb  5 18:05:12 2004  Arnold D. Robbins  <arnold@skeeve.com>
4625
4626         * configure.ac (HAVE_WCTYPE_T): New test code added.
4627         * dfa.h (wctype_t): Define if system doesn't. Needed here too
4628         for other files that include dfa.h.
4629         * dfa.c (wctype_t): Define if system doesn't.
4630         (lex): Manually fill in arrays used for char class range testing
4631         so will work on c89 and older compilers.
4632         (parse_bracket_exp_mb): Split up an assignment to avoid type complaints.
4633
4634         * main.c (main): When checking for `close_io' failure, only set
4635         `exit_val' to 1 if not already exiting.
4636
4637         * regcomp.c (regerror): Remove use of mempcpy.  Generates too
4638         many compiler warnings.
4639         * configure.ac (AC_CHECK_FUNCS): Don't bother checking for it.
4640
4641 Wed Feb  4 17:34:47 2004  Arnold D. Robbins  <arnold@skeeve.com>
4642
4643         * getopt.h (__THROW): Only define it if C++. The __GNU_PREREQ
4644         macro is a major headache.
4645
4646 2004-02-02  Paolo Bonzini  <bonzini@gnu.org>
4647
4648         * regexec.c (check_matching): Add P_MATCH_FIRST parameter.
4649         (re_search_internal): Pass new parameter to check_matching.
4650         (check_matching): Unless a parenthesized group is found at the
4651         beginning of the regexp, advance P_MATCH_FIRST until we entered
4652         a state different from the initial state.
4653
4654 Mon Feb  2 15:52:37 2004  Arnold D. Robbins  <arnold@skeeve.com>
4655
4656         * re.c (research): Change last param to re_search to pass
4657         NULL if `need_start' is false.  May give us a marginal speed gain.
4658
4659 Thu Jan 29 17:04:51 2004  Arnold D. Robbins  <arnold@skeeve.com>
4660
4661         * builtin.c (sub_common): Fix logic for `&' in replacement for
4662         multibyte case.  Simplify code a bit.
4663
4664 Tue Jan 20 10:41:45 2004  Arnold D. Robbins  <arnold@skeeve.com>
4665
4666         * configure.ac: Add check for `memmove'.
4667         * replace.c: Include missing_d/memmove.c if don't have `memmove'.
4668
4669 Sun Jan 18 12:01:29 2004  Arnold D. Robbins  <arnold@skeeve.com>
4670
4671         * builtin.c (sub_common): Add comment and support for 2001 POSIX
4672         behavior when --posix in effect.  The masses have been
4673         clamoring for this one.
4674
4675 2004-01-16  gettextize  <bug-gnu-gettext@gnu.org>
4676
4677         * configure.ac (AM_GNU_GETTEXT_VERSION): Bump to 0.13.1.
4678         * intl/*: Updated to 0.13.1.
4679
4680 Fri Jan 16 08:16:38 2004  Arnold D. Robbins  <arnold@skeeve.com>
4681
4682         * getopt.h, getopt.c, getopt1.c: Synced to GLIBC version:
4683         getopt.c:       1.51
4684         getopt.h:       1.18
4685         getopt1.c:      1.9
4686
4687 Thu Jan 15 15:28:48 2004  Arnold D. Robbins  <arnold@skeeve.com>
4688
4689         Here we go again:
4690
4691         * regcomp.c, regex.h, regex.c, regex_internal.h, regex_internal.c,
4692         regexec.c: Sync to GLIBC version, but with bug fixes.  GLIBC
4693         CVS versions:
4694
4695         regcomp.c: 1.76
4696         regexec.c: 1.55
4697         regex.c: 1.125
4698         regex.h: 1.30
4699         regex_internal.c: 1.39
4700         regex_internal.h: 1.45
4701         regexec.c: 1.55
4702
4703         * acinclude.m4: Removed, not needed for automake 1.8.x.
4704         * configure.ac: Updated to autoconf 2.59.
4705
4706         Everything else updated to automake 1.8x and autoconf 2.59.
4707
4708 Wed Jan 14 14:26:36 2004  Arnold D. Robbins  <arnold@skeeve.com>
4709
4710         * dfa.c, dfa.h: Updated manually with most of the changes in
4711         grep 2.5.1.  That version lost the ability to match newlines
4712         in the data, so the merge had to be done by hand.  Sigh.
4713
4714 2004-01-12  Paolo Bonzini  <bonzini@gnu.org>
4715
4716         ALLOCA patch from
4717         http://sources.redhat.com/ml/libc-alpha/2004-01/msg00099.html
4718         added.
4719
4720         * regcomp.c [_LIBC && !RE_ENABLE_I18N]:
4721         Drop code to support this, it is never true.
4722         (build_range_exp) [!_LIBC]: Do not create a range
4723         in MBCSET for a single-byte character set.
4724         (build_range_exp) [_LIBC]: Do not create a range
4725         in MBCSET for a single-byte character set without
4726         collation elements.
4727         (init_dfa): Do not conditionalize on _LIBC, it
4728         just makes the code less clear.
4729         (parse_bracket_exp): Use NON_MATCH variable in
4730         addition to "mbcset->non_match", not as an
4731         alternative.
4732         (build_charclass_op): Rename NOT parameter to
4733         NON_MATCH, use it instead of declaring a variable. 
4734         (parse_bracket_exp) [!_LIBC]: Pass NULL for MBCSET
4735         if the character set is single-byte.
4736
4737 Wed Jan  7 15:23:04 2004  Arnold D. Robbins  <arnold@skeeve.com>
4738
4739         * awkgram.y (mk_rexp): Set n->re_cnt to 1. Makes reinstated
4740         dfa code actually take effect!  Don't know how I missed this.
4741
4742         Unrelated: sync regex code to glibc.
4743
4744         * regcomp.c, regex.h, regex.c, regex_internal.h, regex_internal.c,
4745         regexec.c: Sync to GLIBC version, but with bug fixes.  GLIBC
4746         CVS versions:
4747
4748         regcomp.c: 1.74
4749         regex.c: 1.124
4750         regex.h: 1.30
4751         regex_internal.c: 1.39
4752         regex_internal.h: 1.43
4753         regexec.c: 1.55
4754
4755         * regcomp.c (peek_token): Temporarily, we hope, disable \s and \S
4756         operators.  Too much trouble to document right now.
4757         * dfa.c (lex): Add code for \s and \S but disable it until
4758         next release.
4759
4760 Wed Dec 24 15:28:57 2003  Arnold D. Robbins  <arnold@skeeve.com>
4761
4762         * eval.c (r_tree_eval): For Node_assign_concat, add
4763         call `free_temp(r)'. Thanks to mary1john8@earthlink.net.
4764
4765 Mon Dec  1 10:25:52 2003  Arnold D. Robbins  <arnold@skeeve.com>
4766
4767         CONSTVAL not needed if we test PERM instead. Thanks to
4768         mary1john8@earthlink.net. See test/concat3.awk.
4769
4770         * awk.h [CONSTVAL]: Removed.
4771         * eval.c (flag2str): Removed CONSTVAL from table.
4772         (r_tree_eval): For Node_assign_concat, it's enough to check
4773         if l->flags has PERM clear.
4774         * awkgram.y (yylex): Removed use of CONSTVAL for YSTRING and YNUMBER.
4775
4776 Mon Nov  3 16:33:26 2003  Arnold D. Robbins  <arnold@skeeve.com>
4777
4778         * awkgram.y (get_src_buf): Replace `memmove' with `memcpy' for
4779         marginal portability gain to older systems.
4780         * io.c (get_a_record): Ditto.
4781
4782 Sun Nov  2 15:59:27 2003  Arnold D. Robbins  <arnold@skeeve.com>
4783
4784         * awk.h [CONSTVAL]: Renamed from `STRCONST'.
4785         * eval.c (flags2str): Fix in table.
4786         (r_tree_eval): For Node_assign_concat, check for the flag for
4787         both left and right hand sides.  Also add a `force_string' call
4788         for the right hand side and the left hand side.
4789         * awkgram.y (yylex): Change flag value for YSTRING and add use
4790         of flag for YNUMBER.
4791
4792 Wed Oct 29 14:23:29 2003  Arnold D. Robbins  <arnold@skeeve.com>
4793
4794         * awk.h [STRCONST]: New flag value.
4795         * eval.c (flags2str): Add it to table.
4796         (r_tree_eval): For Node_assign_concat, check for the flag so that
4797         we don't clobber string constants given:
4798                 s = ""
4799                 s = s something
4800         * awkgram.y (yylex): For YSTRING, set STRCONST flag.
4801
4802 Tue Oct 28 18:00:00 2003  Arnold D. Robbins  <arnold@skeeve.com>
4803
4804         Force SUBSEP to always have a string value. Per bug report
4805         from mary1john8@earthlink.net.
4806
4807         * awk.h (NODETYPE): New type, Node_SUBSEP.
4808         (set_SUBSEP): Add declaration.
4809         * awkgram.y (isnoeffect, isassignable): Add Node_SUBSPEP case.
4810         * array.c (set_SUBSEP): New function.
4811         * eval.c (nodetypes): Add Node_SUBSEP.
4812         (r_tree_eval, r_get_lhs): Add code for Node_SUBSEP.
4813         * main.c (varinit): Use Node_SUBSEP as type for SUBSEP.
4814         * profile.c (tree_eval, pp_lhs, is_scalar, prec_level): Handle
4815         Node_SUBSEP.
4816
4817 Tue Oct  7 09:26:33 2003  Arnold D. Robbins  <arnold@skeeve.com>
4818
4819         * awk.h (NODETYPE): New member `Node_assign_concat'.
4820         * awkgram.y (exp): Look for case of `x = x y' and if so, create a
4821         Node_assign_concat.
4822         * eval.c (interpret): Add case for Node_assign_concat.
4823         * profile.c (prec_level): Ditto.
4824         (tree_eval): Ditto.  For variables, call new function `vname' to
4825         print name; handles varname field for -v variables, which end up
4826         including the value.
4827         (vname): New function.
4828
4829 Wed Sep 24 17:32:31 2003  Arnold D. Robbins  <arnold@skeeve.com>
4830
4831         Speed up `avoid_dfa' kludge, at least a little:
4832
4833         * awk.h (struct Regexp): Add `has_anchor' member.  Make it and
4834         `dfa' member shorts; keeps space the same.
4835         * re.c (make_regexp): Set `has_anchor' member correctly.
4836         (avoid_dfa): Test for `has_anchor' member instead of searching
4837         for it each time.
4838
4839 Sun Sep 21 18:34:32 2003  Arnold D. Robbins  <arnold@skeeve.com>
4840
4841         * builtin.c (state): Only needs to be 256 bytes, initstate() can't
4842         use any more than that.  Well whadayaknow.
4843         (do_rand, do_srand): Call `setstate' after calling `initstate'.
4844
4845 Tue Sep 16 15:44:29 2003  Arnold D. Robbins  <arnold@skeeve.com>
4846
4847         * eval.c (interpret): For Node_K_switch, add kludge_need_start stuff
4848         as used in `match_op'.  Sigh.
4849         * re.c (make_regexp): Add `no_dfa' variable, which is true if
4850         GAWK_NO_DFA exists in the environment.  This enables run time
4851         testing of things with/without the dfa matcher.
4852
4853 Mon Sep 15 18:36:38 2003  Arnold D. Robbins  <arnold@skeeve.com>
4854
4855         After much soul searching, reinstated old dfa code. The performance
4856         of the new regex is just disastrous.  Sigh.
4857
4858         * awk.h (re_cnt): Reinstated old definition.
4859         (struct Regexp): Added `dfareg' and `dfa' members.
4860         (make_regexp): New last parameter in function, changed decl.
4861         (avoid_dfa): Added declaration.
4862         * awkgram.y (regexp, mk_rexp): Added use of `re_cnt'.  Fixed call
4863         to `make_regexp'.
4864         * Makefile.am: Add dfa.h and dfa.c.
4865         * eval.c (match_op): Complexified: added call to `avoid_dfa' and
4866         `kludge_need_start' variable where used to pass FALSE as last parameter
4867         of research().
4868         * field.c (set_FS): Fixed call to `make_regexp'.
4869         * io.c (get_a_record, set_RS): Fixed calls to `make_regexp'.
4870         * re.c (make_regexp): Added last paramter (`dfa') to function.
4871         Complexified the code.
4872         (re_update): Fixed call to `make_regexp'.
4873         (research): Complexified the code, added calls to dfa stuff.
4874         (dfaerror): New function.
4875         (re_update): Fixed call to `make_regexp'.
4876         (avoid_dfa): New function.
4877
4878 Tue Sep  9 15:57:38 2003  Arnold D. Robbins  <arnold@skeeve.com>
4879
4880         * awkgram.y (get_src_buf): Fix calculation of `offset' when shifting
4881         source lines around.  In general, improve handling of things when
4882         moving the source code line around.  What a mess this code is.
4883
4884 Mon Sep  8 19:08:55 2003  Arnold D. Robbins  <arnold@skeeve.com>
4885
4886         * eval.c (fmt_ok): Make provision for %F format and printf %'f flag
4887         here too.
4888
4889 2003-07-23  Christophe Bisiere  <bisiere@univ-tlse1.fr>  (tiny change)
4890
4891         * posix/regex.h (RE_TRANSLATE_TYPE): Define it to "unsigned char,"
4892           to avoid problems at hosts with signed char.
4893         * posix/regexec.c (re_search_internal): Don't say
4894           "unsigned RE_TRANSLATE_TYPE."
4895
4896 Thu Aug 28 11:09:41 2003  Arnold D. Robbins  <arnold@skeeve.com>
4897
4898         * io.c (nextfile): Change use of variable `files' to make it
4899         clearer that it's a boolean flag.
4900
4901 Tue Aug 26 22:58:15 2003  Arnold D. Robbins  <arnold@skeeve.com>
4902
4903         * io.c (useropen): Add `defined (HAVE_GETGROUPS)' as first test
4904         in `#ifdef'.  Brings things in sync with same test in main.c and awk.h.
4905
4906 Tue Aug 26 22:49:37 2003  Arnold D. Robbins  <arnold@skeeve.com>
4907
4908         * dbug.h: New file.
4909
4910         * array.c, awkgram.y, builtin.c, eval.c, ext.c, field.c, io.c,
4911         main.c, msg.c, node.c, profile.c, re.c: Converted to use
4912         Fred Fish's `dbug' library.  By default compiled out, thus
4913         not affecting speed.
4914
4915         For the nonce, the `dbug' library itself is not shipped with
4916         gawk, since I expect no-one else but me to be using it.
4917
4918 Thu Aug 21 23:15:36 2003  Arnold D. Robbins  <arnold@skeeve.com>
4919
4920         * awkgram.y (numfiles): Change extern decl to long, to match what's
4921         in main.c.  Keeps things working on 64-bit systems.  Thanks to bug
4922         report from Jan Oravec <jan.oravec@6com.sk>.
4923
4924 Wed Aug 20 14:53:47 2003  Arnold D. Robbins  <arnold@skeeve.com>
4925
4926         * eval.c (genflags2str): Move test for out-of-space inside test
4927         for is the bit set.
4928
4929 Mon Aug 11 11:26:51 2003  Arnold D. Robbins  <arnold@skeeve.com>
4930
4931         * regcomp.c (parse_bracket_exp): If `build_charclass' fails, just pass
4932         its value on as the return value.
4933
4934 Sun Aug 10 16:59:14 2003  Arnold D. Robbins  <arnold@skeeve.com>
4935
4936         * regcomp.c (build_range_exp): Make sure we don't
4937         get WEOF on range characters.
4938
4939 Tue Aug  5 21:49:32 2003  Arnold D. Robbins  <arnold@skeeve.com>
4940
4941         * array.c (get_actual): In `case Node_param_list' add test for
4942         `&& (symbol->flags & FUNC) == 0' to the if.
4943
4944 Sun Jul 13 18:28:38 2003  Arnold D. Robbins  <arnold@skeeve.com>
4945
4946         Further bug fix:
4947
4948         * awkgram.y (variable): Give the new variable an lnode
4949         of Nnull_string if it's not an array, even if it is
4950         a Node_var_new.
4951
4952 Fri Jul 11 09:32:21 2003  Arnold D. Robbins  <arnold@skeeve.com>
4953
4954         Bug fix:
4955
4956         * eval.c (r_tree_eval): For Node_array_ref, set
4957         tree->orig_array->var_value to Nnull_string too.
4958
4959         Unrelated i18n and POSIX change:
4960
4961         * configure.ac: Add check for local printf supporting %F format.
4962         * awk.h (loc): New variable declaration.
4963         * main.c (loc): Defined.
4964         (main): Call `localeconv' to set loc.
4965         * io.c (format_tree): Add support for printf quote flag, %'d for
4966         decimal formats (not %e, %E), adds thousand separator into value.
4967
4968 2003-07-10  Paul Eggert  <eggert@twinsun.com>
4969
4970         * io.c (two_way_open): If /bin/sh cannot be executed, exit
4971         with status 126 consistently.
4972
4973 Mon Jul  7 11:01:43 2003  Arnold D. Robbins  <arnold@skeeve.com>
4974
4975         * Release 3.1.3: Release tar file made.
4976
4977 Mon Jul  7 09:55:49 2003  Arnold D. Robbins  <arnold@skeeve.com>
4978
4979         * main.c (copyleft, usage): Make sure to fflush output fp. Per Jim
4980         Meyering, if error, exit non-zero.
4981         * ext.c (get_argument): Fix array paramater handling.
4982
4983 2003-07-06  Paul Eggert  <eggert@twinsun.com>
4984
4985         * builtin.c (do_substr): Issue better diagnostics when
4986         d_substr and d_length are NaN, or when 0 < d_length < 1.
4987         Be careful when comparing double to SIZE_MAX, as
4988         the comparison might return the "wrong" answer when
4989         `(double) SIZE_MAX' is a number that is not equal to
4990         SIZE_MAX.
4991         (do_gensub): Watch out for HOW values that are out of range
4992         or are NaN.
4993         (do_dcngettext): dcngettext wants an argument of type
4994         unsigned long, not long, so use a value of that type.
4995
4996 Fri Jul  4 10:58:02 2003  Arnold D. Robbins  <arnold@skeeve.com>
4997
4998         * main.c (main): Make option letter 'D' fall through into default
4999         unknown case if not debugging. Let's us have just one version of
5000         `optlist'.
5001
5002 Thu Jun 26 15:25:57 2003  Arnold D. Robbins  <arnold@skeeve.com>
5003
5004         * array.c (get_actual): Undo Stepan Kasal change of 2003-06-17.
5005         See test/match2.awk.
5006
5007 Wed Jun 25 15:26:08 2003  Arnold D. Robbins  <arnold@skeeve.com>
5008
5009         * builtin.c (do_rand): Change calculation so that result
5010         obeys constraint:  0 <= N < 1.  This is per history and POSIX.
5011         Thanks to Nelson Beebe (beebe@math.utah.edu) for reporting
5012         this issue.
5013
5014 Mon Jun 23 15:13:39 2003  Arnold D. Robbins  <arnold@skeeve.com>
5015
5016         * io.c (rs1scan): Per advice from Bruno Haible, it's safe
5017         to skip the multibyte checking code if RS is '\n'. See
5018         the comment in the code.  Big performance improvement for
5019         multibyte locales.
5020
5021 2003-06-20  Stepan Kasal  <kasal@ucw.cz>
5022
5023         * eval.c (comp_func): If memcmp returns 0, we have to compare
5024           the lengths.
5025
5026 2003-06-19  Stepan Kasal  <kasal@ucw.cz>
5027
5028         * eval.c (interpret) <Node_K_arrayfor>: Use NULL, not 0, to
5029           initialize the variable list.
5030           (comp_func): Array indices no longer are string values,
5031           you have to use ahname_str, ahname_len.
5032
5033 Tue Jun 17 11:53:46 2003  Arnold D. Robbins  <arnold@skeeve.com>
5034
5035         * array.c (get_actual): Make check for isparam
5036         smarter: also check for FUNC flag.
5037
5038 2003-06-17  Stepan Kasal  <kasal@ucw.cz>
5039
5040         * array.c (get_actual): Even if canfatal is FALSE, don't
5041           tolerate existence of things which can't happen.
5042
5043 Mon Jun 16 16:21:44 2003  Arnold D. Robbins  <arnold@skeeve.com>
5044
5045         * configure.ac: Removed m4/Makefile.
5046         * m4/Makefile.am: Removed.
5047
5048 2003-06-16  gettextize  <bug-gnu-gettext@gnu.org>
5049
5050         * configure.ac (AC_OUTPUT): Add m4/Makefile.
5051         (AM_GNU_GETTEXT_VERSION): Bump to 0.12.1.
5052
5053 Sun Jun 15 20:45:43 2003  Arnold D. Robbins  <arnold@skeeve.com>
5054
5055         * io.c (get_a_record): Enhance logic to fill buffers to include
5056         `|| no_data_left(iop)'.
5057         (rs1scan): Fix logic for setting recm fields for multibyte
5058         character case.
5059
5060 2003-06-10  Stepan Kasal  <kasal@ucw.cz>
5061
5062         * awkgram.y (release_all_vars): Do not try to release a value of
5063           Node_var_new; after get_lhs, use the lhs directly, do not try
5064           to do (*lhs)->var_value; the Node_var case doesn't need
5065           special treatment.
5066         * builtin.c (do_match): `get_param' is successful iff it returns
5067           Node_var_array---if the variable was new, get_param has already
5068           changed the type.
5069         * field.c (do_split): Likewise.
5070
5071 Sun Jun 15 19:36:35 2003  Arnold D. Robbins  <arnold@skeeve.com>
5072
5073         * node.c (r_dupnode): Typo fix in hash tables: stptr -> ahname_str.
5074         Thanks to mary1john8@earthlink.net.
5075         * array.c (get_actual): Add `if (canfatal)' before call to
5076         `cant_happen'.
5077
5078 Sun Jun 15 19:25:49 2003  Patrick T.J. McPhee   <ptjm@interlog.com>
5079
5080         * awk.h (memcpy_ulong): Add ! WIN32 to ifdefs.
5081
5082 Mon Jun  9 18:38:20 2003  Arnold D. Robbins  <arnold@skeeve.com>
5083
5084         * custom.h (hpux): Added stuff to (hopefully) get `tzset'
5085         declared on HP/UX 10 and up.
5086
5087 Mon Jun  9 17:12:24 2003  Patrick T.J. McPhee   <ptjm@interlog.com>
5088
5089         * awk.h (ATTRIBUTE_EXPORTED): New macro for dynamic libs on Windows32.
5090         * CONVMFTidx, stack_ptr, do_lint, lintfunc: Now have this attribute.
5091
5092 Mon Jun  9 13:11:33 2003  Arnold D. Robbins  <arnold@skeeve.com>
5093
5094         Clean up of Stepan's patches.
5095
5096         * array.c (get_actual): Renamed from r_get_array. Added second
5097         param canfatal if routine should print fatal message when not an array.
5098         (get_actual): Renamed 'prm' to `isparam'.
5099         (array_vname): Add static msglen var; only realloc string if it grows.
5100         Don't use `s += sprintf(...)'. No good on old systems where sprintf
5101         returns char *.  Minor formatting cleanups.
5102         (do_adump): Restored separate `a' and `r' variables; helps for debugging.
5103
5104         * awk.h (SCALAR, UNINITIALIZED): Removed entirely, renumbered other flags.
5105         (get_array, get_param): New macros, calls get_actual.
5106         (get_actual): Declaration changed from that of r_get_array.
5107
5108         * awkgram.y (release_all_vars): Restored previous version of code; new
5109         version isn't right for Node_xx variables.
5110         (variable): Minor code cleanup for readability.
5111
5112         * builtin.c (do_match): Use get_param and print our own message when
5113         third parameter is not an array.
5114
5115         * eval.c: Added a few comments here and there, removed some no longer
5116         needed comments.
5117
5118         * field.c (do_split): Use get_param and print our own message when
5119         second parameter is not an array.
5120
5121 Mon Jun  9 11:46:21 2003  Arnold D. Robbins  <arnold@skeeve.com>
5122
5123         * array.c (do_delete): Initialize hash1 and last to keep gcc -Wall happy.
5124         * io.c (rsnullscan): Comment out label skip_leading for same reason.
5125
5126 Wed May 28 08:31:23 CEST 2003  Stepan Kasal  <kasal@math.cas.cz>
5127
5128         * eval.c (forloops_active, in_function): Nuked.
5129         (pop_all_forloops, pop_fcall_stack): Are now inline.
5130
5131 Wed May 28 07:58:35 2003  Stepan Kasal  <kasal@math.cas.cz>
5132
5133         * field.c, awk.h (Null_field): No longer static.
5134         * field.c (init_fields): Initial value of $0 can be Nnull_string,
5135           no need to copy it.
5136         * eval.c (r_get_lhs) <Node_field_spec>: Test for uninitialized field,
5137           which is Nnull_string for $0 and Null_field for $(>0).
5138         * builtin.c (do_print_rec): Test for uninitialized $0.
5139
5140 Tue May 27 17:03:02 2003  Stepan Kasal  <kasal@math.cas.cz>
5141
5142         * awk.h (Node_var_new): New node type for variables which can be
5143         either scalar or array.  From now on, Node_var is always scalar.
5144         (Node_gvar_ref): Nuked, its role can be taken by Node_array_ref.
5145         (orig_var): Removed, orig_array is enough.
5146         (SCALAR, UNINITIALIZED): Flags nuked.
5147         (var_uninitialized): New macro to distinguish uninitialized vars;
5148         used in several other macros.
5149         * array.c (r_get_array, array_vname, do_adump): Adapt to the
5150         above changes.
5151         * awkgram.y, eval.c, field.c, main.c, node.c, profile.c: Ditto.
5152
5153 Tue May 27 14:27:50 2003  Stepan Kasal  <kasal@math.cas.cz>
5154
5155         * array.c (r_get_array): New function, which goes all the way
5156         through Node_param_list to actual Node_var_array; if it encounters
5157         non scalar Node_var, it changes it to Node_var_array.
5158         (in_array, do_delete, do_delete_loop, do_adump, assoc_sort_inplace):
5159                 Use get_array.
5160         (assoc_lookup): The parameter must be a Node_var_array.
5161         * awk.h (get_array, r_get_array): Declare the new function and define
5162         a macro to speed it up.
5163         * builtin.c (do_match): Use get_array.
5164         * eval.c (interpret) <Node_K_arrayfor>: Ditto.
5165         (r_get_lhs) <Node_K_arrayfor>: Ditto.
5166         * field.c (do_split): Ditto.
5167
5168 Tue May 27 08:23:51 2003  Stepan Kasal  <kasal@math.cas.cz>
5169
5170         Changed node->vname meaning for type Node_array_ref and Node_gvar_ref.
5171         It contains only the reference name; one has to (recursively) follow
5172         node->prev_array to find out the call history for the array.
5173
5174         * array.c (array_vname): New function to print the array name.
5175         (assoc_lookup, do_delete): Use array_vname.
5176         * eval.c (interpret, r_tree_eval, r_get_lhs): Use array_vname.
5177         (push_args, pop_fcall): Things have simplified.
5178         * awk.h (array_vname): Declare.
5179         (prev_array): Define.
5180
5181 Sun Jun  8 11:25:36 2003  Stepan Kasal  <kasal@ucw.cz>
5182
5183         * awkgram.y (append_right): When using savetail, remember that it
5184         is not necessarily the tail of the list---it's just a pointer to
5185         the last chunk appended.
5186
5187 Thu Jun  5 12:01:41 2003  Arnold D. Robbins  <arnold@skeeve.com>
5188
5189         * builtin.c (do_strtonum): Make `strtonum(13)' work.
5190
5191 Wed Jun  4 17:07:06 2003  Corinna Vinschen  <vinschen@redhat.com>
5192
5193         * io.c (binmode): Include function for __CYGWIN__ too.
5194
5195 Tue Jun  3 12:40:50 2003  Arnold D. Robbins  <arnold@skeeve.com>
5196
5197         * eval.c (interpret): Node_K_switch.  For regex case, don't
5198         call `free_temp' on the result of `force_string' if it's equal to
5199         switch_value. Thanks to John DuBois <spcecdt@armory.com>
5200         for finding the problem.
5201
5202 Sun Jun  1 13:08:22 2003  Arnold D. Robbins  <arnold@skeeve.com>
5203
5204         * builtin.c (format_tree): For %c, force precision to 1.
5205
5206 Wed May 28 11:55:48 2003  Arnold D. Robbins  <arnold@skeeve.com>
5207
5208         * awkgram.y (isnoeffect, isassignable): Add Node_TEXTDOMAIN to
5209         switches in both functions.
5210
5211 Wed May 28 11:38:59 2003  Stepan Kasal  <kasal@math.cas.cz>
5212
5213         * awkgram.y (switch_body): Remove rule ``switch_body:/*empty/''
5214         as ``switch_body:case_statements'' covers it---this disambiguation
5215         fixes a reduce/reduce conflict.
5216
5217 Sun May 25 16:23:43 2003  Corinna Vinschen  <vinschen@redhat.com>
5218
5219         * configure.ac: Remove linking against /usr/lib/automode.o.
5220         * configure: Regenerate.
5221
5222 Sun May 25 15:19:19 2003  Stepan Kasal  <kasal@math.cas.cz>
5223
5224         * awk.h (get_lhs): For an initialized Node_var, you may return
5225         the address of var_value pointer, no matter whether reference
5226         bit was set or not.  We were silly slowing down most of the
5227         assignements.
5228
5229         * (get_a_record): After grow_iop_buffer, move recm.rt_start even
5230         if recm.len == 0.
5231
5232 Mon May 19 16:55:59 2003  Arnold D. Robbins  <arnold@skeeve.com>
5233
5234         Code for C-style switch statements. Initial version contributed by
5235         Michael Benzinger <Michael.Benzinger@sabre-holdings.com>.
5236
5237         Disabled by default, use `configure --enable-switch' to turn it on.
5238
5239         * configure.ac: New AC_ARG_ENABLE for switch statements.
5240         * awk.h (NODETYPE): New types for switch, case, default keywords
5241         and respective lists.
5242         * awkgram.y: New productions for switch statement. Does checking to
5243         avoid duplicate cases.
5244         * eval.c (nodetypes): New entries for new NODETYPEs.
5245         (interpret): New code to do switch execution.
5246         * profile.c (pprint): New code to print switch statements.
5247
5248 Mon May 19 15:05:43 2003  Arnold D. Robbins  <arnold@skeeve.com>
5249
5250         * configure.ac: Renamed from configure.in.
5251         * fixvers: Now looks in configure.ac.
5252         * Makefile.am: Now cites configure.ac.
5253
5254         * Misc other: Updated to Automake 1.7.5.
5255
5256 Sun May 18 12:03:56 2003  Arnold D. Robbins  <arnold@skeeve.com>
5257
5258         * array.c (do_delete_loop): Fix bracing of logic for
5259         tests.
5260
5261 Wed May 14 09:01:16 2003  Stepan Kasal  <kasal@math.cas.cz>
5262
5263         Misc patches:
5264
5265         * builtin.c (do_match): If third parameter to `match' is supplied,
5266         store all subexpressions which are applicable, even though there
5267         are some unused between them.
5268
5269         * awkgram.y (yylex): When returning from unterminated REGEXP
5270         (which is /* kludge */), take care to fake a yylval, to
5271         prevent ``internal error'' later.
5272
5273 Sun May 11 15:51:00 2003  Stepan Kasal  <kasal@math.cas.cz>
5274
5275         * io.c (rsnullscan, get_a_record): Boundary condition bug fixes.
5276
5277 Sun May 11 15:15:20 2003  Scott Deifik  <scottd@amgen.com>
5278
5279         * awk.h: Add decls for `memcpy_ulong', `memset_ulong', and
5280         MSC defines.
5281         * regex.c: Include <stdio.h> if MSC for size_t.
5282
5283 Mon May  5 15:11:06 2003  Arnold D. Robbins  <arnold@skeeve.com>
5284
5285         * io.c (get_a_record): Only tweak RT's value in place if the current
5286         RS scanner is the same as the last one. Bug report submitted by
5287         John DuBois (<spcecdt@armory.com>).
5288
5289 Fri May  2 14:39:48 2003  Arnold D. Robbins  <arnold@skeeve.com>
5290
5291         * io.c (get_a_record): Add logic at end to be smart about setting
5292         RT.  Saves considerable time, esp for default case where RS = "\n".
5293
5294 Wed Apr 30 11:44:38 2003  Arnold D. Robbins  <arnold@skeeve.com>
5295
5296         * field.c (do_split): Add check and code for Node_gvar_ref.
5297         * array.c (in_array, do_delete, asort_actual): Same.
5298         * builtin.c (do_split): Same for 3rd arg array parameter.
5299         * eval.c (interpret): Same for Node_K_array_for.
5300         (push_args): Same for evaluating extra args.
5301
5302 Tue Apr 29 15:54:28 2003  Arnold D. Robbins  <arnold@skeeve.com>
5303
5304         Record reading code redone/simplified considerably.
5305
5306         * awk.h (IOBUF): Removed total field, no longer used.
5307         * io.c (at_eof, has_data, no_data_left): New macros.
5308         (RECVALUE, SCANSTATE): New enumerated types.
5309         (rs1get_a_record, rsnull_get_a_record, rsre_get_a_record): Removed.
5310         (get_a_record): Rewritten, again. Now contains just buffer and
5311         record code; searching code moved into these functions:
5312         (rs1scan, rsnullscan, rsrescan): New functions to scan a buffer
5313         for record contents and terminator. Fill in values in:
5314         (struct recmatch): Holds found record and terminator.
5315         (spec_setup): Set iop->dataend to indicate data is already in buffer.
5316         (nextfile, inrec): Use new macros instead of flag and pointer tests.
5317         (set_RS): Set scanning function instead of record function.
5318
5319         FWIW, it all passes `make test'.
5320
5321 Sun Apr 27 21:02:39 2003  Arnold D. Robbins  <arnold@skeeve.com>
5322
5323         * io.c (do_close): At end, if do_posix return 0. See comment in code.
5324
5325 Tue Apr 15 09:56:03 2003  Isamu Hasegawa  <isamu@yamato.ibm.com>
5326
5327         * configure.in: Check existence of wcrtomb, and wcscoll.
5328         * configh.in: Likewise.
5329         * configure: Re-generate.
5330         Thanks to Kimura Koichi <kimura.koichi@canon.co.jp> for reporting.
5331
5332 Sun Apr 13 16:02:10 2003  Arnold D. Robbins  <arnold@skeeve.com>
5333
5334         * main.c (main): Add call to `setlocale' for LC_NUMERIC after program is
5335         parsed.
5336         (arg_assign): Switch back to "C" locale for LC_NUMERIC for command
5337         line assignments; this is per POSIX that period is decimal point for
5338         program and command line assignments and the locale's separator
5339         applies for input, output, and string to number conversion.
5340
5341 2003-03-26  Paul Eggert  <eggert@twinsun.com>
5342
5343         * builtin.c [HAVE_INTTYPES_H]: Include <inttypes.h>.
5344         [!HAVE_INTTYPES_H && HAVE_STDINT_H]: Include <stdint.h>.
5345         (CHAR_BIT, INTMAX_MIN, UINTMAX_MAX): Define if the system does not.
5346         (TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): New macros, taken from
5347         coreutils and many other GNU utilities.
5348         (format_tree): When formatting, use widest possible integers
5349         rather than settling with 'long'.
5350         (do_lshift, do_rshift, do_and, do_or, do_xor, do_compl): Likewise,
5351         when doing bitwise operations.
5352         * configure.in (jm_AC_TYPE_LONG_LONG, jm_AC_TYPE_UNSIGNED_LONG_LONG,
5353         jm_AC_TYPE_INTMAX_T, jm_AC_TYPE_UINTMAX_T): Add, since the mainline
5354         code now needs this.
5355         * doc/gawk.texi (Control Letters, Bitwise Functions): Document this.
5356         * m4/intmax_t.m4: New file, taken from coreutils (but renamed to
5357         avoid collision with our m4/inttypes.m4).
5358         * m4/longlong.m4: New file, taken from coreutils.
5359         * m4/uintmax_t.m4, m4/ulonglong.m4: Remove; superseded by the above
5360         new m4 files.
5361
5362         * builtin.c (BITS_PER_BYTE): Remove; use CHAR_BIT instead, since
5363         it's the standard name.
5364         (do_lshift, do_rshift): Complain if the shift width is exactly equal
5365         to the word size, too.
5366
5367 Thu Mar 27 10:44:11 2003  Arnold D. Robbins  <arnold@skeeve.com>
5368
5369         * io.c (rs1_get_a_record, rsnull_get_a_record, rsre_get_a_record):
5370         Enhance check for no data left in file to be only if file has
5371         non-zero size.  Linux files such as /proc/filesystems stat as a
5372         regular file of size 0, but actually have contents. Ugh.
5373         Thanks to Martin Schlemmer <azarah@gentoo.org> for the bug report.
5374
5375 Wed Mar 26 12:19:32 2003  Arnold D. Robbins  <arnold@skeeve.com>
5376
5377         * builtin.c (format_tree): Add a lint warning at label `out_of_range'.
5378
5379 Tue Mar 25 12:24:38 2003  Arnold D. Robbins  <arnold@skeeve.com>
5380
5381         * awkgram.y (variable): For array subscript, if NAME is in the
5382         symbol table, but not a variable, array, or parameter, generate
5383         a syntax error.
5384         (isarray): New function, tests if a symbol can be an array.
5385
5386         * custom.h: Add check for HP/UX, needed for GCC.
5387
5388 Mon Mar 17 09:21:09 2003  Arnold D. Robbins  <arnold@skeeve.com>
5389
5390         Allow simultaneous manipulation of a global array directly
5391         and when passed as a parameter.
5392
5393         * awk.h (Node_gvar_ref): New nodetype.
5394         [orig_var]: New macro.
5395         * array.c (do_delete_loop, do_delete): Add logic to handle
5396         seeing Node_gvar_ref.
5397         * eval.c (nodetypes): Add Node_gvar_ref.
5398         (r_tree_eval, r_get_lhs): Add Node_gvar_ref case.
5399
5400 Wed Mar 19 14:10:31 2003  Arnold D. Robbins  <arnold@skeeve.com>
5401
5402         This time for sure.
5403                 -- Bullwinkle
5404
5405         * Release 3.1.2: Release tar file made.
5406
5407 Wed Mar 19 14:08:11 2003  Arnold D. Robbins  <arnold@skeeve.com>
5408
5409         * awkgram.y: Production `program --> program error'. Add a return so
5410         that we don't produce an infinite stream of error messages.
5411         Thanks to Michael Mauch <michael.mauch@gmx.de> for pointing this out.
5412
5413 Wed Mar 19 13:45:50 2003  Corinna Vinschen  <vinschen@redhat.com>
5414
5415         * regex.c [RE_ENBABLE_I18N]: Remove definition; the one in
5416         regex_internal.h is better and makes things work with Cygwin.
5417
5418 Tue Mar 11 11:54:20 2003  Arnold D. Robbins  <arnold@skeeve.com>
5419
5420         * regex_internal.h: Don't include <limits.h> after <regex.h> was
5421         included in regex.c, since it could redefine RE_DUP_MAX to a lower
5422         value.
5423         (bitset_set, bitset_clear, bitset_contain): Use 1UL instead of 1 in
5424         left shift operations.
5425         * regex.c: Include <limits.h> before <regex.h>
5426         * regcomp.c (re_compile_fastmap_iter, init_word_char, parse_expression):
5427         Use 1UL instead of 1 in left shift operations.
5428
5429 Mon Mar 10 15:45:37 2003  Corinna Vinschen  <vinschen@redhat.com>
5430
5431         * configure.in: Update CYGWIN case to add /usr/lib/automode.o.
5432
5433 Thu Mar  6 11:07:36 2003  Arnold D. Robbins  <arnold@skeeve.com>
5434
5435         Updated to automake 1.7.3.
5436
5437         * config.guess, config.sub: Updated from prep.
5438         * Makefile.am (AUTOMAKE_OPTIONS): Add dist-bzip2 to get .bz2 files.
5439
5440 Tue Mar  4 10:40:46 2003  Arnold D. Robbins  <arnold@skeeve.com>
5441
5442         * version.in: Added goop for K&R compilers; forgot that I have to fix
5443         this file which then is used to create version.c.
5444
5445 Mon Mar  3 17:00:44 2003  Arnold D. Robbins  <arnold@skeeve.com>
5446
5447         * configure.in: New option --disable-lint.
5448         * awk.h (do_lint, do_lint_old): Conditionally declare based on NO_LINT.
5449         * eval.c (set_LINT): Ifdef out body if NO_LINT.
5450         * main.c (do_lint, do_lint_old): Conditionally compile properly.
5451         (main): Handle --lint argument code.
5452
5453 Fri Feb 28 10:43:07 2003  Arnold D. Robbins  <arnold@skeeve.com>
5454
5455         * main.c (main): Add LC_TIME to the things that get set with
5456         setlocale().
5457         * builtin.c (format_tree): Change test of `n0-- <= 0' to ==, avoids
5458         VMS diagnostic.
5459
5460 Thu Feb 27 17:48:29 2003  Pat Rankin  <rankin@pactechdata.com>
5461
5462         * regexec.c (proceed_next_node): Cast re_string_get_buffer to char *.
5463         (get_subexp): Likewise.
5464
5465 Tue Feb 25 12:33:41 2003  Arnold D. Robbins  <arnold@skeeve.com>
5466
5467         * regex_internal.h, regex_internal.c, regcomp.c, regexec.c:
5468         Make MB_CUR_MAX into thread local variable re_mb_cur_max.
5469
5470         Unrelated, from Scott Deifik:
5471
5472         * io.c (grow_iop_buffer): Add checks for overflow of new buffer size.
5473
5474 Mon Feb 24 13:30:59 2003  Arnold D. Robbins  <arnold@skeeve.com>
5475
5476         * awk.h (gawk_mb_cur_max): Declared:
5477         * main.c (gawk_mb_cur_max): Defined, init to 1.
5478         (main): Initialize gawk_mb_cur_max.
5479         * awkgram.y, builtin.c, eval.c, field.c, io.c, re.c (mb_cur_max):
5480         Replaces all instances of MB_CUR_MAX, which is a function call (!)
5481         in glibc.  Big speed up, especially for -Fx case, where x is a
5482         single character.
5483
5484         Unrelated:
5485
5486         * awkgram.y (rule): For non-existent action, use a Node_K_print_rec
5487         node.
5488
5489 Sun Feb 23 15:45:20 2003  Arnold D. Robbins  <arnold@skeeve.com>
5490
5491         Speed up plain `print' and `print $0':
5492
5493         * awk.h (Node_K_print_rec): New node type.
5494         (do_print_rec): Declare function.
5495         * awkgram.y (simple_stmt): Create humongous test for plain `print'
5496         or `print $0', and if so, use a Node_K_print_rec for it.  Modify
5497         test for lint message.
5498         * builtin.c (redirect_to_fp): New function for common code to get fp
5499         and rp for do_print{,f,_rec} functions.
5500         (do_print): Use redirect_to_fp().
5501         (do_printf): Use redirect_to_fp().
5502         (do_print_rec): New function to just print $0 from field_arr[0]
5503         directly; will rebuild the record first if necessary.
5504         * eval.c (nodetypes): Add Node_K_print_rec.
5505         (interpret): Add Node_K_print_rec case.
5506         * profile.c (pprint): Add Node_K_print_rec case.
5507         (pp_print_stmt): If null lnode, print "$0" else print the lnode.
5508
5509         Unrelated:
5510
5511         * regex_internal.h: Add ENABLE_NLS to the condition for using
5512         gettext so that --disable-nls really disables it.
5513
5514 Sat Feb 23 22:46:00 2003  Arnold D. Robbins  <arnold@skeeve.com>
5515
5516         * io.c (rs1_get_a_record, rsnull_get_a_record, rsre_get_a_record):
5517         Modify buffer-filling algorithm to always read one or more multiples
5518         of the blocksize (iop->readsize).
5519         (grow_iop_buffer): Make sure there's room for the current partially
5520         read record and one disk block buffer.
5521
5522 Thu Feb 20 22:02:00 2003  Arnold D. Robbins  <arnold@skeeve.com>
5523
5524         * re.c (research): Fix typo in cast of precision value to int.
5525         * regex.h, regex.c, re_internal.h, re_internal.c, regcomp.c, regexec.c:
5526         synced to GLIBC source, maintaining K&R portability changes, and bug
5527         fixes, although losing ability to compile each file separately.
5528         * Makefile.am (SOURCES): Moved placement of regex source files from here ...
5529         (EXTRA_DIST): ... to here.
5530
5531 Tue Feb 18 14:17:33 2003  Arnold D. Robbins  <arnold@skeeve.com>
5532
5533         * re.c (research): Cast precision value to int.
5534         * builtin.c (format_tree): For toofew, cast field width value to int.
5535         * io.c (rsre_get_a_record): Initialize restart and reend. Add a variable
5536         to make sure they're set before used at end of function.
5537         (iopflags2str): Removed decl at top and made not static so that GCC
5538         stops complaining that it's defined but not used. Bleah.
5539
5540 Mon Feb 17 11:02:34 2003  Arnold D. Robbins  <arnold@skeeve.com>
5541
5542         * config.guess, config.sub: Updated from prep.
5543
5544 Sun Feb 16 15:47:15 2003  Scott Deifik  <scottd@amgen.com>
5545
5546         * awk.h (format_tree, make_str_node): Changed decls to match how
5547         they are called.
5548         * builtin.c (format_tree, sub_common): Same.
5549         * node.c (make_str_node): Same.
5550
5551 Wed Feb  5 14:18:01 2003  Arnold D. Robbins  <arnold@skeeve.com>
5552
5553         * awk.h: Removed duplicate decl of set_prof_file(). Removed
5554         undef of const for non-ANSI C; config.h should handle it.
5555         * msg.c (set_loc): Use srcfile and srcline in regular code to shut up
5556         stupid SGI compiler.
5557
5558 Tue Feb  4 14:28:06 2003  Arnold D. Robbins  <arnold@skeeve.com>
5559
5560         All relevant files: Copyright year updated to 2003.
5561
5562 Tue Feb  4 13:40:41 2003  Martin C. Brown  <mc@whoever.com>
5563
5564         * intl/libgnuintl.h: Preprocessor fixes for MacOS X.
5565         * regex.h: Ditto.
5566
5567 Tue Feb  4 13:39:37 2003  Arnold D. Robbins  <arnold@skeeve.com>
5568
5569         * awkgram.y (builtin_func): New string for use in rationalizing
5570         function parsing and installation code.
5571
5572 Sun Feb  2 16:00:55 2003  Arnold D. Robbins  <arnold@skeeve.com>
5573
5574         Cache function body code pointer so that only have to find it the
5575         first time a function is called.  This potential for optimization
5576         brought to my attention by Stepan Kasal.
5577
5578         * awk.h [funcbody]: New macro.
5579         * awkgram.y (FUNC_CALL): Set $$->funcbody to NULL.
5580         * eval.c (func_call): Changed to take top-level Node_func_call as the
5581         single parameter.  Do the lookup and caching.
5582         (r_tree_eval): Change how func_call() is called in switch.
5583         * profile.c (pp_func_call): Similar changes.
5584         (tree_eval): Ditto.
5585
5586 Sun Feb  2 15:32:42 2003  Stepan Kasal  <kasal@math.cas.cz>
5587
5588         ADR: More grammar rationalization/repair from Stepan.
5589
5590         * awkgram.y (common_exp, simp_exp): The rule from getline (without
5591           pipe) has been moved from common_exp to simp_exp.
5592
5593         The redirection of print statements reworked.  The idea comes from
5594         mawk-1.3.3; much thanks to Michael Brennan!
5595
5596         * awkgram.y (IO_OUT, IO_IN): New tokens.
5597           (APPEND_OP, TWOWAYIO): Swallowed by the above ones.
5598           (in_print, in_parens): New static variables, to trace whether
5599           IO_OUT is expected.
5600           (yylex): Emit the new tokens, update in_parens on '(' and ')'.
5601           (exp): The print command(s) reworked.
5602           (oputput_redir): Reworked.
5603           (print_expression_list): New non-terminal.
5604           (rexp, rexpression_list opt_rexpression_list): Nuked.
5605           (exp, simp_exp): ``cmd|getline'' rule changed to
5606           ``cmd IO_IN getline'' and moved from exp to simp_exp.
5607
5608         Unrelated:
5609
5610         * awkgram.y (variable): Don't return Node_func, issue a fatal
5611           error instead.
5612         * eval.c (r_tree_eval, r_get_lhs): Omit special checks for Node_func,
5613           nodes of this type cannot get into the program tree.
5614         * profile.c (tree_eval, pp_lhs): Likewise.
5615
5616 Thu Jan 30 17:42:05 2003  Stepan Kasal  <kasal@math.cas.cz>
5617
5618         ADR: Applied lots of patches from Stepan.
5619
5620         * array.c (do_delete_loop): Call after_assign for the loop index.
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.
5625         * awk.h (dupnode): Changed to macro, function renamed to r_dupnode.
5626         * node.c (dupnode, r_dupnode): Rename.
5627         * awkgram.y (parms_shadow): Return bool value, ...
5628           (shadow_funcs): ... which will enable us to end the program if
5629           lintfunc is fatal.
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.
5645
5646 Mon Jan 27 14:12:19 2003  Arnold D. Robbins  <arnold@skeeve.com>
5647
5648         * io.c (iop_close): Based on report by Stepan Kasal and because of
5649         his changes, don't call reset_record() when saving a copy of contents
5650         of $0.
5651         * awkgram.y: Improved function parsing error messages for case where
5652         user uses a builtin name as a function name.  Based on error report
5653         by Stepan Kasal.
5654         * ext.c (make_builtin): Set FUNC flag for new function.  Based on error
5655         report by Stepan Kasal.
5656
5657 Mon Jan 27 14:06:20 2003  Stepan Kasal  <kasal@math.cas.cz>
5658
5659         * field.c (reset_record): No longer call set_record(), the code is
5660           moved to the function body.  Do not set MAYBE_NUM.
5661           (set_record): Call reset_record() to perform the common tasks.
5662           The prototype has changed, change awk.h and all callers.
5663
5664 Mon Jan 27 10:50:03 2003  Arnold D. Robbins  <arnold@skeeve.com>
5665
5666         * awk.h (NODE): `proc' renamed to `builtin,' to fix a conflict
5667           on some systems.  Replaced on all spots where it was used.
5668
5669 Sun Jan 26 11:52:01 2003  Arnold D. Robbins  <arnold@skeeve.com>
5670
5671         * awk.h [NUMSUBPATS]: New macro.
5672         * builtin.c (do_match): Use it in loop that fills in subpattern info.
5673         * eval.c (r_tree_eval): For Node_assign, don't call free_temp(),
5674           as assign_val() contains dupnode(), which would clear the TEMP
5675           flag. From Stepan Kasal <kasal@math.cas.cz>.
5676         * config.sub: Updated from prep.
5677
5678 Sun Jan 19 22:34:01 2003  Arnold D. Robbins  <arnold@skeeve.com>
5679
5680         * awk.h (do_asorti): Add declaration.
5681         * awkgram.y (tokentab): Add asorti() function to table.
5682         * array.c (ASORT_TYPE): New enumerated type for VALUE or INDEX array
5683         sorting.
5684         (assoc_sort_inplace): New second arg of type ASORT_TYPE. Additional code
5685         to rearrange array so rest of merge-sorting works; basically values are
5686         tossed and index moved into value spot.
5687         (asort_actual): Renamed from do_asort(). Takes new ASORT_TYPE argument.
5688         (do_asort): Calls asort_actual(tree, VALUE).
5689         (do_asorti): Calls asort_actual(tree, INDEX).
5690
5691         * main.c (load_procinfo): Free groupset array when done with it.
5692
5693 Thu Jan 16 18:30:50 2003  Arnold D. Robbins  <arnold@skeeve.com>
5694
5695         * builtin.c (do_match): Revised to provide start and length
5696         indices in array 3rd parameter.
5697         * config.guess, config.sub: Updated from prep.
5698
5699 Thu Jan  2 11:09:12 2003  Arnold D. Robbins  <arnold@skeeve.com>
5700
5701         Updated to bison 1.875.
5702
5703 Tue Dec 31 17:14:45 2002  Arnold D. Robbins  <arnold@skeeve.com>
5704
5705         Updated things to automake 1.7.2 and autoconf 2.57.
5706
5707 Tue Dec 31 16:54:44 2002  Arnold D. Robbins  <arnold@skeeve.com>
5708
5709         * awk.h [IOP_CLOSED]: New flag.
5710         * io.c (iop_close): Set IOP_CLOSED flag.
5711         (inrec): Check for IOP_CLOSED; if set return EOF.
5712         (rs1_get_a_record, rsnull_get_a_record): Check for EOF before
5713         refilling buffers.
5714         (rsre_get_a_record): Ditto. Also, set RT before updating pointers in IOP.
5715         * Makefile.am (efence): New target to compile with Electric Fence.
5716
5717 2002-12-23  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
5718
5719         * awk.h (catchsig): Delete prototype.
5720         * main.c (catchsig): Make static and remove excess argument.
5721         (main): Delete unnecessary casts.
5722         * io.c (rs1_get_a_record, rsnull_get_a_record): Mark parameter
5723         with ATTRIBUTE_UNUSED.
5724
5725 Mon Dec 23 11:54:07 2002  Arnold D. Robbins  <arnold@skeeve.com>
5726
5727         * regex_internal.h, regex_internal.c, regcomp.c, regexec.c, version.c:
5728         Fixed to compile, once again, under K&R compilers.
5729         * io.c (grow_iop_buffer): Fix calculation of new size to
5730         first subtract 2, double, then add 2 back in.
5731
5732 Fri Dec 20 11:48:42 2002  Arnold D. Robbins  <arnold@skeeve.com>
5733
5734         get_a_record split into three routines.
5735
5736         * awk.h (IOBUF): Structure reworked for new code.
5737         * io.c (get_a_record): Now a pointer to different functions.
5738         (rs1_get_a_record, rsnull_get_a_record, rsre_get_a_record): New functions.
5739         (iop_alloc, iop_close): Reworked for new structure.
5740         (do_getline, inrec): Modifiend for new EOF condition.
5741         (iopflags2str): New routine.
5742
5743 Fri Dec 20 11:05:50 2002  Isamu Hasegawa  <isamu@yamato.ibm.com>
5744
5745         * regex.c, regex_internal.c, regex_internal.h: Changes to allow separate
5746         compilation of the reg*c files.
5747         * regcomp.c: Fix bug in using translation tables with [[:upper:]] etc.
5748         * Makefile.am: Move regex files into sources from EXTRA_DIST. (ADR)
5749
5750 Mon Dec  9 14:20:42 2002  Stepan Kasal  <kasal@math.cas.cz>
5751
5752         * main.c (main): When processing option '-f' don't ignore spaces
5753           if optarg points at the beginning of the current argument
5754           (like ``gawk -f " " file'').
5755
5756 2002-11-30  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
5757
5758         * awkgram.y (stopme): Mark parameter with ATTRIBUTE_UNUSED.
5759         (yyerror): Add ATTRIBUTE_PRINTF_1.
5760         * builtin.c (do_systime, do_rand): Likewise.
5761         * field.c (set_field, re_parse_field, def_parse_field,
5762         posix_def_parse_field, null_parse_field, sc_parse_field,
5763         fw_parse_field): Likewise.
5764         * io.c (pidopen, useropen): Likewise.
5765         * main.c (catchsig): Likewise.
5766         * profile.c (init_profiling): Likewise.
5767         * awk.h (err): Add ATTRIBUTE_PRINTF.
5768         * msg.c (err): Delete redundant prototype.  Fix format specifier.
5769
5770 Wed Nov 27 06:04:20 2002  Pat Rankin  <rankin@pactechdata.com>
5771
5772         * ext.c [#if !DYNAMIC] (do_ext): Cast string value for error node.
5773
5774 Sun Nov 24 18:23:29 2002  Arnold D. Robbins  <arnold@skeeve.com>
5775
5776         From Paul Eggert, with some edits by me.
5777
5778         * builtin.c (do_substr): Consistently use floating point
5779         values for lint messages, so they should be printed pretty
5780         much as the user saw them.  Check for overflow before
5781         converting floating point to integer.  Do the right thing with
5782         NaNs.
5783
5784         Check for index out-of-range before checking for length
5785         out-of-range, to avoid some nasty effects if address
5786         arithmetic overflows (e.g., indx + length < index).
5787
5788         Allow zero-length substrings when checking for lint if
5789         do_lint == LINT_INVALID.
5790
5791 Sun Nov 24 18:21:06 2002  Arnold D. Robbins  <arnold@skeeve.com>
5792
5793         * awk.h (LINT_ALL, LINT_INVALID): New constants.
5794         * main.c (main): Allow --lint=invalid which restricts warning to
5795         things that aren't valid.
5796         * eval.c (set_LINT): Update setting logic.
5797
5798 Wed Nov 20 13:14:58 2002  Arnold D. Robbins  <arnold@skeeve.com>
5799
5800         * awk.h (lintfunc): Improve ifdef for attribute to only
5801         work for GCC 3.2 and later.
5802         * io.c (PIPES_SIMULATED): Don't define if on AIX, which
5803         does define TANDEM in one of its header files. Ugh.
5804
5805 Tue Nov 19 15:33:55 2002  Arnold D. Robbins  <arnold@skeeve.com>
5806
5807         * builtin.c (do_substr): Use %lu in warnings instead of %d.
5808
5809 Mon Nov 18 14:42:53 2002  Arnold D. Robbins  <arnold@skeeve.com>
5810
5811         * config.guess: Synced from ftp.gnu.org.
5812         * config.sub: Ditto.
5813
5814 Sun Nov 17 21:32:49 2002  Arnold D. Robbins  <arnold@skeeve.com>
5815
5816         Updated things to automake 1.7.1.
5817
5818 Sun Nov  3 14:33:30 2002  Arnold D. Robbins  <arnold@skeeve.com>
5819
5820         * eval.c (r_get_lhs): For variables, always clear UNINITIALIZED,
5821         since the variable is about to be assigned to. From Stepan Kasal.
5822
5823 Fri Nov  1 11:19:01 2002  Arnold D. Robbins  <arnold@skeeve.com>
5824
5825         * awk.h (lintfunc): Can only supply attributes for a function
5826         pointer if GCC >= 3.  Added ifdefs.  Bah, humbug.
5827
5828 2002-10-30  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
5829
5830         * array.c (array_init, concat_exp, assoc_find, do_delete):
5831         Const-ify.
5832         * awk.h (redirect, set_record, pp_func, pp_string_fp, format_val,
5833         parse_escape, make_regexp, research, reisstring, remaybelong):
5834         Likewise.
5835         * awkgram.y (dumpintlstr, dumpintlstr2, func_use, dup_parms,
5836         var_comp, finfo, fcompare, func_use, dumpintlstr, dumpintlstr2):
5837         Likewise.
5838         * builtin.c (stdfile, do_fflush, do_index, category_table):
5839         Likewise.
5840         * eval.c (push_forloop, push_args, PUSH_BINDING, RESTORE_BINDING,
5841         cmp_nodes, op_assign, loop_info, fcall, fmt_ok, set_LINT,
5842         comp_func): Likewise.
5843         * ext.c (do_ext): Likewise.
5844         * field.c (set_record): Likewise.
5845         * io.c (gawk_popen, two_way_open, binmode, redirect, getredirect,
5846         fatal): Likewise. 
5847         * node.c (values, format_val, make_str_node, parse_escape): Likewise.
5848         * profile.c (pp_string, pp_match_op, pp_func, pp_string,
5849         pp_string_fp): Likewise.
5850         * re.c (make_regexp, research, reisstring, remaybelong): Likewise.
5851
5852 2002-10-30  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
5853
5854         * awk.h (__attribute__, ATTRIBUTE_UNUSED, ATTRIBUTE_NORETURN,
5855         ATTRIBUTE_PRINTF, ATTRIBUTE_PRINTF_1, __extension__): Define.
5856         (emalloc, erealloc): Fix format specifier warnings.
5857         (do_nextfile):Mark with ATTRIBUTE_NORETURN.
5858         (getredirect): Const-ify.
5859         (msg, error, warning, r_fatal, lintfunc): Mark with
5860         ATTRIBUTE_PRINTF_1.
5861         (r_fatal): Mark with ATTRIBUTE_NORETURN.
5862         * builtin.c (format_tree): Fix format specifier warning.
5863         * eval.c (interpret): Likewise.
5864         * main.c (usage, copyleft, catchsig, nostalgia, version): Mark
5865         with ATTRIBUTE_NORETURN.
5866         * profile.c (dump_and_exit): Likewise.
5867
5868 2002-10-29  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
5869
5870         * array.c (array_init): Use ISDIGIT, not isdigit.
5871         * awk.h (m_tree_eval, force_number, force_string): Use
5872         __extension__ in statement expressions.
5873         * main.c (lintfunc): Fix !__SDTC__ case.
5874         * regex_internal.c (calc_state_hash): Fix inline declaration.
5875         * regexec.c (proceed_next_node): Cast assignment to correct type.
5876
5877 2002-10-29  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
5878
5879         * awk.h (exp_node, Func_ptr): Add prototype arguments.
5880         * awkgram.y (yystype, token, getfname, nextc, pushback,
5881         allow_newline, yylex): Likewise.
5882         * io.c (wait_any): Likewise.
5883         * profile.c (indent_in, indent_out): Likewise.
5884         * random.h (random): Likewise.
5885
5886 2002-10-29  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
5887
5888         * array.c (grow_table): Const-ify.
5889         * awk.h (RE_TRANSLATE_TYPE): Define.
5890         (flagtab, casetable): Const-ify.
5891         (getfname, shadow_funcs, redflags2str): Prototype.
5892         (flags2str, genflags2str, nodetype2str, redflags2str, set_loc,
5893         msg, error, warning, r_fatal): Const-ify.
5894         * awkgram.y (tokentab, snode): Likewise.
5895         * builtin.c (format_tree, do_strftime,
5896         localecategory_from_argument): Likewise.
5897         * eval.c (casetable, nodetypes, nodetype2str, flags2str,
5898         genflags2str): Likewise.
5899         * io.c (redflags2str, socketopen): Likewise.
5900         * main.c (varfile, version_string, lintfunc, optab, copyleft,
5901         varinit, init_vars): Likewise.
5902         * msg.c (srcfile, msg, warning, error, set_loc, r_fatal):
5903         Likewise.
5904         * profile.c (pp_op_assign, pp_match_op, pp_redir): Likewise.
5905         * random.c (sccsid): Likewise.
5906         * version.c, version.in (version_string): Likewise.
5907
5908 Tue Oct 29 10:50:52 2002  Arnold D. Robbins   <arnold@skeeve.com>
5909
5910         * configure.in: Update version in AC_INIT and AM_INIT_AUTOMAKE
5911         * fixvers: Make grep for pattern a little smarter.
5912
5913 Mon Oct 28 16:35:39 2002  Arnold D. Robbins   <arnold@skeeve.com>
5914
5915         * awk.h (hash): Now a function pointer.
5916         * array.c (gst_hash_string, scramble): New functions.
5917         (awk_hash): Renamed from hash.
5918         (hash): Now a function pointer.
5919         (array_init): Change hash function based on environment for
5920         experimentation.
5921
5922 Mon Oct 28 13:21:20 2002  Arnold D. Robbins   <arnold@skeeve.com>
5923
5924         Applied lots of patches from Stepan Kasal, tweaked as needed
5925         for current code base.
5926
5927         * node.c (dupnode): When n->stref overfows, flag the node as PERM.
5928         Same for n->ahname_ref.
5929         (unref): Remove the check for n->stref == LONG_MAX and
5930         n->ahname_ref == LONG_MAX.
5931         * awk.h (make_string): The third argument to make_str_node changed
5932         from FALSE to 0, it's not Boolean.
5933         (free_temp): Evaluate the argument only once, so that we
5934         can call free_temp(tree_eval(n)) for achieving side effects.
5935         (load_environ, load_procinfo): Changed return type to NODE *.
5936         * main.c (load_environ): The ENVIRON_node should be created with type
5937         Node_var_array and lnode set to NULL.  Return pointer to the created node
5938         and create an empty hash even on TANDEM.
5939         (load_procinfo): Same mods for PROCINFO_node.
5940         (init_args): ARGV_node should also have lnode set to NULL.
5941         * eval.c (r_tree_eval): case Node_assign moved just above the other
5942         assignment cases.
5943         (op_assign): ++ and -- cases merged with += and -=, respectively.
5944         (push_args): Evaluate all args, even in cases where more args are
5945         supplied then required.
5946         (interpret): In case Node_K_forarray, flag the variable
5947         num_elems also as volatile, so that it survives longjmp() and
5948         can be trusted when linting code.
5949         (r_get_lhs): Case Node_param_list was unreachable (unless
5950         something breaks really badly), remove it;
5951         (r_tree_eval): Case Node_var_array removed from the last switch,
5952         it was caught in the first switch above.
5953         * profile.c (tree_eval): Again, case Node_var_array was caught above.
5954         * awkgram.y (variable): Code simplified, making use of the above
5955         changes.
5956         * field.c (sc_parse_field): IGNORECASE only applies to regex based
5957         field-splitting, so remove code that pays attention to it.
5958         (do_split): Don't use parse_field if RS_is_null.
5959         (set_FS): Beware of FS == "\\" even if RS_is_null.
5960
5961         Code changes to make things work better:
5962         * field.c (set_FS): Don't use cmp_nodes() to compare old and new
5963         value of FS, that uses IGNORECASE, which is a bad idea. Improve
5964         logic for choosing sc_parse_field.  Ensure that when RS_is_null
5965         but using a single character, that we do pay attention to
5966         case when doing regex splitting.
5967         * io.c (set_RS): Don't use cmp_nodes() to compare old and new
5968         value of RS, that uses IGNORECASE, which is a bad idea.
5969
5970 Mon Oct 28 09:43:14 2002  Arnold D. Robbins   <arnold@skeeve.com>
5971
5972         * recomp.c (parse_expression): Change return statement into
5973         two so it'll compile for SGI cc.
5974
5975         * awk.h (STR, CUR): Changed to STRCUR and NUMCUR respectively,
5976         to avoid conflict with STR on some System V systems.  Changed
5977         in all source files.
5978
5979 Thu Oct 24 16:14:34 2002  Arnold D. Robbins   <arnold@skeeve.com>
5980
5981         * array.c (AVG_CHAIN_MAX): Now a variable, to allow easy experimentation.
5982         (array_init): Pulls a new value from env var AVG_CHAIN_MAX if it
5983         exists and sets the variable.
5984         * awk.h: Add declaration for array_init().
5985         * main.c (main): Call array_init().
5986
5987 Tue Oct 22 11:23:56 2002  Arnold D. Robbins   <arnold@skeeve.com>
5988
5989         * bisonfix.sed: Updated for current bison. Death to alloca!
5990
5991 2002-10-21  Isamu Hasegawa  <isamu@yamato.ibm.com>
5992
5993         * builtin.c (tolower, toupper): Add casts to char* to fix some
5994         compiler warnings.
5995         * eval.c (cmp_nodes): Ditto.
5996         * regcomp.c (peek_token_bracket): Skip the byte already read.
5997
5998 Wed Oct 16 15:02:09 2002  Arnold D. Robbins   <arnold@skeeve.com>
5999
6000         * io.c (set_RS): Make sure to always call set_FS().
6001
6002 2002-10-11  Isamu Hasegawa  <isamu@yamato.ibm.com>
6003
6004         * regcomp.c (re_compile_fastmap_iter): Remove the handling
6005         OP_CONTEXT_NODE.
6006         (regfree): Likewise.
6007         (create_initial_state): Likewise.
6008         (analyze): Remove the substitutions which became useless.
6009         (calc_first): Likewise.
6010         (calc_epsdest): Use edests of OP_BACK_REF in case that it has
6011         epsilon destination.
6012         (duplicate_node_closure): New function.
6013         (duplicate_node): Remove the handling OP_CONTEXT_NODE.
6014         (calc_inveclosure): Likewise.
6015         (calc_eclosure): Likewise.
6016         (calc_eclosure_iter): Invoke duplicate_node_closure instead of
6017         direct invocation of duplicate_node.
6018         (parse): Don't use comma operator in the return to avoid compiler
6019         warning.
6020         (parse_reg_exp): Likewise.
6021         (parse_branch): Likewise.
6022         (parse_expression): Likewise.
6023         (parse_sub_exp): Likewise.
6024         (parse_dup_op): Likewise.
6025         * regex_internal.c (re_dfa_add_node): Remove the substitutions
6026         which became useless.
6027         (create_ci_newstate): Remove the handling OP_CONTEXT_NODE.
6028         (create_cd_newstate): Likewise.
6029         * posix/regex_internal.h (re_token_type_t): Remove the obsolete type.
6030         (re_token_t): Likewise.
6031         (re_dfa_t): Likewise.
6032         (re_node_set_remove): New macro.
6033         * regexec.c (check_matching): Remove the handling
6034         OP_CONTEXT_NODE.
6035         (check_halt_node_context): Likewise.
6036         (proceed_next_node): Likewise.
6037         (pop_fail_stack): Fix the memory leak.
6038         (set_regs): Likewise.
6039         (free_fail_stack_return): New function.
6040         (sift_states_backward): Fix the memory leak.  Remove the handling
6041         OP_CONTEXT_NODE.
6042         (update_cur_sifted_state): Append some if clause to avoid redundant
6043         call.
6044         (sub_epsilon_src_nodes): Use IS_EPSILON_NODE since it might be a
6045         back reference.
6046         (check_dst_limits): Remove the handling OP_CONTEXT_NODE.
6047         (check_subexp_limits): Likewise.
6048         (search_subexp): Likewise.
6049         (sift_states_bkref): Likewise.
6050         (transit_state_mb): Likewise.
6051         (transit_state_bkref_loop): Likewise.
6052         (transit_state_bkref_loop): Likewise.
6053         (group_nodes_into_DFAstates): Likewise.
6054         (check_node_accept): Likewise.
6055         (sift_ctx_init): Add initializing.
6056
6057 Tue Oct 15 14:18:53 2002  Arnold D. Robbins   <arnold@skeeve.com>
6058
6059         * eval.c (set_IGNORECASE): Call set_RS() instead of
6060         set_FS_if_not_FIELDWIDTHS().  The former calls the latter
6061         for us, and also makes IGNORECASE affect RS like it's supposed to.
6062         * field.c (FS_re_yes_case, FS_re_no_case): New variables.
6063         (set_FS): Smarten up routine to not recompile FS_regexp if all
6064         that's changed is IGNORECASE or if switching back to FS from
6065         FIELDWIDTHS.  Significant speed-up for cases where IGNORECASE
6066         is assigned to for every record.
6067         * io.c (RS_re_yes_case, RS_re_no_case): New variables.
6068         (set_RS): Similar changes as to set_FS().  In particular,
6069         IGNORECASE changing now affects record splitting too.
6070         * re.c (refree): Set rp->pat.tranaslate to NULL. It comes
6071         from casetable and shouldn't be freed. (Strictly necessary
6072         only for old regex, but a good idea anyway).
6073         Also, call regfree(& rp->pat) instead of manually free()ing
6074         things, since there's dynamically allocated stuff hiding in
6075         the buffer. Avoids a memory leak.
6076
6077 Mon Oct 14 12:02:39 2002  Arnold D. Robbins  <arnold@skeeve.com>
6078
6079         Major space reduction in array management.  Overhead reduced
6080         to two NODE's per element from three.
6081
6082         * awk.h (ahash): Union is gone.
6083         (hash.ref): New union member.
6084         (ahnext): New definition into hash union.
6085         (ahvalue): New definition into hash union.
6086         (ahname_str): New member, points into hash union.
6087         (ahname_len): New member, points into hash union.
6088         (ahname_ref): New member, points into hash union.
6089         * array.c: Replaces uses of ahname member with string and
6090         length.  Set the reference count correctly to 1 on new nodes.
6091         * eval.c (interpret): Case for Node_K_arrayfor.  dupnode() the
6092         array indices, and set loop variable to new value made via
6093         make_string().
6094         * node.c (unref, dupnode): Node_ahash nodes are now also
6095         reference counted, a la strings.  Similar code is used to
6096         increment/decrement the counts, and/or copy nodes as
6097         needed.
6098
6099         Unrelated:
6100         * awk.h (forsub): Removed. Not used.
6101
6102 Sun Oct 13 16:58:27 2002  Stepan Kasal  <kasal@math.cas.cz>
6103
6104         * profile.c (pprint): #undef the temporary defines at the end
6105         of the case.
6106         * eval.c (interpret): Likewise.
6107         (assign_val): We can unref() before doing dupnode().
6108         Also, move the check for NF < 0 from here ...
6109         * field.c (set_NF): ... to here.
6110         * main.c (varinit): No need to call set_NF().
6111         * awkgram.y (statements): Don't be so generous when concatenating
6112         `statements' with a `statement'.
6113
6114
6115 2002-10-13  Isamu Hasegawa  <isamu@yamato.ibm.com>
6116
6117         * regcomp.c: Synced with development sources.
6118         * regex_internal.c: Synced with development sources.
6119         * regex_internal.h: Synced with development sources.
6120         * regexec.c: Synced with development sources.
6121
6122 Sun Oct 13 21:35:35 2002  Arnold D. Robbins  <arnold@skeeve.com>
6123
6124         * awk.h (NODE): Reflags is now unsigned long for:
6125         (exec_count): Defined to be sub.nodep.reflags.  Using `number'
6126         broke pgawk.
6127         * profile.c (Node_K_delete_loop): Print out as a for loop
6128         with a comment that it's internally the same as `delete array'.
6129         * eval.c (Node_K_delete_loop): Increment the exec_count. Ooops.
6130         * configure.in (AM_GNU_GETTEXT_VERSION): New macro call.
6131         * custom.h: Updated description of the file at the top.
6132
6133 Thu Oct 10 16:39:51 2002  Arnold D. Robbins  <arnold@skeeve.com>
6134
6135         * awk.h (vname, exec_count): Now macros into different
6136         parts of the NODE structure that can be safely used for them.
6137         Saves 16 bytes per NODE.
6138         * eval.c: Changed use of `vname' to `varname' to avoid new
6139         macro.
6140         * main.c (lintfunc): Made ifdefed decls match awk.h.
6141         * eval.c (comp_func): Use memcmp instead of strcmp.
6142         * configure.in (AC_CONFIG_HEADER): Physically append custom.h
6143         to config.h to avoid subdir compiliation problems.
6144
6145 Sun Oct  6 17:36:15 2002  Arnold D. Robbins  <arnold@skeeve.com>
6146
6147         Updated to automake 1.7 and bison 1.50.
6148
6149         * INSTALL: Replaced with current version from automake 1.7.
6150         * config.guess: Replaced with current version from automake 1.7.
6151         * config.sub: Replaced with current version from automake 1.7.
6152         * depcomp: Replaced with current version from automake 1.7.
6153         * doc/texinfo.tex: Replaced with current version from automake 1.7.
6154         * install-sh: Replaced with current version from automake 1.7.
6155         * missing: Replaced with current version from automake 1.7.
6156         * mkinstalldirs: Replaced with current version from automake 1.7.
6157         * ylwrap: Replaced with current version from automake 1.7.
6158
6159         * configure.in (DYNAMIC):  Updated AC_DEFINE(DYNAMIC) to
6160         three-argument form for autoheader.
6161         * acinclude.m4: Removed includes of jm-mktime.m4 and
6162         largefile.m4, which are now standard parts of Autoconf.
6163
6164         * Makefile.in: Regenerated.
6165         * aclocal.m4: Regenerated.
6166         * awkgram.c: Regenerated.
6167         * awklib/Makefile.in: Regenerated.
6168         * configure: Regenerated.
6169         * doc/Makefile.in: Regenerated.
6170         * test/Makefile.in: Regenerated.
6171
6172 Sun Sep 29 16:47:49 2002  Arnold D. Robbins  <arnold@skeeve.com>
6173
6174         * custom.h (__WIN32__): Added from gnuwin32 project, via
6175         Stepan Kasal.
6176
6177         * awkgram.y: For tawk compatibility, added `delete(array)'.
6178         To remain undocumented, since it's WAY non-standard.
6179
6180 Sun Sep 22 22:23:50 2002  Arnold D. Robbins  <arnold@skeeve.com>
6181
6182         * awk.h (re_cnt): Removed, not needed since no dfa code.
6183         * awkgram.y (regexp, a_regexp): Removed use of re_cnt.
6184         * re.c (re_update): Ditto.
6185
6186 Thu Sep 19 10:55:37 2002  Arnold D. Robbins  <arnold@skeeve.com>
6187
6188         * io.c (binmode): Create function if defined(WIN32) also.
6189
6190         Updated to gettext 0.11.5, autoconf 2.54 and automake 1.6.3.
6191
6192         * aclocal.m4: Regenerated.
6193         * m4/codeset.m4: Updated.
6194         * m4/gettext.m4: Updated.
6195         * m4/glibc21.m4: Updated.
6196         * m4/iconv.m4: Updated.
6197         * m4/lcmessage.m4: Updated.
6198         * m4/lib-ld.m4: Updated.
6199         * m4/lib-link.m4: Updated.
6200         * m4/lib-prefix.m4: Updated.
6201         * m4/progtest.m4: Updated.
6202         * po/Makefile.in.in: Updated.
6203         * po/Rules-quot: Updated.
6204         * po/boldquot.sed: Updated.
6205         * po/en@boldquot.header: Updated.
6206         * po/en@quot.header: Updated.
6207         * po/insert-header.sin: Updated.
6208         * po/quot.sed: Updated.
6209         * po/remove-potcdate.sin: Updated.
6210
6211 Tue Sep 17 23:46:01 2002  Arnold D. Robbins  <arnold@skeeve.com>
6212
6213         * configure.in: Moved override of INSTALL to just after
6214         AC_INIT so that it takes effect. Necessary for Autoconf 2.5x.
6215
6216 Mon Sep 16 16:40:57 2002  Stepan Kasal  <kasal@math.cas.cz>
6217
6218         * awkgram.y (want_assign): Removed.
6219         (SLASH_BEFORE_EQUAL, ASSIGN): New terminals; ``/='' is now
6220         formed from these two.
6221         (a_slash): New non-terminal, representing either '/' or
6222         SLASH_BEFORE_EQUAL.
6223         (assign_operator): New non-terminal, replaces ASSIGNOP.
6224         (REGEXP): yylex now eats the terminating '/' before
6225         returning REGEXP token.
6226         (exp): The check for C-like comments moved from here
6227         (regexp): ... to here.
6228         (common_exp): New non-terminal; contains common parts of exp
6229         and rexp.  (a_relop, relop_or_less): New non-terminals.
6230         (rexp): Some rules updated to be analogous to exp.
6231         (output_redir): Can contain only common_exp, not exp in general.
6232
6233 Mon Sep 16 22:51:51 2002  Arnold D. Robbins  <arnold@skeeve.com>
6234
6235         * io.c (two_way_open): Move label use_pipes outsidef of ifdef,
6236         just in case.
6237
6238 Thu Sep 12 15:11:28 2002  Arnold D. Robbins  <arnold@skeeve.com>
6239
6240         * awkgram.y (getfname): Return NULL if not found, remove
6241         fatal error.  Could be an extension function.
6242         (dump_funcs): Walk symbol table counting functions before
6243         mallocing table, since there could be extension functions,
6244         func_count could be too small.
6245         * profile.c (pp_builtin): Handle NULL return from getfname().
6246         Print it as "extension_function()" if so.
6247
6248 Tue Sep 10 17:33:48 2002  Arnold D. Robbins  <arnold@skeeve.com>
6249
6250         Minor code simplification.
6251
6252         * awk.h (in_array): Change return type to NODE*.
6253         (assoc_exists): Remove declaration.
6254         * array.c (in_array): Change return type to NODE *.
6255         Return value is pointer to element value or NULL.
6256         (assoc_exists): Removed function.
6257         * eval.c (r_tree_eval): Case Node_in_array, change value
6258         to test return of in_array() against NULL.
6259         * io.c (pty_vs_pipes): Change test to make a tmp_string()
6260         of the index and call in_array().  Add free_temp() of
6261         subscript and free() of full_index (oops).
6262
6263 2002-09-10  Isamu Hasegawa  <isamu@yamato.ibm.com>
6264
6265         * posix/regcomp.c: Wrap #include wchar.h and wctype.h in #if.
6266         (build_range_exp): Add castings to strlen invocations.
6267         (build_collating_symbol): Restore the type of characters from "char"
6268         to "unsigned char", and supplement castings.
6269         (build_collating_symbol): Likewise.
6270         (build_equiv_class): Likewise.
6271         (build_charclass): Likewise.
6272         (seek_collating_symbol_entry): Likewise.
6273         (parse_bracket_exp): Likewise.
6274         (build_word_op): Supplement a casting.
6275         * posix/regex_internal.c: Wrap #include wchar.h and wctype.h in #if.
6276         (re_string_allocate): Fix castings.
6277         (re_string_construct): Likewise.
6278         (re_string_construct_common): Likewise.
6279         (re_string_realloc_buffers): Likewise.
6280         (build_wcs_buffer): Likewise.
6281         (build_wcs_upper_buffer): Likewise.
6282         (re_string_skip_chars): Likewise.
6283         (re_string_reconstruct): Likewise.
6284         * posix/regex_internal.h: Restore the type of characters in
6285         re_string_t and bracket_elem_t from "char" to "unsigned char".
6286         (re_string_elem_size_at): Fix castings.
6287         * posix/regexec.c: Wrap #include wchar.h and wctype.h in #if.
6288         (transit_state_bkref_loop): Restore the type of characters from
6289         "char" to "unsigned char", and append a cast to "char*" pointer in
6290         array subscript.
6291         (check_node_accept_bytes): Likewise.
6292         (find_collation_sequence_value): Likewise.
6293
6294 Thu Sep  5 13:15:09 2002  Arnold D. Robbins  <arnold@skeeve.com>
6295
6296         * re.c (remaybelong): New routine.
6297         (reisstring): Simplified the code a bit.
6298         * awk.h (remaybelong): Declaration added.
6299         * io.c (get_a_record): Change fourth grungy special case to
6300         use remaybelong() instead of strchr() on last character.
6301
6302 Wed Sep  4 13:20:26 2002  Arnold D. Robbins  <arnold@skeeve.com>
6303
6304         * io.c (do_input): Recode guts of main loop to be easier
6305         to trace with a debugger.
6306         (get_a_record): Fourth grungy special case for RE-based
6307         record splitting added.  See explanatory comments there
6308         and test/rebuf.awk.
6309
6310 2002-09-03  Isamu Hasegawa  <isamu@yamato.ibm.com>
6311
6312         * posix/regcomp.c (regcomp): Append "__restrict" modifier to avoid
6313         warnings of some compilers.
6314         (build_collating_symbol): Change the type of characters from
6315         "unsigned char" to "char", and append a cast to "char*" pointer in
6316         array subscript.
6317         (build_collating_symbol): Likewise.
6318         (build_equiv_class): Likewise.
6319         (build_charclass): Likewise.
6320         (re_compile_pattern): Remove incorrect cast.
6321         (re_compile_fastmap_iter): Change the type of characters from
6322         "unsigned char" to "char", and append a cast to "char*" pointer
6323         in array subscript.
6324         (parse_bracket_exp): Likewise.
6325         * posix/regex_internal.c (re_string_construct_common): Likewise.
6326         (re_string_allocate): Likewise.
6327         (re_string_construct): Likewise.
6328         (re_string_realloc_buffers): Likewise.
6329         (build_wcs_buffer): Likewise.
6330         (re_string_reconstruct): Likewise.
6331         * posix/regex_internal.h: Change the type of characters in
6332         re_string_t and bracket_elem_t from "unsigned char" to "char".
6333         * posix/regexec.c (regexec): Append "__restrict" modifier to avoid
6334         warnings of some compilers.
6335         (transit_state_bkref_loop): Change the type of characters from
6336         "unsigned char" to "char", and append a cast to "char*" pointer in
6337         array subscript.
6338         (check_node_accept_bytes): Likewise.
6339         (find_collation_sequence_value): Likewise.
6340
6341 Wed Aug 21 15:40:36 2002  Corinna Vinschen  <vinschen@redhat.com>
6342
6343         * configure.in: Define --without-libintl-prefix and
6344         --without-libiconv-prefix for Cygwin by default.
6345         * Makefile.am: Call fixvers from $(srcdir).
6346         * awk.h: Don't define O_BINARY on Cygwin.
6347
6348 Wed Aug 21 15:31:57 2002  Andreas Buening  <andreas.buening@nexgo.de>
6349
6350         * configure.in (AC_OBJEXT, AC_EXEEXT): Added. Removed OS/2 goo.
6351         * Makefile.am (check-local): Add $(EXEEXT) suffixes, remove OS/2 goo.
6352         * regcomp.c, regex_internal.c, regexec.c: Conditionalize include of
6353         <wchar.h> and <wctype.h> on RE_ENABLE_I18N.
6354
6355 Wed Aug 21 14:43:57 2002  Arnold D. Robbins  <arnold@skeeve.com>
6356
6357         * gettext.h (ENABLE_NLS): Add include of locale.h so that things
6358         compile even without optimization. Sheesh.
6359         * io.c (two_way_open, pty_vs_pipes): Conditionalize pty code on
6360         HAVE_TERMIOS_H.
6361
6362 Thu Aug  8 22:16:10 2002  Arnold D. Robbins  <arnold@skeeve.com>
6363
6364         * main.c (main): Force LC_NUMERIC locale to "C", esp. for
6365         M$ systems. Ugh.
6366
6367 Wed Aug  7 13:42:01 2002  Arnold D. Robbins  <arnold@skeeve.com>
6368
6369         * io.c (get_a_record): Improve test for newlines at beginning of
6370         record but with nothing following it. See test/nulrsend.
6371
6372 Mon Aug  5 10:12:39 2002  Arnold D. Robbins  <arnold@skeeve.com>
6373
6374         Add option to use ptys instead of pipes for |&.
6375         Basic plumbing originally from Paolo Bonzini <bonzini@gnu.org>.
6376
6377         * awk.h (RED_PTY): New flag.
6378         (assoc_exists): Add declaration.
6379         * array.c (in_array): Use FALSE not zero for return value.
6380         (assoc_exists): New routine to find and return value for an index
6381         in an array.
6382         * configure.in: Test for termios.h and stropts.h, and grantpt function.
6383         * io.c: Include termios.h and stropts.h if available.
6384         (redflags2str): Add RED_PTY to table.
6385         (redirect): Add RED_PTY to flags turned off when searching.
6386         (close_redir): Close write channel for two-way pipes
6387         that use ptys by sending an EOF.
6388         (two_way_open): If pty_vs_pipe(), use pty's to open two-way pipes as
6389         they are line-buffered by default --> alleviates deadlock problems.
6390         If fails, fall back to using pipes.
6391         (pty_vs_pipe): New function.
6392         * main.c (arg_assign): Clean up English in some of the error messages.
6393
6394 Sun Aug  4 00:37:38 2002  Stepan Kasal  <kasal@math.cas.cz>
6395
6396         * re.c (make_regexp): Don't pass the error message returned by
6397         re_compile_pattern() to gettext(); it's already gettextized.
6398         (make_regexp): Minor reformat of code.
6399
6400 Wed Jul 31 23:50:31 2002  Arnold D. Robbins  <arnold@skeeve.com>
6401
6402         Removed dfa code from gawk since not really needed with new regex.
6403
6404         * Makefile.am: Removed dfa.h and dfa.c.
6405         * awk.h (struct Regexp): Removed `dfareg' and `dfa' members.
6406         (make_regexp): Last parameter in function went away, changed decl.
6407         (avoid_dfa): Removed declaration.
6408         * awkgram.y: Fixed call to make_regexp().
6409         * eval.c (match_op): Simplified: removed call to avoid_dfa() and
6410         `kludge_need_start' variable. Instead, pass FALSE as last parameter
6411         of research().
6412         * field.c (set_FS): Fixed call to make_regexp().
6413         * io.c (get_a_record, set_RS): Fixed calls to make_regexp().
6414         * re.c (make_regexp): Removed last paramter (`dfa') from function.
6415         Simplified the code.
6416         (research): Simplified the code, removed calls to dfa stuff.
6417         (dfaerror): Removed function.
6418         (re_update): Fixed call to make_regexp().
6419         (avoid_dfa): Removed function.
6420
6421 Thu Jul 25 21:55:45 2002  Arnold D. Robbins  <arnold@skeeve.com>
6422
6423         * regcomp.c, regex_internal.c, regex_internal.h, regexec.c: Bug
6424         fixes from Isamu Hasegawa  <isamu@yamato.ibm.com> and Stepan Kasal
6425         <kasal@math.cas.cz> applied.
6426
6427 Sat Jul  6 23:28:37 2002  Arnold D. Robbins  <arnold@skeeve.com>
6428
6429         * awkgram.y (yyerror): Change text of unexpected newline message to
6430         include end of string.
6431
6432 Mon Jun 17 17:58:55 2002  Arnold D. Robbins  <arnold@skeeve.com>
6433
6434         * field.c (do_split): Per Michal Jaegermann, move free_temp(fs)
6435         above label `out'.
6436
6437 Tue Jun 11 23:26:09 2002  Paul Eggert  <eggert@twinsun.com>
6438
6439         Update to autoconf 2.53 and automake 1.6.1.
6440
6441         * acconfig.h: Removed.
6442         * m4/isc-posix.m4: Removed.
6443         * m4/jm-mktime.m4: Removed.
6444         * m4/largefile.m4: Removed.
6445         * m4/ssize_t.m4: Removed.
6446         * ansi2knr.c: Updated.
6447         * depcomp: Updated.
6448         * install-sh: Updated.
6449         * missing: Updated.
6450         * mkinstalldirs: Updated.
6451         * ylwrap: Updated.
6452
6453         * configure.in: Improved quoting.
6454         * acinclude.m4: Use `m4_sinclude', not antiquated `sinclude'.
6455
6456 Tue Jun 11 23:08:40 2002  Arnold D. Robbins  <arnold@skeeve.com>
6457
6458         * configure.in: Add `getgrent' to list of functions checked
6459         so that awklib/grcat is compiled correctly.
6460
6461 Tue Jun 11 22:18:42 2002  Stepan Kasal  <kasal@math.cas.cz>
6462
6463         Improve argument parsing and -v assignment.
6464
6465         * awk.h (struct src): Add additional enum values.
6466         (arg_assign): Return type and arg list changes.
6467         * io.c (nextfile): Add extra arg in call to `arg_assign'.
6468         * main.c (pre_assign): Nuked.
6469         (allocfiles): New variable.
6470         (srcfiles_add, preassigns_add): New macros.
6471         (main): Logic cleaned up.
6472         (add_src): New function.
6473
6474         Use `size_t' for optimal_bufsize function.
6475
6476         * awkgram.y (yylex): `len' is now size_t.
6477         * pc/gawkmisc.pc (optimal_bufsize): Change return type to size_t.
6478         * posix/gawkmisc.c (optimal_bufsize): Change return type to size_t.
6479         * unsupported/atari/gawkmisc.atr (optimal_bufsize): Change return type
6480         to size_t.
6481         * unsupported/tandem/tmisc.c (optimal_bufsize): Change return type to size_t.
6482         * vms/gawkmisc.vms (optimal_bufsize): Change return type to size_t.
6483         * README_d/README.hpux: New file.
6484
6485 Fri May 24 12:23:01 2002  Arnold D. Robbins  <arnold@skeeve.com>
6486
6487         * profile.c (init_profiling): Remove default initialization
6488         of `prof_fp' to stderr. Per Stepan Kasal <kasal@math.cas.cz>.
6489
6490 Wed May 15 15:39:17 2002  Arnold D. Robbins  <arnold@skeeve.com>
6491
6492         Work through builtin operations to make sure that
6493         anything that might have side effects gets dealt with.
6494
6495         * array.c (do_delete): Evaluate subscript first before
6496         checking if something is or isn't an array.
6497         * builtin.c (sub_common): Evaluate replacement text, and
6498         free it if no match of regex in source text.
6499
6500 Wed May 15 15:30:34 2002  Arnold D. Robbins  <arnold@skeeve.com>
6501
6502         Switch to new version of regex from IBM Japan.
6503
6504         * regcomp.c: New file.
6505         * regex.c: Replaced with new version.
6506         * regex.h: Replaced with new version.
6507         * regex_internal.c: New file.
6508         * regex_internal.h: New file.
6509         * regexec.c: New file.
6510         * Makefile.am (EXTRA_SOURCES): New files added.
6511
6512 Tue May 14 17:04:05 2002  Arnold D. Robbins  <arnold@skeeve.com>
6513
6514         * awk.h (<locale.h>): Move check and include into gettext.h.
6515         * gettext.h (<locale.h>): Add check and include per patch from
6516         Bruno Haible.
6517
6518         * field.c (do_split):  When checking for split of null string,
6519         evaluate seperator if it's not FS, since could have side effects.
6520         At end, free_temp(fs), not free_temp(sep).
6521         Both of these thanks to Stepan Kasal <kasal@math.cas.cz>.
6522
6523 Mon May 13 00:41:31 2002  Arnold D. Robbins  <arnold@skeeve.com>
6524
6525         * custom.h (ultrix): Add define GETGROUPS_NOT_STANDARD.
6526         * main.c (init_groupset): For GETGROUPS_NOT_STANDARD, use old way
6527         to set `ngroups'.
6528
6529 2002-05-10  Andreas Schwab  <schwab@suse.de>
6530
6531         * dfa.c (parse_bracket_exp_mb): Fix warning.
6532
6533 Thu May  9 22:28:32 2002  Arnold D. Robbins  <arnold@skeeve.com>
6534
6535         * builtin.c (sub_common): Fix logic for match of null strings to
6536         get correct semantics.  See test/gsubtst2.*.
6537         * field.c (do_split): Minor code cleanup; the third arg to split()
6538         is set to be FS by the grammar, so don't need to check it for NULL.
6539         Thanks to Stepan Kasal <kasal@math.cas.cz>.
6540         * awk.h (locale.h): Move include before that of "gettext.h" for systems
6541         that define functions that gettext.h would use when NLS is disabled.
6542         Per bug report from Ayamura Kikuchi <ayamura@ayamura.org>.
6543
6544 Tue May  7 17:31:01 2002  Arnold D. Robbins  <arnold@skeeve.com>
6545
6546         Miscellanious patches courtesy of Stepan Kasal <kasal@math.cas.cz>.
6547
6548         * field.c, main.c: Tidy up some comments.
6549         * field.c (set_FIELDWIDTHS): Init fw_alloc to 4 so it isn't
6550         immediately realloced.
6551         * main.c (load_procinfo): Check value of FS/FIELDWIDTHS for
6552         value of PROCINFO["FS"].
6553         * awk.h (set_FS_if_not_FIELDWIDTHS): Removed decl.
6554         * field.c (set_FS_if_not_FIELDWIDTHS): Removed function.
6555         * eval.c (set_IGNORECASE): Use inline code checking `using_fieldwidths()'.
6556         * io.c (set_IGNORECASE): Ditto.
6557
6558 Sun May  5 14:28:34 2002  Arnold D. Robbins  <arnold@skeeve.com>
6559
6560         Fix a memory leak in array for loops if the body contains a
6561         `next' or `nextfile' statement.  The changes maintain a stack
6562         of active for loops that is pushed and popped for each loop,
6563         and popped entirely for `next', `nextfile', etc.
6564
6565         * eval.c (forloops_active, pop_forloop, pop_all_forloops, push_forloop):
6566         new functions.
6567         (interpret): Case Node_K_arrayfor, call push and pop functions.
6568         Case Node_rule_list: Pop loops and pop fcalls after longjmp.
6569         Cases Node_K_next, Node_K_nextfile, Node_K_break and
6570         Node_K_continue, removed check before longjmp.
6571         Case Node_K_exit: Add loop check.
6572         (loop_stack, nloops, nloops_active): New variables that implement
6573         the stack.
6574
6575 Wed May  1 16:41:32 2002  Arnold D. Robbins  <arnold@skeeve.com>
6576
6577         * Release 3.1.1: Release tar file made.
6578
6579 Wed May  1 16:07:49 2002  Arnold D. Robbins  <arnold@skeeve.com>
6580
6581         * getopt.c: Installed latest version from glibc.
6582
6583 Sun Apr 28 17:19:07 2002  Arnold D. Robbins  <arnold@skeeve.com>
6584
6585         * fixvers: Changed patterns to allow test versions of the
6586           form `gawk-3.1.1a'.
6587         * patchlev.h: Patchlevel is now a string constant.
6588         * main.c (version): Print patchlevel using %s, not %d.
6589         * Makefile.am: Rework DEFPATH stuff and datadir stuff yet again.
6590
6591         * config.sub: Updated with current version from ftp.gnu.org.
6592         * config.guess: Ditto.
6593
6594         Upgrade to gettext-0.11.2:
6595
6596         * ABOUT-NLS: Replaced with version from gettext 0.11.2.
6597         * config.rpath: Replaced with version from gettext 0.11.2.
6598         * intl/*: Replaced with version from gettext 0.11.2.
6599         * po/Makefile.in.in: Replaced with version from gettext 0.11.2.
6600         * po/Makevars.template: Replaced with version from gettext 0.11.2.
6601         * po/Rules-quot: Replaced with version from gettext 0.11.2.
6602         * po/boldquot.sed: Replaced with version from gettext 0.11.2.
6603         * po/en@boldquot.header: Replaced with version from gettext 0.11.2.
6604         * po/en@quot.header: Replaced with version from gettext 0.11.2.
6605         * po/insert-header.sin: Replaced with version from gettext 0.11.2.
6606         * po/quot.sed: Replaced with version from gettext 0.11.2.
6607         * po/remove-potcdate.sin: Replaced with version from gettext 0.11.2.
6608         * m4/codeset.m4: Replaced with version from gettext 0.11.2.
6609         * m4/gettext.m4: Replaced with version from gettext 0.11.2.
6610         * m4/glibc21.m4: Replaced with version from gettext 0.11.2.
6611         * m4/iconv.m4: Replaced with version from gettext 0.11.2.
6612         * m4/isc-posix.m4: Replaced with version from gettext 0.11.2.
6613         * m4/lcmessage.m4: Replaced with version from gettext 0.11.2.
6614         * m4/lib-ld.m4: Replaced with version from gettext 0.11.2.
6615         * m4/lib-link.m4: Replaced with version from gettext 0.11.2.
6616         * m4/lib-prefix.m4: Replaced with version from gettext 0.11.2.
6617         * m4/progtest.m4: Replaced with version from gettext 0.11.2.
6618
6619 Wed Apr 17 15:09:45 2002  Arnold D. Robbins  <arnold@skeeve.com>
6620
6621         * regex.c (PREFIX): Change test for token concatenation ability
6622         to `#ifdef HAVE_STRINGIZE'. If a cpp has one, it ought to have
6623         the other.
6624
6625 Tue Apr 16 12:26:06 2002  Arnold D. Robbins  <arnold@skeeve.com>
6626
6627         * profile.c (tree_eval): Make unary minus case smarter,
6628         use is_scalar test and if false parenthesize expression.
6629         Add Node_TEXTDOMAIN case.
6630         (pp_lhs, is_scalar, prec_level): Add Node_TEXTDOMAIN cases.
6631
6632 Thu Apr 11 21:28:33 2002  Arnold D. Robbins  <arnold@skeeve.com>
6633
6634         * array.c (do_adump): Spelling fix in output message.
6635         * builtin.c: Ditto, in multiple routines.
6636         (do_toupper, do_tolower): Add cast to size_t in assigment to mbclen
6637         for some compilers.
6638         * re.c (research): Fix way returning is done to silence some
6639         compiler diagnostics.
6640
6641 Wed Apr 10 19:30:51 2002  Arnold D. Robbins  <arnold@skeeve.com>
6642
6643         * Makefile.am (datadir): Set directly to have `/awk'.
6644         (DEFPATH): Go back to using $(datadir) for path.
6645
6646 Tue Apr  9 17:34:09 2002  Arnold D. Robbins  <arnold@skeeve.com>
6647
6648         Upgraded to gettext 0.11.1.
6649
6650         * Makefile.am (LDADD): Use @LIBINTL@ instead of @INTLLIBS@.
6651         * ABOUT-NLS: Version from 0.11.1.
6652         * config.rpath: Version from 0.11.1.
6653         * aclocal.m4: Regenerated based on new files.
6654         * intl/*: Replaced with version from 0.11.1.
6655         * m4/ChangeLog: New file.
6656         * m4/codeset.m4: New file.
6657         * m4/gettext.m4: Version from 0.11.1.
6658         * po/ChangeLog: New file.
6659         * po/Makefile.in.in: Version from 0.11.1.
6660         * po/remove-potcdate.sin: New file.
6661
6662 Mon Apr  8 22:22:58 2002  Arnold D. Robbins  <arnold@skeeve.com>
6663
6664         * Makefile.am (libexecdir): Set directly to have `/awk'.
6665         (DEFPATH): Use $(pkgdatadir) for path.
6666         (install-exec-hook): Add version link for pgawk.
6667         (uninstall-links): Remove pgawk version link.
6668
6669 Wed Mar 20 13:44:21 2002  Isamu Hasegawa  <isamu@yamato.ibm.com>
6670
6671         * regex.c (__alignof__): Definition for non-GCC compilers.
6672
6673 Sun Mar 17 17:41:55 2002  Arnold D. Robbins  <arnold@skeeve.com>
6674
6675         * io.c (do_pathopen): Malloc buffers to hold constructed
6676           filenames: No Arbitrary Limits!  Thanks to keoki@techie.com
6677           for the bug report.
6678
6679 Sun Mar 10 16:59:06 2002  Scott Deifik       <scottd@amgen.com>
6680
6681         * awk.h (LOCALEDIR): Provide a definition in case not using
6682           i18n stuff.
6683
6684 Wed Mar  6 18:14:44 2002  Arnold D. Robbins  <arnold@skeeve.com>
6685
6686         * main.c (usage): Add some explanatory text and examples at end.
6687
6688 Sun Mar  3 16:42:50 2002  Arnold D. Robbins  <arnold@skeeve.com>
6689
6690         * getopt.h, getopt.c, getopt1.c: Update to current version
6691           from glibc CVS.
6692
6693 Fri Feb 22 15:53:38 2002  Isamu Hasegawa  <isamu@yamato.ibm.com>
6694
6695         * dfa.c (fetch_wc): Fix type from wchar_t to wint_t.
6696         (parse_bracket_exp_mb): Likewise.
6697         * regex.c (extract_number): Retrieve the sign information from
6698         byte-code in case of AIX.
6699
6700 Thu Feb 21 16:44:24 2002  Arnold D. Robbins  <arnold@skeeve.com>
6701
6702         * re.c (resetup): Moved setting re_max_failures into regex.c.
6703         * regex.c (re_max_failures): Set to really big if REGEX_MALLOC
6704         defined.  Do this in both places that define re_max_failures.
6705
6706 Thu Feb 21 19:02:22 2002  Isamu Hasegawa  <isamu@yamato.ibm.com>
6707
6708         * builtin.c (sub_common): Avoid index_multibyte_buffer invocation
6709           in single byte character environments.
6710
6711 Thu Feb 21 10:08:56 2002  Isamu Hasegawa  <isamu@yamato.ibm.com>
6712
6713         * dfa.c (parse_bracket_exp_mb): For ':', use wctype_t in MALLOC,
6714           not wchar_t.
6715
6716 Thu Feb 21 09:52:16 2002  Arnold D. Robbins  <arnold@skeeve.com>
6717
6718         Upgraded to automake 1.5 and gettext-0.11.
6719         Also bug fix to multibyte code.
6720
6721         * ABOUT-NLS: Upgraded.
6722         * config.guess, config.sub, config.rpath, gettext.h, ylwrap: New files.
6723         * Makefile.am: Added above to appropriate places.
6724         * awk.h: Replace libintl.h and macros with include of gettext.h.
6725           (emalloc, erealloc): Add num bytes to error message, put string inside _().
6726           (index_multibyte_buffer): Removed decl.
6727         * awklib/Makefile.am: Use $(EXEEXT) for grcat and pwcat targets.
6728         * builtin.c (index_multibyte_buffer): Made static to this file.
6729           (sub_common): Add checks that replacement string is length > 0 so
6730           that we don't try to malloc(0): this fails on some systems.
6731         * configure.in (AM_GNU_GETTEXT): Update macro for gettext 0.11.
6732           (ALL_LINGUAS): Removed.
6733         * m4/codeset.m4: New file.
6734         * m4/gettext.m4: Updated.
6735         * m4/glibc21.m4: New file.
6736         * m4/iconv.m4: New file.
6737         * m4/isc-posix.m4: New file.
6738         * m4/lcmessage.m4: Updated.
6739         * m4/lib-ld.m4: New file.
6740         * m4/lib-link.m4: New file.
6741         * m4/lib-prefix.m4: New file.
6742         * m4/progtest.m4: Updated.
6743         * intl/*: Replaced with version from gettext 0.11.
6744         * po/*: Revised for gettext 0.11.
6745
6746 Mon Feb 18 14:42:39 2002  Arnold D. Robbins  <arnold@skeeve.com>
6747
6748         * builtin.c (nondec2awknum): Change assert to runtime check
6749           in case user passed in bad data.
6750
6751 2002-02-17  Paul Eggert  <eggert@twinsun.com>
6752
6753         * re.c (resetup): Try to avoid silly limitation of regex.c by
6754         setting re_max_failures to the largest reasonable value.
6755
6756 Sun Feb 17 14:57:43 2002  Arnold D. Robbins  <arnold@skeeve.com>
6757
6758         * builtin.c (research): If re_search() returns -2, the
6759           match failed since regex couldn't allocate enough memory
6760           for what it needed.  Fail with a fatal message instead.
6761           This is a workaround, not a fix, but I don't mess with
6762           regex.[ch].
6763
6764 Fri Feb  8 16:01:11 2002  Arnold D. Robbins  <arnold@skeeve.com>
6765
6766         * awkgram.y (LEX_FOR): Fix case of array loop with body of single
6767           delete statement to actually check the right things to make the
6768           optimization.
6769         * profile.c (tree_eval): Add case for Node_K_delete_loop.
6770           (prec_level): Ditto.
6771
6772 Mon Feb  4 10:38:00 2002  Bruno Haible  <bruno@clisp.org>
6773
6774         * awk.h (dcngettext): New macro.
6775         (do_dcngettext): New declaration.
6776         * awkgram.y (tokentab): Add dcngettext.
6777         (snode): Add a warning for incorrect use of dcngettext.
6778         (dumpintlstr): fflush at the end, not in the middle.
6779         (dumpintlstr2): New function.
6780         * builtin.c (localecategory_from_argument): New function, extracted
6781         from do_dcgettext.
6782         (do_dcgettext): Call it.
6783         (do_dcngettext): New function.
6784
6785 Sun Feb  3 17:56:20 2002  Bruno Haible  <bruno@clisp.org>
6786
6787         * builtin.c (do_bindtextdomain): Don't free the same variable twice.
6788         * main.c (main): Call setlocale for LC_MESSAGE, to make dcgettext
6789         function work on glibc systems.
6790
6791 Wed Jan 23 15:03:36 2002  Andreas Buening    <andreas.buening@nexgo.de>
6792
6793         * configure.in (PATH_SEPARATOR): Code added for OS/2.
6794         Makefile.am (PATH_SEPARATOR): Added.
6795         (DEFPATH): Make use of PATH_SEPARATOR.
6796
6797 Wed Jan 23 14:46:04 2002  Arnold D. Robbins  <arnold@skeeve.com>
6798
6799         * awkgram.y (yylex): Add test for lasttok != '$' when looking
6800           at _"...".  See comments in code.
6801
6802 Wed Aug 15 07:43:10 2001  Isamu Hasegawa  <isamu@yamato.ibm.com>
6803
6804         * regex.c : Implements the codes for exactn_bin to work correctly
6805           in multibyte environments, in case of invalid multibyte sequence.
6806
6807 Wed Aug 15 07:36:56 2001  Isamu Hasegawa  <isamu@yamato.ibm.com>
6808
6809         * regex.c : Implements the codes for charset/charset_not to
6810           work in multibyte environments.
6811
6812 Wed Aug 15 05:04:34 2001  Isamu Hasegawa  <isamu@yamato.ibm.com>
6813
6814         * regex.c : Add some comments.
6815
6816 Wed Aug 15 05:04:15 2001  Isamu Hasegawa  <isamu@yamato.ibm.com>
6817
6818         * regex.c (count_mbs_length): New function, check the mutibyte
6819           strings and count how many wchar_t the substring occupy.
6820           (CHAR_T): New macro, character type depending on
6821           environments(singlebyte/multibyte).
6822           (UCHAR_T): New macro, unsigned character type.
6823           (COMPILED_BUFFER_VAR): New macro, the buffer containing
6824           the compiled buffer.
6825           Adapt singlebyte/multibyte environments with CHAR_T, UCHAR_T,
6826           and COMPILED_BUFFER_VAR.
6827
6828 Mon Jun 25 09:00:41 2001  Isamu Hasegawa  <isamu@yamato.ibm.com>
6829
6830         * regex.c : Reorganize code to build code twice.  byte_* are
6831           for single byte, wcs_* are for multibyte character sets.
6832           Chose functions according to current locale dynamically.
6833         * regex.c (convert_mbs_to_wcs): New function, convert multibyte
6834           strings to wide character strings for multibyte environments.
6835
6836 Fri Jun 22 05:43:50 2001  Isamu Hasegawa  <isamu@yamato.ibm.com>
6837
6838         * regex.c (MBS_SUPPORT): New macro, defined if the environment
6839           can handle multibyte characters.
6840           (OFFSET_ADDRESS_SIZE): Offset address size in the
6841           compiled buffer.
6842           Rewrite offset addresses with OFFSET_ADDRESS_SIZE.
6843
6844 Thu Apr 26 08:03:17 2001  Isamu Hasegawa  <isamu@yamato.ibm.com>
6845
6846         * builtin.c (index_multibyte_buffer): Inspect the buffer and write
6847         the index.
6848         (sub_common): In multibyte environment, skip multibyte characters
6849         when we check special characters.
6850         * awk.h (index_multibyte_buffer): Add prototype.
6851         * eval.c (cmp_nodes): In multibyte environment, compare per character.
6852         * field.c (re_parse_field): In multibyte environment, avoid to
6853         call research() on invalid boundary.
6854         (sc_parse_field): In multibyte environment, avoid to compare on
6855         invalid boundary.
6856         (null_parse_field): In multibyte environment, split per
6857         character, not per byte.
6858         * io.c (get_a_record): In multibyte environment, avoid to compare
6859         on invalid boundary.
6860
6861 Wed Apr 25 08:29:47 2001  Isamu Hasegawa  <isamu@yamato.ibm.com>
6862
6863         * awk.h (strncasecmpmbs): Add prototype.
6864         * builtin.c (strncasecmpmbs): New function like strncasecmp but for
6865         multibyte strings.
6866         (do_index): In multibyte environment, compare per character.
6867         * builtin.c (do_tolower): In multibyte environment, user towlower
6868         instead of TOLOWER.
6869         (do_toupper): In multibyte environment, user towupper instead
6870         of TOUPPER.
6871
6872 Tue Apr 24 10:38:06 2001  Isamu Hasegawa  <isamu@yamato.ibm.com>
6873
6874         In multibyte environments, handle multibyte characters as single
6875         characters in bracket expressions.
6876
6877         * dfa.h (mb_char_classes): New structure.
6878         (mbcsets): New variable.
6879         (nmbcsets): New variable.
6880         (mbcsets_alloc): New variable.
6881         * dfa.c (prtok): Handle MBCSET.
6882         (fetch_wc): New function to fetch a wide character.
6883         (parse_bracket_exp_mb): New function to handle multibyte character
6884         in lex().
6885         (lex): Invoke parse_bracket_exp_mb() for multibyte bracket expression.
6886         (atom): Handle MBCSET.
6887         (epsclosure): Likewise.
6888         (dfaanalyze): Likewise.
6889         (dfastate): Likewise.
6890         (match_mb_charset): New function to judge whether a bracket match
6891         with a multibyte character.
6892         (check_matching_with_multibyte_ops): Handle MBCSET.
6893         (dfainit): Initialize new variables.
6894         (dfafree): Free new variables.
6895
6896 Mon Apr 23 01:40:09 2001  Isamu Hasegawa  <isamu@yamato.ibm.com>
6897
6898         Implement the mechanism to match with multibyte characters,
6899         and use it for `period' in multibyte environments.
6900
6901         * dfa.h (mbps): New variable.
6902         * dfa.c (prtok): Handle ANYCHAR.
6903         (lex): Use ANYCHAR for `period' in multibyte environments.
6904         (atom): Handle ANYCHAR.
6905         (state_index): Initialize mbps in multibyte environments.
6906         (epsclosure): Handle ANYCHAR.
6907         (dfaanalyze): Handle ANYCHAR.
6908         (dfastate): Handle ANYCHAR.
6909         (realloc_trans_if_necessary): New function.
6910         (transit_state_singlebyte): New function.
6911         (match_anychar): New function.
6912         (check_matching_with_multibyte_ops): New function.
6913         (transit_state_consume_1char): New function.
6914         (transit_state): New function.
6915         (dfaexec): Invoke transit_state if expression can match with
6916         a multibyte character in multibyte environments.
6917         (dfamust): Handle ANYCHAR.
6918
6919 Fri Apr 20 11:31:24 2001  Isamu Hasegawa  <isamu@yamato.ibm.com>
6920
6921         Avoid incorrect state transition in multibyte environments.
6922
6923         * dfa.h (nmultibyte_prop): New variable.
6924         (multibyte_prop): New variable.
6925         * dfa.c (addtok): Set inputwcs.
6926         (dfastate): Avoid incorrect state transition in multibyte
6927         environments.
6928         (dfaexec): Likewise.
6929         (dfainit): Init multibyte_prop.
6930         (dfafree): Free multibyte_prop.
6931         (inputwcs): New variable.
6932         (mblen_buf): New variable contains the amount of remain byte
6933         of corresponding multibyte character in the input string.
6934
6935 Fri Apr 20 06:28:59 2001  Isamu Hasegawa  <isamu@yamato.ibm.com>
6936
6937         Handle a multibyte character followed by '*', '+', and '{n,m}'
6938         correctly.
6939
6940         * dfa.c (update_mb_len_index): New function.
6941         Support for multibyte string.
6942         (FETCH): Call update_mb_len_index.
6943         (lex): Check cur_mb_index not to misunderstand multibyte characters.
6944         (atom): Make a tree from a multibyte character.
6945         (dfaparse): Initialize new variables.
6946         (mbs): New variable.
6947         (cur_mb_len): New variable.
6948         (cur_mb_index): New variable.
6949
6950 Thu Apr 19 09:32:47 2001  Isamu Hasegawa  <isamu@yamato.ibm.com>
6951
6952         * awkgram.y (cur_mbstate): New varialble containing means current
6953         shift state.
6954         (cur_char_ring): New varialbe reffering the buffer which contains
6955         last some character from the buffer.
6956         (cur_ring_idx): New variable containing the current index on
6957         cur_char_ring.
6958         (nextc_is_1stbyte): New macro, means that last nextc() return a
6959         singlebyte character or 1st byte of a multibyte character.
6960         (nextc): Check the buffer and update cur_ring_char in multibyte
6961         environments.
6962         (pushback): Adjust cur_ring_idx in multibyte environments.
6963         (yylex): Add check whether nextc() returned 1st-byte in multibyte
6964         environments.
6965         * re.c (make_regexp): In multibyte environment, skip multibyte
6966         characters when we check special characters.
6967
6968 Wed Apr 18 07:58:20 2001  Isamu Hasegawa  <isamu@yamato.ibm.com>
6969
6970         * awk.h (MBS_SUPPORT): New flag, means supporting multibyte strings.
6971         * configure.in : Add check for wchar.h, wctype.h, mbrtowc, and mbrlen.
6972
6973 Wed Jan 16 16:32:40 2002  Arnold D. Robbins  <arnold@skeeve.com>
6974
6975         * builtin.c (do_strtonum): Simplified.  Check first if the
6976           value matches a non-decimal number, and if so convert it.
6977           Otherwise do a regular force_number.
6978
6979 Mon Jan  7 22:12:15 2002  Arnold D. Robbins  <arnold@skeeve.com>
6980
6981         * awkgram.y (statement): Moved delete, print, and expressions into
6982           new non-terminal `simple_stmt'.  Allow opt_simple_stmt in the
6983           first and third part of a for loop, per latest POSIX, which documents
6984           an otherwise undocumented historical oddity in Unix awk.  This has
6985           the pleasant side effect of making line numbers more accurate for
6986           messages involving delete statements.
6987           (opt_simple_stmt, simple_stmt): New non-terminals.
6988
6989           Based on bug report from drj@pobox.com.
6990
6991 Mon Dec 24 14:04:02 2001  Arnold D. Robbins  <arnold@skeeve.com>
6992
6993         * configure.in: Changes for VMS with new strftime:
6994         (AC_HEADER_TIME): Added.
6995         (AC_CHECK_HEADERS): Check for sys/time.h.
6996         (TIME_T_IN_SYS_TYPES_H): Add header check.
6997         * acconfig.h (TIME_T_IN_SYS_TYPES_H): Added.
6998
6999 Wed Dec 19 16:01:58 2001  Peter J. Farley III  <pjfarley@dorsai.org>
7000
7001         * configure.in: Add MS-DOS to getpgrp special case.
7002         * dfa.c, getopt.c, regex.c: Fix code to work with --disable-nls.
7003
7004 Wed Dec 19 15:59:25 2001  Eli Zaretskii  <eliz@is.elta.co.il>
7005
7006         * profile.c (init_profiling_signals) [__DJGPP__]: Use SIGINT
7007         instead of SIGHUP and SIGQUIT instead of SIGUSR1.
7008
7009 Tue Dec 18 20:56:07 2001  Andreas Buening    <andreas.buening@nexgo.de>
7010
7011         More OS/2 stuff.
7012
7013         * awk.h (O_BINARY): Don't redefine for EMX.
7014         * io.c (gawk_popen): Add __EMX__ in case compiling DOS executable.
7015         * configure.in: Add OS/2 to case for manual GETPGRP_VOID.
7016
7017 Tue Dec  4 17:54:30 2001  Arnold D. Robbins  <arnold@skeeve.com>
7018
7019         New configure time option, --with-whiny-user-strftime.
7020
7021         * configure.in (AC_ARG_WITH): Add appropriate code for autoconf.
7022         * accondig.h (USE_INCLUDED_STRFTIME): Add #undef for it.
7023         * custom.h (USE_INCLUDED_STRFTIME): Set things up write.
7024
7025 Tue Dec  4 16:44:07 2001  Andreas Buening    <andreas.buening@nexgo.de>
7026
7027         Mongo patch for updated OS/2 support.
7028
7029         * awk.h (TOUPPER, TOLOWER): Define only if not already defined.
7030         * awkgram.y (extproc feature): Add ifdef for __EMX__.
7031         * gawkmisc.c (__EMX__): Include pc/gawkmisc.c directly.
7032         * io.c (__EMX__): Added for a number of places in addition to OS2 def.
7033           (two_way_open): Added OS/2 specific code added that uses spawn.
7034           (gawk_popen): Ditto.
7035
7036 Mon Dec  3 14:07:56 2001  Arnold D. Robbins  <arnold@skeeve.com>
7037
7038         Fix use of getgroups to use dynamic memory, solves
7039         problem of systems where NGROUPS_MAX lies.
7040
7041         * awk.h (groupset, ngroups): New extern variables.
7042         * configure.in (AC_CHECK_FUNCS): Add getgroups to list.
7043         * io.c (user_open): Use global ngroups and groupset variables,
7044           don't call getgroups here.
7045         * main.c (init_groupset): New function to init global
7046           vars using malloc.  Declare it at top.
7047           (main): Call init_groupset().
7048           (load_procinfo): Use global ngroups and groupset variables.
7049
7050 Sun Nov 18 11:56:01 2001  Arnold D. Robbins  <arnold@skeeve.com>
7051
7052         * random.c (srandomdev): ifdef-out.  Lots of compile time
7053           problems on multiple platforms, and gawk doesn't even
7054           use the routine.  The heck with fine-grained solutions.
7055
7056 Wed Nov 14 16:12:40 2001  Pat Rankin  <rankin@eql.caltech.edu>
7057
7058         * builtin.c (bchunk_one): Use `ofre < 1' instead of `ofre <= 0'
7059           to avoid compiler complaint about suspicious comparison for
7060           unsigned variable.  (`ofre == 0' ought to suffice...)
7061
7062 Tue Nov 13 17:27:52 2001  Arnold D. Robbins  <arnold@skeeve.com>
7063
7064         * awkgram.y (yyerror): Fix the code to behave like it
7065           used to.  Keep "no arbitrary limits" by mallocing the
7066           buffer and freeing it.
7067
7068 Wed Nov  7 16:46:20 2001  Arnold D. Robbins  <arnold@skeeve.com>
7069
7070         * awkgram.y (yyerror): Remove dependency upon buf[] to
7071           hold prepended space and `^' pointer.  Avoids core dumps
7072           for long source lines.
7073
7074 Sat Nov  3 22:27:21 2001  Arnold D. Robbins  <arnold@skeeve.com>
7075
7076         * m4/strtod.m4: Add missing `#endif'. Oops.
7077
7078 Mon Oct 29 14:53:57 2001  Arnold D. Robbins  <arnold@skeeve.com>
7079
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.
7083
7084 Sun Oct 28 16:53:18 2001  Arnold D. Robbins  <arnold@skeeve.com>
7085
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.
7089
7090 Wed Oct 10 11:01:47 2001  Arnold D. Robbins  <arnold@skeeve.com>
7091
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).
7095
7096 Thu Oct  4 18:20:36 2001  Arnold D. Robbins  <arnold@skeeve.com>
7097
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().
7101
7102 Tue Sep 25 15:19:53 2001  Arnold D. Robbins  <arnold@skeeve.com>
7103
7104         * io.c (iop_open): Only call os_close_on_exec() for
7105           fd > fileno(stderr).
7106
7107 2001-09-07  Paul Eggert  <eggert@twinsun.com>
7108
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".
7112
7113 Thu Aug 30 15:17:12 2001  Arnold D. Robbins  <arnold@skeeve.com>
7114
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.
7118
7119 Thu Aug 23 14:01:14 2001  Arnold D. Robbins  <arnold@skeeve.com>
7120
7121         * awkgram.y (unary minus production): Add check that value
7122           isn't a string. Based on bug report from drj@pobox.com.
7123         * profile.c (tree_eval): For node_val, only test NUMBER
7124           to see if value is numeric, not NUM|NUMBER.
7125
7126 Thu Aug 16 12:21:28 2001  Arnold D. Robbins  <arnold@skeeve.com>
7127
7128         * configure.in (ALL_LINGUAS): Added `fr' and `tr'.
7129         * po/fr.po, po/tr.fo: New files.
7130
7131 2001-08-13  Paul Eggert  <eggert@twinsun.com>
7132
7133         This patch fixes a bug that causes gawk to rewind standard
7134         input incorrectly.  It also removes all instances of fseek,
7135         from the gawk source proper, which should make gawk a bit
7136         more portable.
7137
7138         (The original patch removed off_t & lseek too, but I need
7139         that for something else. ADR.)
7140
7141         * posix/gawkmisc.c (optimal_bufsize):
7142         Don't use lseek on the input, because that might change
7143         its state.  Instead, just check whether it is a regular file.
7144         This obviates the need to invoke isatty.
7145         (Also, fix a spelling error in the first line of the source.)
7146         * pc/gawkmisc.pc, unsupported/atari/gawkmisc.atr: Likewise.
7147
7148         * awk.h (S_ISREG): Move this macro here ...
7149         * io.c (S_ISREG): from here.
7150
7151         * protos.h (fseek): Remove prototype; no longer used.
7152
7153 Fri Aug  3 13:38:54 2001  Arnold D. Robbins  <arnold@skeeve.com>
7154
7155         * array.c (assoc_lookup): Change assert test on type to real test
7156           to protect against FS[1] = "x" kinds of things.  It'd be better
7157           to do this in the grammar, but this is easier and just as
7158           effective.
7159
7160         Undid BECAMEARRAY changes of 25 June 2001 in favor of correct code:
7161         * eval.c (pop_fcall): Change test and comment for freeing n->vname.
7162           (flags2str): Removed BECAMEARRAY entry.
7163         * awk.h (BECAMEARRAY): Removed define.
7164         * array.c (assoc_lookup): Removed setting of BECAMEARRAY flag.
7165
7166 Mon Jul 23 17:33:13 2001  Arnold D. Robbins  <arnold@skeeve.com>
7167
7168         * io.c (get_a_record): Handle case where RS = "" and input file
7169           is only newlines.  See test/onlynl.   Bug report by
7170           Michel Jouvin <jouvin@lal.in2p3.fr>.
7171
7172 Wed Jul  4 18:34:19 2001  Arnold D. Robbins  <arnold@skeeve.com>
7173
7174         * eval.c (assign_val): Don't allow negative values for NF.
7175         * field.c (set_NF): Robustify field-freeing code to make sure
7176           values are always positive.
7177
7178 Sun Jul  1 19:15:01 2001  Arnold D. Robbins  <arnold@skeeve.com>
7179
7180         * builtin.c (do_index): If second string is "", return 1.
7181
7182 Mon Jun 25 19:34:24 2001  Arnold D. Robbins  <arnold@skeeve.com>
7183
7184         Further rationalization of treatment of dynamic regexes,
7185         so that profiling code works correctly.
7186
7187         * awk.h (NODETYPE): New type, Node_dynregex.
7188         * awkgram.y (mk_rexp): Use Node_dynregex.
7189         * eval.c (nodetypes): Add Node_dynregex.
7190           (r_tree_eval): Add Node_dynregex to case for match_op().
7191         * profile.c (tree_eval): Add Node_dynregex to case for pp_match_op().
7192           (pp_match_op): Handle Node_dynregex, simplify cases for ~ and !~.
7193         * re.c (re_update): Add assertion that type is Node_regex when flags
7194           indicate CONST.
7195
7196         New lint warning.
7197
7198         * awkgram.y (yylex): Added lint warning that constant with leading
7199           zero is treated as octal or hex.
7200
7201         Generalized code for those who are Strong In The Ways of the Source.
7202
7203         * awk.h: New boolean variable.
7204         * main.c (main): Set it.
7205         * eval.c (interpret): For arrays, check it. Remove variable 'first',
7206           not needed anymore.
7207         * profile.c (pp_string_fp): Enable printing of non-ASCII characters
7208           verbatim if variable set.
7209
7210         Fix memory corruption on SCO for array vars as params changed globally.
7211
7212         * awk.h (BECAMEARRAY): New flag.
7213         * array.c (assoc_lookup): Set the flag as appropriate.
7214         * eval.c (flags2str): Add the flag.
7215           (pop_fcall): Check the flag, don't free memory if set.
7216
7217 Wed Jun 13 18:07:06 2001  Arnold D. Robbins  <arnold@skeeve.com>
7218
7219         * eval.c (fmt_index): Actually call erealloc() to grow fmt_list
7220           if that's really necessary.  Bug report from David Jones,
7221           djones@zoonami.com.
7222
7223 Sun Jun 10 14:24:48 2001  Arnold D. Robbins  <arnold@skeeve.com>
7224
7225         * profile.c (pp_match_op): Rationalized the code.
7226
7227 Thu Jun  7 11:54:36 2001  Arnold D. Robbins  <arnold@skeeve.com>
7228
7229         * awk.h (O_BINARY): Don't define if already defined
7230           (as is true for cygwin/gcc --- oops).
7231
7232 Sun Jun  3 13:04:44 2001  Arnold D. Robbins  <arnold@skeeve.com>
7233
7234         * Release 3.1.0: Release tar file made.  And there was
7235           rejoicing.
7236
7237 Wed Apr 25 11:44:07 2001  Arnold Robbins  <arnold@skeeve.com>
7238
7239         * Makefile.am (AM_MAKEFLAGS): Add definition per advice from
7240           Nelson Beebe.
7241
7242 Tue Apr 24 14:28:00 2001  Arnold Robbins  <arnold@skeeve.com>
7243
7244         * io.c (devopen): Patch from Jeurgen to robustify pulling
7245           out hostname, port numbers, etc, to avoid any buffer overrun
7246           problems.
7247
7248 Mon Apr 23 10:26:38 2001  Arnold Robbins  <arnold@skeeve.com>
7249
7250         * awkgram.y: Fix grammar so that `print ... |& ".." |& getline'
7251           dies with a parse-time error message.
7252
7253 Sun Apr 22 16:46:48 2001  Arnold Robbins  <arnold@skeeve.com>
7254
7255         * io.c (socketopen): Fix from Juergen in recursive call.
7256
7257 Thu Apr 19 18:39:20 2001  Pat Rankin  <rankin@eql.caltech.edu>
7258
7259         * awk.h: Really fix logic around include of <sys/types.h>.
7260
7261         * awk.h (callresult): New name for `result' macro.
7262         * eval.c (r_get_lhs, case Node_builtin): Use it.
7263
7264 Thu Apr 19 16:31:09 2001  Pat Rankin  <rankin@eql.caltech.edu>
7265
7266         * io.c: Move code around to allow compilation with DEC C.
7267
7268 Thu Apr 19 16:21:56 2001  Arnold D. Robbins  <arnold@skeeve.com>
7269
7270         * random.h: Move decl of random() here.
7271         * random.c: Remove decl of random().
7272
7273 Mon Apr  9 11:41:58 2001  Arnold D. Robbins  <arnold@skeeve.com>
7274
7275         * dfa.c (dfainit): Initialize more members in the structure,
7276           based on bug report in bug.gnu.utils by aaronl@vitelus.com
7277           (Aaron Lehmann).
7278         * awk.h: Fix logic around include of <sys/types.h>.
7279
7280 Thu Apr  5 20:12:05 2001  Pat Rankin  <rankin@eql.caltech.edu>
7281
7282         * dfa.c: For VMS, #include <stddef.h> instead of <sys/types.h>.
7283         * missing_d/mktime.c: Likewise.
7284
7285         * random.c: Reorder include directives to get gawk config info
7286           from random.h sooner.
7287           [fcntl.h]: Guard #include with HAVE_FCNTL_H test.
7288           [unistd.h]: Guard #include with HAVE_UNISTD_H test.
7289
7290         * random.c (srandomdev): Skip /dev/urandom usage if O_RDONLY
7291           is not defined.
7292
7293 Tue Mar 20 11:07:11 2001  Arnold D. Robbins  <arnold@skeeve.com>
7294
7295         * awkgram.y (function_body): Add opt_nls to end of production.
7296
7297 Tue Mar 20 09:30:32 2001  Pat Rankin  <rankin@eql.caltech.edu>
7298
7299         * awk.h (BROKEN_STRNCASECMP): Add decl of strcasecmp.
7300         * io.c (two_way_open): Add `return FALSE;' for fussy compilers.
7301
7302 Sun Mar 18 15:10:56 2001  Arnold D. Robbins  <arnold@skeeve.com>
7303
7304         * io.c (gawk_pclose): Set the exit value for close correctly
7305           if the pipe died with a signal.
7306
7307 Wed Mar  7 11:28:52 2001  Arnold D. Robbins  <arnold@skeeve.com>
7308
7309         * io.c (get_a_record): Correctly handle the case of a leading
7310           single newline at the front of the file when RS = "".
7311
7312 2001-02-26  Paul Eggert  <eggert@twinsun.com>
7313
7314         * COPYING: Incorporate latest version from FSF, which fixes a Y2k bug.
7315
7316         * builtin.c (do_mktime): Allow the user to specify the
7317           tm_isdst member as an optional trailing integer, and to
7318           specify "out-of-range" members.  Check for overflow when
7319           subtracting 1 from month or 1900 from year.  Allow years just
7320           past INT_MAX, as they work on some hosts when INT_MAX - 1900
7321           is representable as an int.
7322
7323         * doc/gawk.1, doc/gawk.texi: Document the above changes.
7324           Also, document that the origin-zero Gregorian calendar is used.
7325           Fix confusing wording about "midnight" by replacing it with 00:00
7326           ("midnight" is also 24:00, the end of the day).
7327           Mention the typical range for time stamps.
7328           Do not assume that years are nonnegative and are less than 10,000.
7329           Suggest TZ=UTC0 instead of TZ=GMT0, as that's how recent versions
7330           of GNU date behave.
7331           GMT is not always the time of day in Greenwich these days.
7332           Fix typos: "Emporer/Era", "1980's", "1970's".
7333
7334         * m4/largefile.m4: Synchronized with latest version.
7335
7336 Tue Feb 27 12:10:11 2001  Arnold D. Robbins  <arnold@skeeve.com>
7337
7338         * profile.c (pp_in_array): Change test to tree->type == Node_expression_list.
7339
7340 Wed Feb  7 14:46:50 2001  Arnold D. Robbins  <arnold@skeeve.com>
7341
7342         * awkgram.y (LEX_FOR): Allow newline after `;' in for loops.
7343           Per bug report from Brian Kernighan, bwk@research.bell-labs.com.
7344
7345 Tue Feb  6 18:35:27 2001  Martin C. Brown    <mc@whoever.com>
7346
7347         * io.c (socket_open): Conditionalize various options based on
7348           ifdef. Needed for BeOS port.
7349
7350 Tue Feb  6 18:17:13 2001  Michal Jaegermann  <michal@ellpspace.math.ualberta.ca>
7351
7352         * regex.c (re_match_2_internal): Case maybe_pop_jump, for
7353           charset and not_charset: Change cast from (unsigned char)
7354           to (unsigned).  Catches last 8 chars with high bit set
7355           if backtracking. See test/rebt8b1.awk, test/rebt8b2.awk.
7356
7357 Tue Feb  6 11:20:21 2001  Arnold D. Robbins  <arnold@skeeve.com>
7358
7359         Have `for (iggy in foo)' save the elements and loop over them.
7360         Make sorted for loops a dynamic test instead of a compile time test.
7361         Still requires being Strong In The Ways Of The Source.
7362
7363         * awk.h: (struct search): Removed.
7364           (assoc_scan, assoc_next): Removed declarations.
7365         * array.c (assoc_scan, assoc_next): Removed functions.
7366         * eval.c (interpret): Remove Node_K_array_sorted_for. Change code
7367           at Node_K_arrayfor.
7368           (nodetypes): Remove Node_K_array_sorted_for.
7369         * configure.in: Removed array sorting test.
7370         * awkgram.y: Removed sorted_in keyword and associated code.
7371
7372 Sun Feb  4 14:57:49 2001  Arnold D. Robbins  <arnold@skeeve.com>
7373
7374         * eval.c (interpret): Use tree->rnode->exec_count to hold count of
7375           times if was true.
7376           profile.c (interpret): Ditto.
7377         * main.c (pre_assign): Gross hack. malloc fresh copy of assign so can
7378           clear the '=', otherwise screws up profiling print out.
7379
7380 Sun Jan 28 16:16:02 2001  Arnold D. Robbins  <arnold@skeeve.com>
7381
7382         Per request from Nelson Beebe, SIGHUP to pgawk dumps profile
7383         and function call stack and exits, SIGUSR1 dumps and continues
7384         running.
7385
7386         * eval.c (dump_fcall_stack): New function, dumps awk function call
7387           stack.
7388         * awk.h (dump_fcall_stack): Add declaration.
7389           (init_profiling_signals): Ditto.
7390         * main.c (main): Call init_profiling_signals.
7391         * profile.c (init_profiling_signals, dump_and_exit, just_dump): New
7392           functions.
7393
7394 Sun Jan 28 15:50:02 2001  Eli Zaretskii  <eliz@is.elta.co.il>
7395
7396         * io.c (gawk_popen): Restore the mode of stdin before running the
7397           child process and switch it back if BINMODE is in effect after the
7398           child returns.
7399           (redirect): Restore the mode of stdin before running the child
7400           process.
7401           (close_redir): Switch mode of stdin back to binary if BINMODE is
7402           in effect, after the child returns.
7403
7404         * builtin.c (do_system): Restore the mode of stdin before running
7405           the child process and switch it back if BINMODE is in effect after
7406           the child returns.
7407
7408         * awk.h (os_restore_mode): Add prototype.
7409
7410 Thu Jan 18 14:03:06 2001  Arnold D. Robbins  <arnold@skeeve.com>
7411
7412         * custom.h, README_d/README.ultrix: Fixes for Ultrix
7413           from Juergen Kahrs.
7414
7415 Wed Jan 17 11:03:40 2001  Eli Zaretskii  <eliz@is.elta.co.il>
7416
7417         * io.c (redirect) [F_GETFL && O_APPEND]: Use binmode in the call
7418           to fdopen.
7419
7420 Mon Jan 15 16:29:52 2001  Arnold D. Robbins  <arnold@skeeve.com>
7421
7422         * profile.c (prec_level): Made Node_K_getline higher than <
7423           but lower than others.  Allows use of getline with redirection
7424           inside an if.
7425
7426 Wed Jan 10 15:35:06 2001  Arnold D. Robbins  <arnold@skeeve.com>
7427
7428         * eval.c (set_BINMODE): Rationalized string assignment.
7429
7430 Sun Jan  7 15:26:16 2001  Arnold D. Robbins  <arnold@skeeve.com>
7431
7432         * getopt.h: Removed names in prototypes for getopt_long
7433           and getopt_long_only, fixes problems on MINGW32.
7434
7435 Thu Jan  4 10:13:46 2001  Arnold D. Robbins  <arnold@skeeve.com>
7436
7437         * configure.in: Add check for mcheck.h
7438         * main.c: Include mcheck.h if have it.
7439           (main):  If TIDYMEM turned on in environment, also call mtrace().
7440
7441 Wed Jan  3 16:41:33 2001  Arnold D. Robbins  <arnold@skeeve.com>
7442
7443         Fixed minor memory leaks.
7444         * re.c (re_update): When IGNORECASE changed, unref(t->re_text).
7445         * eval.c (pop_fcall): Fix the logic to correctly free the vname
7446           when copying array args back to their underlying source.
7447
7448         Fixed massive memory leaks.
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.
7452         * array.c (assoc_lookup): Turn off PERM also when saving subscript.
7453         * builtin.c (sub_common): Turn off PERM also when making private copy
7454           of string.
7455
7456         Add a minor memory cleanup facility (undocumented):
7457         * awk.h (do_tidy_mem, release_all_vars): Add declarations.
7458         * main.c (do_tidy_mem): Add declaration.
7459           (main): If $TIDYMEM exists, do_tidy_mem is true, and call mtrace().
7460         * awkgram.y (release_all_vars): New function.
7461
7462 Sun Dec 31 10:47:37 2000  Arnold D. Robbins  <arnold@skeeve.com>
7463
7464         * awkgram.y (in_end_rule): Renamed `parsing_end_rule' to avoid
7465           conflict with global var of same name.
7466
7467 Sun Dec 24 10:36:54 2000  Eli Zaretskii  <eliz@is.elta.co.il>
7468
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
7471           plural suffix.
7472
7473 Tue Dec 12 08:38:03 2000  Arnold D. Robbins  <arnold@skeeve.com>
7474
7475         * ext.c (do_ext): ifdef out use of `dummy'. Duh.
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.
7479
7480 Fri Dec  8 11:47:26 2000  Arnold D. Robbins  <arnold@skeeve.com>
7481
7482         * ext.c (dummy): Make gcc specific via ifdef.
7483         * builtin.c (do_dcgettext): Make conditional compilation smarter.
7484         * msg.c (warning, error, r_fatal): Finish switching back to
7485           multi-version function header.
7486
7487 Wed Dec  6 13:28:58 2000  Arnold D. Robbins  <arnold@skeeve.com>
7488
7489         * random.h: Include <config.h> to get ssize_t definition.
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.
7493           msg.c (msg): Ditto.
7494
7495 Tue Dec  5 15:05:35 2000  Arnold D. Robbins  <arnold@skeeve.com>
7496
7497         * configure.in (AC_C_INLINE): Added macro call.
7498         * Makefile.am (LN): Define it for install hooks.
7499
7500 Sun Dec  3 17:28:53 2000  Arnold D. Robbins  <arnold@skeeve.com>
7501
7502         * awk.h (os_setbinmode): Declare new function.
7503           (setmode): Remove definition: conflicts with MacOS X.
7504         * main.c (main): Change call of setmode to os_setbindmode.
7505
7506         * builtin.c (do_dcgettext): Improve ifdef for code, fixes MacOS X.
7507         * custom.h (__APPLE__): Force definition of HAVE_MKTIME, won't
7508           link otherwise.  Harumph.
7509
7510 Sun Nov 26 11:58:52 2000  Arnold D. Robbins  <arnold@skeeve.com>
7511
7512         * builtin.c (do_dcgettext, do_bindtextdomain): Add calls to
7513           free_temp the various arguments.  Sigh.
7514         * io.c (yylex): Nuked bstart variable, put all uses of mend variable
7515           into TANDEM ifdef.
7516         * main.c (load_environ): Removed cp variable, value never used.
7517         * random.c: Remvoed uses of `inline' keyword.
7518         * Makefile.am (install-exec-hook, uninstall-local): New targets.
7519           Adds creation of gawk-X.Y.Z and awk links, as in 3.0.x.
7520         * configure.in (GAWK_AC_TYPE_SSIZE_T): Added.
7521           m4/ssize_t.m4: New file.
7522
7523 Wed Nov 22 14:47:18 2000  Arnold D. Robbins  <arnold@skeeve.com>
7524
7525         After consultation with Brian Kernighan and Michael Brennan,
7526         nuked the abort keyword.
7527
7528         * awk.h (Node_K_abort): Removed.
7529         * eval.c (aborting): Removed decl.
7530           (interpret): Removed Node_K_abort case.
7531         * io.c (do_input): Removed checks for aborting.
7532         * main.c (aborting): Removed.
7533           (main): Removed checks for aborting.
7534         * profile.c (pprint): Removed Node_K_abort case.
7535         * awk.y (LEX_ABORT): All stuff removed.
7536
7537 Wed Nov 22 10:45:57 2000  Arnold D. Robbins  <arnold@skeeve.com>
7538
7539         * ext.c (dummy): Move inside #ifdef DYNAMIC. Helps on
7540           PCs and other platforms that don't do dynamic loading.
7541         * awk.h (RED_TCP): New flag, means use shutdown.
7542           io.c (redflags2str): Add RED_TCP.
7543           (SHUT_RD, SHUT_WR, SHUT_RDWR): Add conditional defines.
7544           (redirect): Add RED_TCP to tflag if appropriate.  Add more
7545           #ifdef HAVE_SOCKETS as needed.
7546           (close_redir): If RED_TCP set, shutdown(2) on each end of the socket.
7547
7548 Tue Nov 21 16:25:41 2000  Arnold D. Robbins  <arnold@skeeve.com>
7549
7550         * awk.y: for (iggy in foo) loops: Add test that index
7551           in delete statement is a simple variable.
7552
7553 Tue Nov 14 16:11:39 2000  Arnold D. Robbins  <arnold@skeeve.com>
7554
7555         * awk.h: Add appropriate conditional versions of the gettext
7556           functions if we don't have <libintl.h> or if ENABLE_NLS
7557           is not defined or zero.
7558         * configure.in: Add check for libintl.h header.
7559
7560         From Scott Deifik for PCs.
7561         * awk.h (lintwarn): Call set_loc unconditionally, makes
7562           compilation work on PCs.
7563         * builtin.c (do_dcgettext): Compile out cat_tab and code
7564           if not ENABLE_NLS.
7565         * ext.c: For MSC, no long long variable.
7566         * random.c: Use clock() instead of gettimeofday().
7567         * builtin.c: Fixed prototypes for new random functions (ADR).
7568
7569 Sun Nov 12 17:45:44 2000  Arnold D. Robbins  <arnold@skeeve.com>
7570
7571         * builtin.c (parse_next_arg): Fix call to >= num_args so
7572           running out of args check is correct, instead of core dumping.
7573           (format_tree): Save and restore `the_args' and `args_size'
7574           if a nested call is in progress, see explanatory comment.
7575           See also tests/addcomma.
7576         * Makefile.am: Fix things so that gawk/pgawk built first,
7577           even if `make check' called before make.  Add some
7578           commentary.
7579
7580 Wed Nov  8 14:39:20 2000  Arnold D. Robbins  <arnold@skeeve.com>
7581
7582         * configure.in: Only add -rdynamic for Linux.
7583         * dfa.h, dfa.c: Upgraded to versions in grep 2.4.2.
7584
7585 Tue Nov  7 18:17:17 2000  Arnold D. Robbins  <arnold@skeeve.com>
7586
7587         * All: Switched to ANSI function headers and added
7588           `ansi2knr' automake option.  Really cool.
7589
7590 Tue Nov  7 16:57:49 2000  Arnold D. Robbins  <arnold@skeeve.com>
7591
7592         * io.c (redirect): Check for O_APPEND in flags when doing
7593           fdopen() of /dev/fd/N.  Thanks to bug report from
7594           "John H. DuBois III" <spcecdt@armory.com>.
7595
7596 Tue Nov  7 14:09:14 2000  Arnold D. Robbins  <arnold@skeeve.com>
7597
7598         * awk.h (os_is_setuid): Declare function.
7599         * main.c (main): Call it if do_lint and warn if true.
7600         * awkgram.y (tokentab):
7601           - Made sure all extensions are actually marked as such.  Ouch.
7602           - Changed "sort" to "asort".  Potential to break too much old code.
7603         * getopt.h, getopt.c, getopt1.c: Replaced with current versions
7604           from glibc CVS archive.
7605
7606 Mon Nov  6 18:14:33 2000  Arnold D. Robbins  <arnold@skeeve.com>
7607
7608         * random.c: Replaced with recent version from FreeBSD.
7609
7610 Mon Nov  6 15:37:12 2000  Arnold D. Robbins  <arnold@skeeve.com>
7611
7612         Major simplification of automake machinery.
7613
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
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.
7620         * eval_p.c, profile_p.c: New files to make it easier with automake
7621           to compile pgawk.
7622
7623 Tue Oct 24 12:20:18 2000  Arnold D. Robbins  <arnold@skeeve.com>
7624
7625         * awkgram.y (valinfo, var_comp, dump_vars): New functions to dump
7626           the list of global variables.
7627         * awk.h: Declare dump_vars.
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.
7632
7633 Sat Oct 21 22:59:59 2000  Arnold D. Robbins  <arnold@skeeve.com>
7634
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.
7639         * main.c (main): If do_lint, call shadow_funcs().
7640         * awk.h: Add declaration of shadow_funcs().
7641         * configure.in: Added m4/Makefile and awklib/eg/network/Makefile
7642           to list of generated makefiles.
7643
7644 Tue Oct 17 10:47:35 2000  Arnold D. Robbins  <arnold@skeeve.com>
7645
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.
7652
7653 Mon Oct 16 12:21:26 2000  Arnold D. Robbins  <arnold@skeeve.com>
7654
7655         * All: Cleaned up various lint warnings for consistent phrasing.
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.
7658
7659 Sun Oct 15 14:14:05 2000  Arnold D. Robbins  <arnold@skeeve.com>
7660
7661         * field.c (set_FS): Add lint warning for FS = "".
7662           (do_split): Ditto for 3rd arg = "".
7663
7664 Fri Oct 13 09:17:04 2000  Arnold D. Robbins  <arnold@skeeve.com>
7665
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
7669           co-process.
7670           (flush_io): Add warning message if fflush of co-process
7671           fails.  Rationalize return value to either 0 or -1.
7672         * builtin.c (do_gensub): 3rd arg of zero generates a
7673           warning.
7674           (do_fflush): Rationalize return value: -1 for unopen or read-only
7675           redirection, status of fflush otherwise.
7676
7677 Wed Oct 11 22:11:19 2000  Arnold D. Robbins  <arnold@skeeve.com>
7678
7679         * awk.y (for loop): Check that there is a body as
7680           part of the `is it a delete statement' check.
7681
7682 Thu Oct  5 11:56:42 2000  Arnold D. Robbins  <arnold@skeeve.com>
7683
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.
7687
7688 Mon Oct  2 10:09:32 2000  Arnold D. Robbins  <arnold@skeeve.com>
7689
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.
7694
7695 Thu Sep 28 17:27:16 2000  Arnold D. Robbins  <arnold@skeeve.com>
7696
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>.
7700
7701 Tue Sep 26 14:41:41 2000  Arnold D. Robbins  <arnold@skeeve.com>
7702
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.
7706
7707 Sun Sep 24 16:38:04 2000  Arnold D. Robbins  <arnold@skeeve.com>
7708
7709         * awk.h (freenode): Set the flags straight to UNINITIALIZED.
7710         * node.c (unref): Fix test for MALLOC|TEMP to test the
7711           actual flags, not zero.
7712         * builtin.c (format_tree): ala print and concat, dupnode
7713           the temp nodes from tree_evaling the arguments.  See
7714           test/nasty2.awk.
7715
7716 Mon Sep 18 10:16:58 2000  Arnold D. Robbins  <arnold@skeeve.com>
7717
7718         * awkgram.y (snode): Make match 3rd arg and close 2nd arg fatal
7719           errors if --tradtional.
7720
7721 Thu Sep 14 12:22:42 2000  Arnold D. Robbins  <arnold@skeeve.com>
7722
7723         * eval.c (update_ERRNO): Call gettext on result of strerror.
7724           i18n rules.
7725
7726 Wed Sep 13 14:56:11 2000  Arnold D. Robbins  <arnold@skeeve.com>
7727
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.
7733
7734 Wed Sep 13 10:06:47 2000  Arnold D. Robbins  <arnold@skeeve.com>
7735
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,
7741           all three versions.
7742         * awkgram.y (tokentab): Allow 2nd argument to close.
7743           (snode): Add lint warning.
7744
7745 Sun Sep 10 14:16:10 2000  Arnold D. Robbins  <arnold@skeeve.com>
7746
7747         * field.c (set_FIELDWIDTHS): Generate a fatal error upon
7748           encountering a negative width.
7749
7750 Sun Sep 10 10:37:35 2000  Arnold D. Robbins  <arnold@skeeve.com>
7751
7752         * awkgram.y (snode): If first argument to dcgettext is a
7753           string constant and --gen-po, dump the string constant to
7754           the .po file too.
7755         * main.c (nostalgia): Add call to fflush(stderr).
7756         * eval.c (r_tree_eval): Add entries for Node_LINT and for
7757           NODE_TEXTDOMAIN.
7758
7759 Thu Sep  7 10:46:20 2000  Arnold D. Robbins  <arnold@skeeve.com>
7760
7761         * builtin.c (do_dcgettext): Per suggestion from Ulrich Drepper,
7762           make the awk interface:
7763
7764                 str = dcgettext(string [, domain [, category]])
7765
7766 Wed Sep  6 16:28:12 2000  Arnold D. Robbins  <arnold@skeeve.com>
7767
7768         Bring gettext features out to the awk level!
7769
7770         * awk.h: Add declarations of new functions `do_dcgettext'
7771           `do_bindtextdomain', `set_TEXTDOMAIN' and variables
7772           `TEXTDOMAIN', `TEXTDOMAIN_node'.  New NODETYPE enum
7773           `Node_TEXTDOMAIN'.
7774         * eval.c (nodetypes): Add Node_TEXTDOMAIN at end.
7775           (set_TEXTDOMAIN): New function.
7776           (r_get_lhs): Add case for Node_TEXTDOMAIN.
7777         * main.c (varinit): Add entry for TEXTDOMAIN.
7778         * node.c (format_val): If INTLSTR use dcgettext of string
7779           and TEXTDOMAIN.
7780         * awkgram.y (tokentab): Add entries for "dcgettext" and
7781           "bindtextdomain".
7782         * builtin.c (do_dcgettext, do_bindtextdomain): New functions.
7783
7784 Tue Sep  5 17:01:34 2000  Arnold D. Robbins  <arnold@skeeve.com>
7785
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.
7792         * m4/strtod.m4: New file, defines GAWK_AC_FUNC_STRTOD_C89.
7793         * configure.in: GAWK_AC_FUNC_STRTOD_C89 call added
7794         * acinclude.m4: Include strtod.m4.
7795         * acconfig.h: Add entry for STRTOD_NOT_C89.
7796           Remove entries for BITOPS and NON_DEC_DATA.
7797         * missing/missing.c: Add check for STRTOD_NOT_C89, use ours
7798           if set.
7799         * missing/strtod.c: Make smarter for input like 0x345.
7800         * awk.h: [STRTOD_NOT_C89]: Define strtod gawk_strtod to get
7801           our version.  Avoids linker weirdness.
7802
7803 Mon Sep  4 09:16:43 2000  Arnold D. Robbins  <arnold@skeeve.com>
7804
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.
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.
7812
7813 Sun Sep  3 13:52:11 2000  Arnold D. Robbins  <arnold@skeeve.com>
7814
7815         * builtin.c (format_tree): Allow positional parameters for
7816           %*.* kinds of things.
7817
7818         Made octal/hex constants and strtonum on by default. Made
7819         --enable-non-decimal-data a runtime switch `--non-decimal-data'.
7820
7821         * configure.in: Removed AC_ARG_ENABLE for --enable-bitops and
7822           --enable-non-decimal-data.
7823           In .developing check, remove the AC_DEFINEs.
7824         * awk.h: Decls for bitwise functions now there by default.
7825           Add decl of `do_non_decimal_data'.
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.
7830         * node.c (r_force_number): Make check for non-decimal data a
7831           runtime check based on do_non_decimal_data.
7832         * awkgram.y (yylex): Make non-decimal constants a runtime check.
7833         * builtin.c: Remove the ifdefs around the bit functions and
7834           nondec2awknum.
7835
7836 Tue Aug 29 18:45:56 2000  Arnold D. Robbins  <arnold@skeeve.com>
7837
7838         * configure.in: Go back to ARRAYDEBUG if .developing set.
7839         * awkgram.y: Use ARRAYDEBUG for adump(), use multiple tests
7840           for stopme().
7841
7842 Mon Aug 28 17:09:06 2000  Arnold D. Robbins  <arnold@skeeve.com>
7843
7844         * field.c (do_split): Add check for first arg is null string,
7845           if so, skip the work and return zero.
7846
7847 Mon Aug 14 23:01:55 2000  Arnold D. Robbins  <arnold@skeeve.com>
7848
7849         Add %COUNT$... handling to printf.
7850
7851         * awk.h (printf_count): New define in NODE structure.
7852           (format_tree): Added decl.
7853         * awkgram.y (count_args): New function to set printf_count in
7854                 a node.
7855           [print productions]: Call the function.
7856         * (snode): For do_sprintf, call count_args, set the count
7857                 in the lnode.
7858         * builtin.c (format_tree): New fourth arg is argument count.
7859           Add smarts to handle the `$' in a format.
7860         * (do_sprintf): Use new argument to format_tree.
7861           node.c (format_val): Ditto.
7862
7863 Sun Aug 13 11:10:41 2000  Arnold D. Robbins  <arnold@skeeve.com>
7864
7865         Changes from Alan J. Broder (ajb@woti.com):
7866         - Array third arg to match puts subtexts into the array:
7867
7868         * awk.y (tokentab): "match" gets third arg, and lint warning
7869         * builtin.c (do_match): If third arg there, fill it with subtexts
7870
7871         - New builtin sort function:
7872
7873         * awk.h (do_sort): Declared.
7874         * array.c (do_sort, dup_table, merge, merge_sort, assoc_from_list,
7875           assoc_sort_inplace): New functions.
7876
7877         * eval.c (tree_eval): In debug code, make uninitialized var
7878           a warning, not a fatal error.  Breaks too many things.
7879
7880 Wed Aug  9 10:51:41 2000  Arnold D. Robbins  <arnold@skeeve.com>
7881
7882         * eval.c (func_call): Increment the exec_count on the
7883           function's node; this allows printing a call count for
7884           functions.
7885           profile.c (pp_func): Print the count for functions.
7886         * ALL: Changed DEBUG to GAWKDEBUG in all gawk files, so that
7887           I don't get regex/dfa debugging.  In some cases, changed
7888           memory-related stuff to MEMDEBUG.  Still have work to do.
7889         * awk.h, node.c, profile.c: Removed exec_count_init variable;
7890           code has been cleaned up to not need different values for
7891           profiling/not profiling.
7892
7893 Thu Jul  5 21:10:59 2000  Arnold D. Robbins  <arnold@skeeve.com>
7894
7895         * eval.c (casetable): Removed the USE_PURE_ASCII stuff; it
7896           was never documented.  Latin 1 forever.
7897         * main.c (main): Only call `init_profiling' after arg parsing
7898           if `do_profiling' is still false.  Avoids resetting `prof_fp'
7899           back to stderr.
7900
7901 2000-02-17  Akim Demaille  <akim@epita.fr>
7902
7903         * m4: New directory.
7904         * acinclude.m4: Removed, replaced by m4/*.m4.
7905         * Makefile.am: Adjusted.
7906         Added ACLOCAL_AMFLAGS.
7907         * configure.in Adjusted.
7908         Use AC_SYS_LARGEFILE not GAWK_AC_SYS_LARGEFILE, jm_FUNC_MKTIME,
7909         not GAWK_FUNC_MKTIME.
7910         * acconfig.h: Removed _FILE_OFFSET_BITS, _LARGEFILE_SOURCE and
7911         _LARGE_FILES now templated by m4/largefile.m4.
7912
7913 2000-02-15  Arnold Robbins  <arnold@skeeve.com>
7914
7915         * MOVED TO AUTOMAKE AND GETTEXT.
7916           Just about every file touched.  Work done by Arno Peters.
7917
7918 Sun Jan  2 14:48:23 2000  Arnold D. Robbins  <arnold@skeeve.com>
7919
7920         First edit of the new millenium!
7921         * awk.y (yylex): If lint checking, be obnoxious about gotos.
7922
7923 Mon Oct 25 19:12:02 1999  Arnold D. Robbins  <arnold@skeeve.com>
7924
7925         * awk.h: Remove C_ALLOCA ifdef.
7926         * main.c (main): Remove C_ALLOCA code.
7927         * io.c (do_input): Ditto.
7928
7929 Mon Aug  9 17:36:24 1999  Arnold D. Robbins  <arnold@skeeve.com>
7930
7931         * bisonfix.sed: Unconditionally #undef YYSTACK_USE_ALLOCA.
7932         * configure.in: Remove all alloca and ALLOCA related stuff.
7933         * Makefile.in: Ditto.
7934
7935 Thu Jul 29 18:32:05 1999  Arnold D. Robbins  <arnold@skeeve.com>
7936
7937         * awk.h (NODE): exec_count now in #ifndef NO_PROFILING.
7938         * Makefile.in: Changes to only recompile eval.c and profile.c to a
7939           special version for profiling.
7940         * custom.h [MSC_VER]: Turn on NO_PROFILING to omit the exec_count
7941           and save space.
7942         * node.c (more_nodes): Move setting of exec_count to
7943           #ifndef NO_PROFILING.
7944
7945 Thu Jul  1 12:12:05 1999  Arnold D. Robbins  <arnold@skeeve.com>
7946
7947         * configure.in (AC_PREREQ): Update to 2.13.
7948           GAWK_AC_C_STRINGIZE: convert to AC_C_STRINGIZE.
7949         * aclocal.m4 (GAWK_AC_C_STRINGIZE): Remove definition, now
7950           part of autoconf.
7951         * acconfig.h (HAVE_STRINGIZE): Ditto.
7952
7953 Wed Apr 28 11:08:05 1999  Arnold D. Robbins  <arnold@skeeve.com>
7954
7955         * array.c (assoc_lookup): Fix call to free_temp(subs) to after
7956           last use of subs.
7957
7958 Sun Apr 25 16:48:06 1999  Arnold D. Robbins  <arnold@skeeve.com>
7959
7960         * io.c (redirect): Add lint warning when same file is used for
7961           > and >>.
7962
7963 Thu Apr 22 15:05:30 1999  Arnold D. Robbins  <arnold@skeeve.com>
7964
7965         * array.c (assoc_lookup): Fix call to fatal to lintwarn instead.
7966         * node.c (r_force_number): Use `0 &&' to disable warnings about
7967           conversions: they're overzealous, methinks.
7968
7969 Thu Apr  8 14:27:58 1999  Arnold D. Robbins  <arnold@skeeve.com>
7970
7971           New features for profiling:
7972
7973         * awk.h (NODE): Add `exec_count' member.
7974           (freenode): Clear `exec_count' upon free.
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
7978           pretty printing.
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         * eval.c (INCREMENT): New macro for counting execution of nodes.
7983           (interpret): Call INCREMENT() appropriately.
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.
7989         * node.c (more_nodes, freenode): Set exec_count to zero.
7990         * profile.c: New file, does pretty printing and prints counts.
7991         * Makefile.in: Update to create two versions of gawk, regular
7992           and `pgawk' which does profiling.
7993
7994 Wed Mar 10 21:38:14 1999  Arnold D. Robbins  <arnold@skeeve.com>
7995
7996         * io.c (close_redir): Use update_ERRNO() instead of manually
7997           doing it.
7998
7999 Mon Dec 21 15:58:21 1998  Arnold D. Robbins  <arnold@skeeve.com>
8000
8001         * configure.in: Add BeOS to list of cases where we hardwire
8002           GETPGRP_VOID.
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,
8005           mc@whoever.com.
8006
8007 Mon Nov 30 20:52:52 1998  Arnold D. Robbins  <arnold@skeeve.com>
8008
8009         * eval.c (update_ERRNO): New function, mainly for use by
8010           extension functions.
8011         * awk.h: Add decl.
8012
8013 Tue Nov 24 18:13:29 1998  Arnold D. Robbins  <arnold@skeeve.com>
8014
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)
8021           Additional change:
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         * 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
8029         * acconfig.h (DYNAMIC): New macro, true if can do dynamic loading
8030         * array.c (assoc_lookup): New parameter `reference' is true if we
8031           want to do reference  checking. Add appropriate reference checking
8032           code.
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
8037           code in eval.c.
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         * awk.y (tokentab): New builtin "extension" for adding extensions
8042           (node_common): Set flags to UNINITIALIZED for Node_var.
8043         * configure.in (dynamic linking): New check. Probably should
8044           be a separate macro.
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.
8050         * ext.c: New file, for doing dynamic library extensions.
8051         * extension/*: New directory with simple example code.
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.
8057         * node.c (r_force_number): Checks that string really is a number.
8058           (morenodes): Set UNITIALIZED in the flags.
8059         * re.c (all): Change `result' to `res' globally to avoid conflict
8060           with new macro.
8061         * GLOBAL: Change lint calls to warning() to  lintwarn().
8062         * GLOBAL: Change all calls to get_lhs() to have 3rd arg.
8063         * GLOBAL: Change all calls to assoc_lookup() to have 3rd arg.
8064
8065 Sun Nov 22 17:07:39 1998  Arnold D. Robbins  <arnold@skeeve.com>
8066
8067         * patchlev.h: Renamed from patchlevel.h to make life
8068           easier for the PC guys.
8069           (main.c): Changed to include patchlev.h.
8070           (Makefile.in): Changed to ref patchlev.h where needed.
8071
8072 Sat Nov  7 21:29:52 1998  Arnold D. Robbins  <arnold@skeeve.com>
8073
8074         * eval.c (r_get_lhs): case Node_field_spec.  Fix the lint
8075           warnings for field reference of null string or non-numeric value.
8076           When turned on, $0 generated a warning!  Oops.
8077
8078 Thu Nov  5 16:58:38 1998 Arnold D. Robbins  <arnold@skeeve.com>
8079
8080         * main.c (init_fds): New function to pre-open 0, 1, and 2 on
8081           /dev/null if they're not open. Robustness, more or less.
8082           (main): Call init_fds.
8083         * io.c (str2mode): Add smarts for two-letter strings
8084           such as "rw", "r+", "wr", "w+" and "a+".
8085
8086 Mon Nov  2 16:55:46 1998 Arnold D. Robbins  <arnold@skeeve.com>
8087
8088         * builtin.c (do_*): Added lint checks for non-numeric
8089           and/or non-string arguments, as appropriate. This should
8090           have been done long ago.
8091
8092 Tue Oct 20 21:56:06 1998  Arnold D. Robbins  <arnold@skeeve.com>
8093
8094         * awk.h (LINT_node): New variable for LINT special var
8095           (Node_LINT): New node type.
8096           (set_LINT): Declare function.
8097         * main.c (varinit): Add LINT variable.
8098           (usage): Print an emphatic pointer to the manual for bug reports.
8099         * eval.c (nodetypes): New entry for Node_LINT.
8100           (r_get_lhs): Case added for Node_LINT.
8101           (set_LINT): Set do_lint from LINT variable.
8102
8103 Mon Oct 19 22:35:46 1998  Arnold D. Robbins  <arnold@skeeve.com>
8104
8105         * configure.in: For GCC, add -Wall to get warnings for development.
8106         * Makefile.in (awktab.c): Move sed stuff to separate script.
8107         * bisonfix.sed: New script, with old fix and Solaris x86 fix.
8108         * awk.h (nodetype2str): Add declaration.
8109           (load_procinfo): Add declaration.
8110
8111 Tue Oct 13 22:28:56 1998  Arnold D. Robbins  <arnold@skeeve.com>
8112
8113           Changes to make PROCINFO["FS"] reflect the use of FIELDWIDTHS or FS.
8114
8115         * eval.c (assign_val): New function that does the mechanics of
8116                  assignment
8117         * main.c (load_procinfo): Add setting of PROCINFO["FS"] to "FS".
8118         * field.c (update_PROCINFO): New function to update the array.
8119           (set_FS): Call update_PROCINFO.
8120           (set_FIELDWIDTHS): Ditto.
8121
8122 Sun Sep 27 10:18:05 1998  Arnold D. Robbins  <arnold@skeeve.com>
8123
8124         * awk.h (reisstring): New prototype.
8125         * re.c (reisstring): New function, returns true if the re did
8126           a simple string match. This is rather simplistic in its logic.
8127         * io.c (get_a_record): In the case that RS is a regexp, AND
8128           the re matched at the exact end of the buffer, add a call to
8129           `reisstring' in case it's a simple string match. If so, we
8130           don't need to read more into the buffer because we don't
8131           have a regex like `x.*y' that might extend longer.
8132           This should be very helpful for interactive /inet clients
8133           where something like `RS = "\r\n"' happens.
8134
8135 Thu Aug 13 22:07:40 1998  Arnold D. Robbins  <arnold@skeeve.com>
8136
8137         * io.c (socketopen): Fixes from Juergen Kahrs to socket
8138           opening code for "any host".
8139
8140 Tue Jul 14 19:02:33 1998  Arnold D. Robbins  <arnold@skeeve.com>
8141
8142         * aclocal.m4 (GAWK_AC_LIB_SOCKETS): Removed the caching;
8143           configure gave different results the second time it was run!
8144
8145 Fri Jul 10 09:11:06 1998  Arnold D. Robbins  <arnold@skeeve.com>
8146
8147         * eval.c (interpret): Minor cleanups: add variable name to
8148           fatal error Node_K_array_for and other minor changes.
8149
8150 Mon Jun 22 16:53:34 1998  Arnold D. Robbins  <arnold@skeeve.com>
8151
8152         * Makefile.in (tags, TAGS): Add $(LIBSRC).
8153
8154 Tue Jun  2 15:23:05 1998  Arnold D. Robbins  <arnold@skeeve.com>
8155
8156         * io.c (devopen): Relax previous change, don't require "any",
8157           just that a port be there. The user can put 0 if they
8158           don't care.
8159
8160 Wed May 27 21:33:45 1998  Arnold D. Robbins  <arnold@skeeve.com>
8161
8162         * io.c (devopen): For /inet, require that local and remote
8163           ports and the remote hostname be there, and that `any'
8164           be used for a port if they don't care.
8165
8166 Thu May 21 14:13:46 1998  Arnold D. Robbins  <arnold@skeeve.com>
8167
8168         * node.c (parse_escape): Add warning that is always on
8169           for \q for any unknown q inside string or regex constant.
8170           I got bit by this myself once too often. Or else I'm
8171           just getting old and senile.
8172
8173 Mon May  4 12:42:49 1998  Arnold D. Robbins  <arnold@skeeve.com>
8174
8175         * awk.h (NODETYPE): Sorted the Node_xxx entries for the
8176           builtin variables. Gotta look nice, don't we?
8177         * eval.c (nodetypes): Ditto.
8178           (genflags2str): Added code to check that we don't
8179           overflow the static buffer. This is just a debugging
8180           routine, not worth the hassle of dynamic allocation.
8181
8182 Mon Mar  2 16:06:16 1998  Arnold D. Robbins  <arnold@skeeve.com>
8183
8184         * Makefile.in (dist): Remove any embedded copied RCS or CVS
8185           directories.
8186
8187 Mon Feb 23 00:09:52 1998  Arnold D. Robbins  <arnold@skeeve.com>
8188
8189         * awk.h (genflags2str): Add declaration.
8190         * eval.c (genflags2str): New function.
8191           (flags2str): Use new general purpose function.
8192         * io.c (redflags2str): Same.
8193
8194 Sun Feb 22 23:57:29 1998  Arnold D. Robbins  <arnold@skeeve.com>
8195
8196         Significant changes to add two-way i/o and sockets!!!
8197
8198         * Makefile.in: Add @SOCKET_LIBS@ to LIBS variable.
8199         * acconfig.h: Add HAVE_SOCKETS and HAVE_PORTALS defs.
8200         * aclocal.m4: New macro GAWK_AC_LIB_SOCKETS.
8201         * awk.h: New node type, Node_redirect_twoway, and new redirection
8202           flags: RED_TWOWAY, and RED_SOCKET.
8203         * awk.y (parser): Add TWOWAYIO token and appropriate productions.
8204           (yylex): Recognize `|&' token if not traditional.
8205         * builtin.c (do_print, do_printf): Flush buffer if TWOWAYIO.
8206         * configure.in: Add header checks for networking header files,
8207           add --enable-portals switch, call GAWK_AC_LIB_SOCKETS
8208         * eval.c (nodetypes): Add string constant for Node_redirect_twoway.
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.
8215
8216 Sat Dec 13 21:15:07 1997  Arnold D. Robbins  <arnold@skeeve.com>
8217
8218         * awk.h (struct node): New member, `param_list' in union `x', becomes
8219           `node->parmlist' in the code.
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.
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
8230           the `vname' field.
8231           (stopme): New do-nothing function for use with debugging code
8232           and setting breakpoints.
8233
8234 Thu Dec  4 15:18:17 1997  Arnold D. Robbins  <arnold@skeeve.com>
8235
8236         * awk.y: Fixed several lint checks and moved some into
8237           test for do_lint_old.
8238         * eval.c (fmt_index): Add value of bad format spec to
8239           error message.
8240
8241 Tue Nov 18 22:19:02 1997  Arnold D. Robbins  <arnold@skeeve.com>
8242
8243         * Makefile.in (install): Strip the installed binary.
8244           From Anatoly A. Orehovsky (tolik@mpeks.tomsk.su).
8245
8246 Sun Nov 16 22:12:39 1997  Arnold D. Robbins  <arnold@skeeve.com>
8247
8248         * array.c (in_array, assoc_lookup): Add symbol->vname to
8249           fatal calls for scalar in array context.
8250
8251 Wed Nov 12 22:18:33 1997  Arnold D. Robbins  <arnold@skeeve.com>
8252
8253         * awk.h [ISASCII]: On all IS* macros, add cast to unsigned char.
8254           [TOUPPER, TOLOWER]: New macros using unsigned char.
8255         * awk.y: Change to use of IS* vs. is* macros.
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
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.
8262         * eval.c (fmt_ok): Change to use of IS* vs. is* macros.
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.
8266         * io.c (get_a_record): Change to use of IS* vs. is* macros,
8267           change casts for casetable[] from int to unsigned char.
8268         * main.c (main): Change to use of IS* vs. is* macros.
8269         * node.c (r_force_number, parse_escape): Change to use of IS* vs.
8270           is* macros.
8271         * re.c (make_regexp): Change to use of IS* vs. is* macros.
8272         * regex.c [ISASCII]: On all IS* macros, add cast to unsigned char.
8273
8274 Sun Oct 19 12:36:47 1997  Arnold D. Robbins  <arnold@skeeve.com>
8275
8276         * ALL: Change email address to arnold@gnu.org in all relevant places.
8277
8278 Wed Oct 15 03:38:12 1997  Arnold D. Robbins  <arnold@skeeve.com>
8279
8280         * awk.y (yylex): Don't allow newlines after ? or : if do_posix.
8281
8282 Thu Oct  9 19:28:39 1997  Arnold D. Robbins  <arnold@skeeve.com>
8283
8284         * custom.h [SEQUENT]: Removed; not needed any more since the
8285           mmap code was ripped out.
8286
8287 Wed Oct  8 17:22:03 1997  Arnold D. Robbins  <arnold@skeeve.com>
8288
8289         * configure.in: Remove check for madvise; don't need it any more
8290           after nuking use of mmap.
8291
8292 Tue Oct  7 11:14:21 1997  Arnold D. Robbins  <arnold@skeeve.com>
8293
8294         * eval.c (flags2str): Made the code table driven. Shortened a lot.
8295
8296 Tue Sep 30 20:59:17 1997  Arnold D. Robbins  <arnold@skeeve.com>
8297
8298         * eval.c (r_get_lhs): case Node_field_spec.  Add lint warnings
8299           for field reference of null string or non-numeric value.
8300           Based on patch submitted by Alan Broder, ajb@dtmr.com.
8301
8302 Wed Sep 24 20:47:59 1997  Arnold D. Robbins  <arnold@skeeve.com>
8303
8304         * custom.h [TANDEM]: New changes. Finishes up Tandem
8305           integration.
8306
8307 Mon Sep 22 00:42:34 1997  Arnold D. Robbins  <arnold@skeeve.com>
8308
8309         * custom.h [__be_os]: Remove BROKEN_TOKEN definition.
8310         * dfa.c, dfa.h: Change `token' to `dfa_token' to avoid BeOS
8311           compile problems.
8312
8313 Thu Aug  7 22:35:17 1997  Arnold D. Robbins  <arnold@skeeve.com>
8314
8315         Changes for BeOS from mc@whoever.com
8316
8317         * awk.h (strncasecmp): Bracket prototype.
8318           custom.h [__be_os]: New stuff.
8319           dfa.h, dfa.c [BROKEN_TOK]: New ifdefs to use dfa_token, not token.
8320
8321 Fri Aug  1 13:32:49 1997  Arnold D. Robbins  <arnold@skeeve.com>
8322
8323         Tandem changes:
8324
8325         * awk.h [TANDEM]: Misc additions, as needed.
8326         * io.c (get_a_record): Changes for fixed length records; not used
8327           on other systems.
8328         * main.c (MRL): New variable, TANDEM specific.
8329           (main): Update handling -mr option for TANDEM.
8330           (load_environ): Comment out whole routine if TANDEM.
8331           missing.c [TANDEM]: New includes.
8332           gawkmisc.c [TANDEM]: Include `tmiscc'.
8333
8334 Wed Jul 30 19:53:52 1997  Arnold D. Robbins  <arnold@skeeve.com>
8335
8336         Close-on-exec changes:
8337
8338         * awk.h: (os_close_on_exec, os_isdir): New functions.
8339         * gawkmisc.c: Add include fcntl.h.
8340         * configure.in [AC_CHECK_HEADERS]: Add fcntl.h.
8341         * io.c (devopen, iop_open): Change to use os_isdir(), not S_IFDIR().
8342           (redirect, devopen, iop_open, gawk_popen): Change all calls to
8343           fcntl() to os_close_on_exec().
8344
8345 Tue Jul 29 11:09:45 1997  Arnold D. Robbins  <arnold@skeeve.com>
8346
8347         * eval.c (set_BINMODE): Fixed check for digits to use isdigit()
8348           instead of looping over digits and using strchr(). Duh.
8349
8350 Sat Jul 26 22:52:08 1997  Arnold D. Robbins  <arnold@skeeve.com>
8351
8352         * eval.c (set_BINMODE): Fix so that `-v BINMODE=w' works.
8353         * node.c (r_force_number): Add decl of strtod(); makes things
8354           work on MIPS.
8355         * Makefile.in (install-strip): New target.
8356
8357 Fri Jul 18 13:28:05 1997  Arnold D. Robbins  <arnold@skeeve.com>
8358
8359         * io.c (redirect, devopen, iop_open, gawk_popen): Set the
8360           close-on-exec flag on all files and pipes opened for I/O.
8361           Keeps children run via system() or other pipes from running out
8362           of file descriptors.
8363
8364           (Reported by Kenny McCormack, gazelle@yin.interaccess.com.)
8365
8366 Tue Jul  8 22:18:00 1997  Arnold D. Robbins  <arnold@skeeve.com>
8367
8368         * awk.y [LEX_NEXT]: Removed support for `next file' as two words.
8369
8370 Tue Jul  8 06:46:32 1997  Arnold D. Robbins  <arnold@skeeve.com>
8371
8372         * dfa.c: Changes from pjr@jet.UK (Paul J Rippin) from an old
8373           bug report against 2.14.0 that speed up initialization and
8374           rewrite the inner loop into readable code.
8375
8376 Thu Jul  3 11:44:50 1997  Arnold D. Robbins  <arnold@skeeve.com>
8377
8378         * Atari support moved into new `unsupported' directory.
8379           awk.h, Makefile.in, gawkmisc.c, and missing.c modified.
8380
8381 Sun Jun 29 14:17:37 1997  Arnold D. Robbins  <arnold@skeeve.com>
8382
8383         * awk.y (exp): Fixed warning about `x = /foo/'.
8384
8385 Wed Jun 25 09:07:57 1997  Arnold D. Robbins  <arnold@skeeve.com>
8386
8387         * PORTS: Removed from distribution.
8388         * Makefile.in (MISC): Removed PORTS.
8389
8390 Sun Jun 22 11:52:57 1997  Arnold D. Robbins  <arnold@skeeve.com>
8391
8392         BINMODE changes.
8393
8394         * awk.h (Node_BINMODE): Added.
8395           (struct redirect): Added mode field to save for io.c:close_one().
8396           (BINMODE, BINMODE_node, set_BINMODE): Add declarations.
8397         * awk.y (isnoeffect): Add Node_BINMODE.
8398         * eval.c (nodetypes): Add Node_BINMODE string.
8399           (r_tree_eval, r_get_lhs): Add cases for Node_BINMODE.
8400           (set_BINMODE): New function.
8401         * io.c (binmode): New function.
8402           (nextfile, redirect, gawk_popen): Add calls to binmode().
8403         * main.c (BINMODE, BINMODE_node): Add decls.
8404           (main): Add call to setmode() if BINMODE is set.
8405           (varinit): Add entry for BINMODE.
8406
8407 Wed Jun  4 21:52:25 1997  Arnold D. Robbins  <arnold@skeeve.com>
8408
8409         * configure.in [AC_FUNC_MMAP]: Removed call.
8410         * awk.h [struct iobuf]: Removed IOP_MMAPED flag and `getrec' member.
8411         * io.c: Removed all mmap related code.
8412
8413 Sun Apr 27 16:23:56 1997  Arnold D. Robbins  <arnold@skeeve.com>
8414
8415         * aclocal.m4 [GAWK_AC_FUNC_MKTIME]: New macro.
8416         * configure.in (GAWK_AC_FUNC_MKTIME): Call it.
8417
8418 Thu Apr 24 23:25:06 1997  Arnold D. Robbins  <arnold@skeeve.com>
8419
8420         * io.c (devopen): Remove stat test for /dev/foo files. Finally.
8421
8422 Fri Jul 26 09:23:15 1996  Arnold D. Robbins  <arnold@skeeve.com>
8423
8424         Changes to add an abort statement, a la tawk.
8425
8426         * awk.h (Node_K_abort): New enum value for NODETYPE.
8427         * main.c (aborting): New flag variable.
8428           (main): Add logic to handle aborting.
8429         * eval.c (interpret): Add case for Node_K_abort.
8430         * io.c (do_input): If aborting, break loop.
8431         * awk.y (tokentab): Add entry for "abort" keyword
8432           (PRODUCTIONS): Add production for LEX_ABORT.
8433
8434 Wed Jul 24 12:49:52 1996  Arnold D. Robbins  <arnold@skeeve.com>
8435
8436         First cut at changes for i18n.
8437
8438         * awk.h (do_intl): Declare new flag variable.
8439           [INTLSTR]: New flag def.
8440           (m_tree_eval): Fix definitions for INTLSTR.
8441           (force_string): Fix definitions for INTLSTR.
8442         * awk.y (yylex): Add _"..." for international strings.
8443           (dumpintlstr): New function.
8444         * main.c (do_intl): Define new flag variable.
8445           (optab): Add "gen-po" entry.
8446           (main): If do_intl, exit, don't run the program.
8447           (gawkoption): Add "gen-po" entry.
8448         * node.c (r_force_string): Call gettext if flags indicate INTLSTR.
8449
8450 Thu Mar 14 06:29:42 1996  Arnold D. Robbins  <arnold@skeeve.com>
8451
8452         * awk.h (do_mktime): Added declaration of new function.
8453         * builtin.c (do_mktime): New function.
8454         * awk.y (tokentab): Added "mktime" to list of gawk extensions.
8455         * missing.c [HAVE_MKTIME]: Added include of mktime.c if needed.
8456
8457 Mon Feb 26 22:32:19 1996  Arnold D. Robbins  <arnold@skeeve.com>
8458
8459         * io.c (pidopen, useropen): Added warnings to use PROCINFO[],
8460           not special files.
8461         * main.c (load_procinfo): New function.
8462         * awk.y (variable): Added call to load_procinfo() function.
8463
8464 Mon Aug  7 15:23:00 2000  Arnold D. Robbins  <arnold@skeeve.com>
8465
8466         * Release 3.0.6: Release tar file made.
8467
8468 Thu Aug  3 17:47:53 2000  Greg McGary  <greg@mcgary.org>
8469
8470         * regex.c: Patches for gcc bounded pointer handling.
8471
8472 Thu Aug  3 13:09:09 2000  Arnold D. Robbins  <arnold@skeeve.com>
8473
8474         * array.c (in_array, do_delete): Fix tests for index equality
8475           when searching through the array to work correctly when
8476           index is "".
8477
8478 Fri Jul 14 21:40:17 2000  Pat Rankin  <rankin@eql.caltech.edu>
8479
8480         * builtin.c (format_tree): Workaround a DEC C V5.7 bug by
8481           splitting `strcpy() + 3' into two expressions (the builtin
8482           inline strcpy evidently has erroneous return type of void *
8483           instead of char *; reputedly fixed in V6.1).
8484
8485         * eval.c (C): New macro.
8486           [casetable]: Use it to add explicit casts for the character
8487           values outside the range of 0 to 127.
8488         * missing/strncasecmp.c [C, charmap]: Likewise.
8489
8490         * io.c (redirect): Add EIO check on failed open for VMS.
8491
8492 Fri Jul 14 11:57:23 2000  Arnold D. Robbins  <arnold@skeeve.com>
8493
8494         Efficiency hack: turn `for (iggy in foo) delete foo[iggy]'
8495         into moral equivalent of `delete foo'.
8496
8497         * array.c (do_delete_loop): New routine.
8498         * awk.h [NODETYPE]: New Node_K_delete_loop value.
8499           Add declaration of do_delete_loop.
8500         * awk.y [LEX_FOR]: Fix code to recognize special case.
8501         * eval.c (nodetypes): New entry for Node_K_delete_loop.
8502         (interpret): Add case for Node_K_delete_loop, add more
8503         diagnostic info in default (cant_happen) case.
8504
8505 Tue Jul 11 22:15:10 2000  Pat Rankin  <rankin@eql.caltech.edu>
8506
8507         * awk.y (nextc): Recast unsigned char values back to int to
8508           prevent VAX C from truncating EOF to 255.
8509
8510 Tue Jul 11 14:08:23 2000  Arnold D. Robbins  <arnold@skeeve.com>
8511
8512         * array.c (do_delete): Switch to string comparison, not
8513           cmp_nodes.
8514           (assoc_find): Add call to force_string on subscript.
8515         * eval.c (interpret): Case Node_K_arrayfor: check for
8516           Node_array_ref and fetch original_array. Yowser.
8517
8518 Fri Jun 30 21:57:00 2000  Arnold D. Robbins  <arnold@skeeve.com>
8519
8520         * array.c (assoc_lookup): Don't force the subscript
8521           to be a string.  Not a good idea after the change
8522           to using dupnode.
8523
8524 Sun Jun 25 15:08:19 2000  Arnold D. Robbins  <arnold@skeeve.com>
8525
8526         * Release 3.0.5: Release tar file made.
8527
8528 Wed Jun 14 13:03:45 2000  Arnold D. Robbins  <arnold@skeeve.com>
8529
8530         * field.c (set_record): Manage a private buffer for $0.
8531           Keeps things safe in case `getline var' rearranges the
8532           IOBUF's contents that $0 is still pointing into.
8533
8534 Tue Jun 13 16:27:55 2000  Paul Eggert  <eggert@twinsun.com>
8535
8536         Upgrade to latest and greatest version of largefile code.
8537
8538         * configure.in (AC_CANONICAL_HOST): Remove.
8539         (GAWK_AC_SYS_LARGEFILE): Defer until after AC_MINIX,
8540         to avoid autoconf warnings.
8541
8542         Rewrite largefile configuration so that we don't need to run
8543         getconf and don't need AC_CANONICAL_HOST.
8544         * config.guess, config.sub: Remove these files.    
8545         * Makefile.in (MISC): Remove config.guess, config.sub.
8546         * m4/largefile.m4 (GAWK_AC_SYS_LARGEFILE_FLAGS,
8547         GAWK_AC_SYS_LARGEFILE_SPACE_APPEND): Remove.
8548         (GAWK_AC_SYS_LARGEFILE_TEST_INCLUDES): New macro.
8549         (GAWK_AC_SYS_LARGEFILE_MACRO_VALUE): Change arguments from
8550         CODE-TO-SET-DEFAULT to VALUE, INCLUDES, FUNCTION-BODY.
8551         All uses changed.
8552         Instead of inspecting the output of getconf, try to compile the
8553         test program without and with the macro definition.
8554         (GAWK_AC_SYS_LARGEFILE): Do not require AC_CANONICAL_HOST or check
8555         for getconf.  Instead, check for the needed flags by compiling
8556         test programs.
8557
8558         (GAWK_AC_SYS_LARGEFILE): Define _XOPEN_SOURCE to be 500 to
8559         work around glibc 2.1.3 bug.
8560
8561         (GAWK_AC_SYS_LARGEFILE_FLAGS): Don't use -n32 on IRIX if the
8562         installer said otherwise.
8563
8564         (GAWK_AC_SYS_LARGEFILE_FLAGS): Work around a bug in the QNX shell,
8565         which doesn't propagate exit status of failed commands inside
8566         shell assignments.
8567
8568 Wed Jun  7 13:23:09 2000  Arnold D. Robbins  <arnold@skeeve.com>
8569
8570         * Updated copyright dates in appropriate files.
8571
8572 Mon May 22 17:29:43 2000  Arnold D. Robbins  <arnold@skeeve.com>
8573
8574         * Makefile.in (clean): Get `*/core' too.
8575
8576 Sun May  7 16:33:05 2000  Arnold D. Robbins  <arnold@skeeve.com>
8577
8578         * array.c (concat_exp): Change ref to `lnode->stlen' and
8579           `lnode->stptr' for SUBSEP to use `var_value->...'.
8580
8581 Tue May  2 09:54:29 2000  Arnold D. Robbins  <arnold@skeeve.com>
8582
8583         Fix referencing freed memory as shown by test/arynocls.* tests.
8584         * awk.h [Node_array_ref]: New node type.
8585           [orig_array]: New macro element in NODE structure.
8586         * field.c (do_split): Handle case for Node_array_ref, fetch
8587           the original array.
8588         * array.c (in_array, do_delete): Ditto.
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.
8596
8597 Tue May  2 09:52:12 2000  Bruno Haible  <haible@clisp.cons.org>
8598
8599         * io.c (redirect): After reopening a `struct redirect', move it to
8600           the head of the list.
8601
8602 Sun Apr  2 17:51:40 2000  Arnold D. Robbins  <arnold@skeeve.com>
8603
8604         * re.c (re_update): Check if IGNORECASE has changed, and
8605           if so recompute the re.  See test/igncdym.awk.
8606
8607 Mon Mar 20 16:18:34 2000  Arnold D. Robbins  <arnold@skeeve.com>
8608
8609         * io.c (set_RS): Added a lint warning about multicharacter RS,
8610           per suggestion from Akim DeMaille (akim@epita.fr).
8611
8612 Sun Feb 13 14:40:32 2000  Arnold D. Robbins  <arnold@skeeve.com>
8613
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.
8616
8617 Sun Feb  6 11:39:33 2000  Arnold D. Robbins  <arnold@skeeve.com>
8618
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.
8623
8624 Tue Feb  1 18:41:40 2000  Arnold D. Robbins  <arnold@skeeve.com>
8625
8626         * eval.c (op_assign): Reget the rval after regetting
8627           the left hand side.  See test/opasnslf.awk for why.
8628
8629 Thu Jan 27 18:06:31 2000  Arnold D. Robbins  <arnold@skeeve.com>
8630
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>.
8635
8636 Wed Dec 22 15:06:37 1999  Arnold D. Robbins  <arnold@skeeve.com>
8637
8638         * awk.y: Removed declarations of functions before
8639           definition of `tokentab[]'.  They're redundant with
8640           what's in awk.h.
8641
8642 Thu Dec  9 17:01:07 1999  Arnold D. Robbins  <arnold@skeeve.com>
8643
8644         * node.c (parse_escape): Add lint warning for unrecognized
8645           escape sequences.
8646
8647 Mon Dec  6 15:17:34 1999  Arnold D. Robbins  <arnold@skeeve.com>
8648
8649         * main.c (usage): Changed bug reporting email addresses to
8650           be a reference to `Bugs' node in the online and printed
8651           doc, instead.
8652
8653 Thu Dec  2 13:08:18 1999  Arnold D. Robbins  <arnold@skeeve.com>
8654
8655         * builtin.c (do_compl): Test `d' for negative inside the do_lint
8656           test, not uval.  Ooops.
8657
8658 Fri Nov 26 10:58:36 1999  Arnold D. Robbins  <arnold@skeeve.com>
8659
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!
8663
8664 Tue Nov 23 11:58:53 1999  Arnold D. Robbins  <arnold@skeeve.com>
8665
8666         * regex.c (SYNTAX): Cast argument to `unsigned char' instead of
8667           &-ing with 0xFF.  Hopefully somewhat more portable, ala 21 Nov 99
8668           changes to awk.y.
8669
8670 Sun Nov 21 22:25:27 1999  Paul Eggert  <eggert@twinsun.com>
8671
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.
8675
8676 Sun Nov 21 20:33:35 1999 Arnold D. Robbins  <arnold@skeeve.com>
8677
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.
8682
8683 Mon Nov  1 20:00:25 1999  Arnold D. Robbins  <arnold@skeeve.com>
8684
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.
8689
8690 Mon Oct 25 18:37:13 1999  Arnold D. Robbins  <arnold@skeeve.com>
8691
8692         * awk.h, main.c, io.c: Undo previous changes (22 Oct 1999).
8693         * main.c (main): Move call to `init_fields()' to before
8694           arg parsing.  This allows `-v NF=blah' to work ok.
8695
8696 Fri Oct 22 17:43:40 1999  Arnold D. Robbins  <arnold@skeeve.com>
8697
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.
8704
8705 Tue Oct 19 16:06:48 1999  Paul Eggert  <eggert@twinsun.com>
8706
8707         * io.c (close_redir): Don't munge errno between setting it and
8708           using it.
8709
8710 Wed Oct  6 17:47:47 1999  Arnold D. Robbins  <arnold@skeeve.com>
8711
8712         * main.c (arg_assign): Return NULL on bad variable.  Allows
8713           things like `./3x=stuff' to work as a filename.
8714
8715 Thu Sep 23 21:35:46 1999  Paul Eggert  <eggert@twinsun.com>
8716
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. :-)
8719
8720 Tue Sep 21 13:31:36 1999  Arnold D. Robbins  <arnold@skeeve.com>
8721
8722         * builtin.c (format_tree): For '0', only set zero_flag if we
8723           haven't seen the field width or precision yet.
8724
8725 Mon Aug  9 13:06:01 1999  Arnold D. Robbins  <arnold@skeeve.com>
8726
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
8730           cases.
8731         * configure.in: Check for $srcdir/.developing adds extra
8732           defines for my testing/debugging use.  Yes, hack alert.
8733
8734 Sun Aug  1 11:02:02 1999  Arnold D. Robbins  <arnold@skeeve.com>
8735
8736         * node.c (dupnode): Turn off FIELD when copying nodes.
8737         * array.c (do_adump, assoc_dump): New functions for array debugging.
8738         * awk.y (tokentab): Conditionally add "adump" function for debugging.
8739         * awk.h: Delcare new functions.
8740
8741 Thu Jul 29 23:26:40 1999  Arnold D. Robbins  <arnold@skeeve.com>
8742
8743         From wsanchez@apple.com:
8744         * Makefile.in (install-strip): New target, coding stds. compatibility.
8745         * config.guess, config.sub: Add MacOS X recognition.
8746
8747 Thu Jul 29 19:09:19 1999  Arnold D. Robbins  <arnold@skeeve.com>
8748
8749         * awk.y (func_install): Make `function foo(foo)' a fatal error.
8750           eval.c (r_tree_eval): Diagnose use of a function name as a
8751           variable inside the function.
8752
8753 Sun Jul  4 16:53:14 1999  Arnold D. Robbins  <arnold@skeeve.com>
8754
8755         * eval.c (eval_condition): Add extra braces to avoid
8756           gcc warning.  I'm not going to bother for the library
8757           code like dfa and regex.
8758
8759 Wed Jun 30 16:14:36 1999  Arnold D. Robbins  <arnold@gnu.org>
8760
8761         * Release 3.0.4: Release tar file made.  This time for sure.
8762
8763 Wed Jun 30 16:10:11 1999  Arnold D. Robbins  <arnold@gnu.org>
8764
8765         * awk.h: Add include of <assert.h>, and comment about config.h
8766           having to be included before any system headers.  Otherwise,
8767           with egcs-2.91.66 and later on Linux systems, and possibly
8768           others, things break badly, due to the LFS macros.
8769         * awk.y, builtin.c, eval.c, field.c, io.c: Removed include
8770           of assert.h
8771
8772 Wed Jun  9 11:39:19 1999  Paul Eggert  <eggert@twinsun.com>
8773
8774         Port the large-file code to AIX, HP-UX, and IRIX.
8775         Add cross-compilation support for large files.
8776
8777         * config.guess, config.sub: New files.
8778
8779         * configure.in (AC_CANONICAL_HOST):
8780           Add; GAWK_AC_SYS_LARGEFILE needs this.
8781           (GAWK_AC_SYS_LARGEFILE): Renamed from GAWK_AC_LARGE_FILES.
8782
8783         * aclocal.m4 (GAWK_AC_SYS_LARGEFILE): Renamed from GAWK_AC_LARGE_FILES.
8784           Add support for AIX and HP-UX.
8785           (GAWK_AC_SYS_LARGEFILE_FLAGS, GAWK_AC_SYS_LARGEFILE_SPACE_APPEND,
8786           GAWK_AC_SYS_LARGEFILE_MACRO_VALUE): New macros.
8787
8788         * acconfig.h (_FILE_OFFSET_BITS, _LARGEFILE_SOURCE, _LARGE_FILES):
8789           New macros.
8790
8791         * Makefile.in (MISC): Add config.guess and config.sub so they get
8792           included in the distribution.
8793
8794 Wed Jun  9 11:29:29 1999  Paul Eggert  <eggert@twinsun.com>
8795
8796         * io.c (iop_alloc): Don't mmap files whose sizes don't fit in `int'.
8797           [ This isn't really needed, as HAVE_MMAP is #undef'ed at the top,
8798           but it's there in case people want to take their life in their hands. ]
8799
8800 Sun Jun  6 11:28:07 1999  Arnold D. Robbins  <arnold@gnu.org>
8801
8802         * BETA Release 3.0.46: Release tar file made.
8803
8804 Wed Jun  2 14:36:24 1999  Arnold D. Robbins  <arnold@gnu.org>
8805
8806         * PORTS: Updated with a more recent list of systems
8807           that gawk compiles and tests ok on.
8808
8809 Tue Jun  1 14:24:59 1999  Arnold D. Robbins  <arnold@gnu.org>
8810
8811         * BETA Release 3.0.45: Release tar file made.
8812
8813 Tue May 25 16:32:37 1999  Arnold D. Robbins  <arnold@gnu.org>
8814
8815         * builtin.c (format_tree): More smarts for weird cases, such as
8816           zero precisions and zero values used with the `#' flag.
8817           Thanks to Andreas Schwab (schwab@gnu.org) for pointing these out.
8818
8819 Wed May 19 14:02:54 1999  Arnold D. Robbins  <arnold@gnu.org>
8820
8821         * io.c (do_close): Move test for `close(FILENAME)' to after
8822           loop through all open redirections. Fixes problems in obscure
8823           cases with redirections in END rules.
8824
8825 Sun May 16 14:08:39 1999  Arnold D. Robbins  <arnold@gnu.org>
8826
8827         * awk.y (yylex): Fix group of characters including ',' to
8828           set want_assign = FALSE.  Fixes bizarre parsing problems in
8829           function call lists, for example.
8830         * io.c (get_a_record): Repair logic for single-leading-newline
8831           case.
8832
8833 Tue May 11 16:48:11 1999  Arnold D. Robbins  <arnold@gnu.org>
8834
8835         * aclocal.m4 (GAWK_AC_AIX_TWEAK): New macro.
8836         * configure.in: Call it
8837         * Makefile.in: (awklib/all): Pass CFLAGS on to sub-make so
8838           that password programs will get AIX magic defines. Avoids
8839           having to tweak program code for those in doc/gawk.texi.
8840
8841 Mon May  3 16:56:23 1999  Arnold D. Robbins  <arnold@gnu.org>
8842
8843         * array.c (do_delete): Don't free_temp(subs) until after all
8844           references to it are finished.
8845
8846 Mon May  3 13:41:16 1999  Arnold D. Robbins  <arnold@gnu.org>
8847
8848         * BETA Release 3.0.44: Release tar file made.
8849
8850 Sun May  2 18:25:43 1999  Arnold D. Robbins  <arnold@gnu.org>
8851
8852         * io.c (get_a_record): Do a really good job of stripping newlines
8853           from the front of records when RS = "" and there's only one
8854           newline at the front of the file, which the regex didn't catch.
8855
8856 Wed Apr 28 12:27:49 1999  Arnold D. Robbins  <arnold@gnu.org>
8857
8858         * configure.in: More HP stuff: fix the manual alloca code so that
8859           gawk will compile and link on HP systems. See the comments.
8860
8861 Sun Apr 25 13:39:16 1999  Arnold D. Robbins  <arnold@gnu.org>
8862
8863         * Makefile.in (gawk): Add $(CFLAGS) to linking step.
8864         * configure.in: Correctly do AC_FUNC_GETPGRP on HP systems too.
8865
8866 Tue Apr 13 20:21:00 1999  Arnold D. Robbins  <arnold@gnu.org>
8867
8868         * BETA Release 3.0.43: Release tar file made.
8869
8870 Tue Apr 13 19:02:20 1999  Arnold D. Robbins  <arnold@gnu.org>
8871
8872         * io.c (useropen, pidopen): Add casts to int on arguments to
8873           silence gcc warnings.
8874         * regex.c (regcomp,regexec,regfree): Add ifdef for APPLE.
8875
8876 Thu Feb  4 10:38:02 1999  Arnold D. Robbins  <arnold@gnu.org>
8877
8878         * custom.h: Hacks for BeOS. Not documented in the manual right now.
8879         * configure.in: Hacks for BeOS.  Check for HP-UX and define C_ALLOCA
8880           if not using gcc.  I wish they'd just fix bison already.
8881
8882 Sun Dec 20 16:57:38 1998  Arnold D. Robbins  <arnold@gnu.org>
8883
8884         * BETA Release 3.0.42: Release tar file made.
8885
8886 Sun Nov 15 21:05:39 1998  Arnold D. Robbins  <arnold@gnu.org>
8887
8888         * io.c (gawk_popen): Add WIN32 to list of systems that use
8889           the non-real-pipe version. From the PC gawk guys.
8890
8891 Wed Nov  4 11:32:24 1998  Arnold D. Robbins  <arnold@gnu.org>
8892
8893         * BETA Release 3.0.41: Release tar file made.
8894
8895 Tue Nov  3 16:24:35 1998  Arnold D. Robbins  <arnold@gnu.org>
8896
8897         * eval.c (r_get_lhs): Fix the cases for the special variables,
8898           don't unref their current value if it's the same as the internal
8899           copy; perhaps the current one is used in a concatenation or some
8900           other expression somewhere higher up in the call chain.  Ouch.
8901           See test/getnr2tm.awk.
8902
8903 Sun Nov  1 15:24:52 1998  Arnold D. Robbins  <arnold@gnu.org>
8904
8905         * builtin.c (format_tree): Improve handling of zero-fill
8906           when a precision is present. See test/zeroflag.awk.
8907
8908 Wed Oct 28 20:40:17 1998  Arnold D. Robbins  <arnold@gnu.org>
8909
8910         * eval.c (r_tree_eval): Case for Node_concat. Get lengths
8911           separately, in case one expression has a side effect that
8912           that changes another. Ugly, but it keeps gawk from core
8913           dumping. See test/nasty.awk.
8914
8915 Sun Oct 18 21:27:24 1998  Arnold D. Robbins  <arnold@gnu.org>
8916
8917         * awk.y (append_right): Bug fix, if `list' or `new' are NULL,
8918           return `list', so that things don't break too badly.
8919         * regex.c (re_compile_fastmap): Remove unused variable `num_regs'.
8920
8921 Thu Oct  8 19:36:57 1998  Arnold D. Robbins  <arnold@gnu.org>
8922
8923         * BETA Release 3.0.40: Release tar file made.
8924
8925 Mon Jul 27 10:14:33 1998  Arnold D. Robbins  <arnold@gnu.org>
8926
8927         * node.c (parse_escape): Remove assignment with side effects
8928           from ISXDIGIT test. Thanks to "Mihai T. LAZARESCU"
8929           <mihai@ccmserv.polito.it> for pointing this out.
8930
8931 Mon Apr 27 11:31:32 1998  Arnold D. Robbins  <arnold@gnu.org>
8932
8933         * main.c (usage): Fix the email address for the bug list.
8934           (copyleft): Update the copyright year.
8935
8936 Mon Mar 23 21:22:32 1998  Arnold D. Robbins  <arnold@gnu.org>
8937
8938         * eval.c (r_get_lhs): Make sure that values of type
8939           Node_param_list don't have the FUNC flag set. This means
8940           we don't allow the use of a function name as a variable or
8941           array from within the function.
8942
8943 Sun Mar 22 19:12:32 1998  Paul Eggert  <eggert@twinsun.com>
8944
8945         * aclocal.m4 (GAWK_AC_LARGE_FILES): New macro that checks for
8946           large file support, and updates CPPFLAGS, LDFLAGS, LIBS as
8947           needed.
8948         * configure.in: Call GAWK_AC_LARGE_FILES.
8949         * Makefile.in (CPPFLAGS, LDFLAGS): Let autoconf configure.
8950         (COMPFLAGS): Add $(CPPFLAGS).
8951
8952 Mon Mar 16 14:06:41 1998  Arnold D. Robbins  <arnold@gnu.org>
8953
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.
8959
8960 Sun Nov 16 20:08:59 1997  Arnold D. Robbins  <arnold@gnu.org>
8961
8962         * builtin.c (sub_common): Fix for count of matches in gsub
8963           from Geert.Debyser@esat.kuleuven.ac.be.
8964
8965 Wed Oct 15 03:38:12 1997  Arnold D. Robbins  <arnold@gnu.org>
8966
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).
8972
8973 Sun Oct  5 11:56:52 1997  Arnold D. Robbins  <arnold@gnu.org>
8974
8975         * configure.in: If ISC add -D_SYSV3 to CFLAGS, per email from
8976           Mario Vanoni (vanonim@dial.eunet.ch).
8977
8978 Fri Sep 26 00:57:49 1997  Arnold D. Robbins  <arnold@gnu.org>
8979
8980         * awk.y (append_right): Return if either list is NULL. Prevents
8981           syntax errors from causing core dumps.
8982
8983 Wed Sep 17 15:34:15 1997  Arnold D. Robbins  <arnold@gnu.org>
8984
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.
8989
8990 Mon Sep 15 16:12:55 1997  Arnold D. Robbins  <arnold@gnu.org>
8991
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.
8995
8996 Sun Sep 14 19:55:12 1997  Arnold D. Robbins  <arnold@gnu.org>
8997
8998         * node.c (format_val): Always format values ourselves: avoids
8999           problems if OFMT is bizarre, like %s.
9000
9001 Sun Sep 14 00:08:53 1997  Arnold D. Robbins  <arnold@gnu.org>
9002
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!
9007
9008 Sun Aug 17 07:15:12 1997  Arnold D. Robbins  <arnold@gnu.org>
9009
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.
9012
9013 Wed Aug  6 21:04:37 1997  Arnold D. Robbins  <arnold@gnu.org>
9014
9015         * io.c (VMS et al gawk_popen): Use pclose, not fclose, if
9016           iop_alloc fails.
9017
9018 Wed Jul 30 19:53:52 1997  Arnold D. Robbins  <arnold@gnu.org>
9019
9020         * awk.y [variable]: Fix case for subscript if $3 == NULL.
9021
9022 Sun Jul 27 22:47:30 1997  Arnold D. Robbins  <arnold@gnu.org>
9023
9024         * awk.y (get_src_buf): Don't close file if it's stdin.
9025
9026 Sun Jul 27 22:47:15 1997  Pat Rankin  <rankin@eql.caltech.edu>
9027
9028         * io.c (#if VMS: vmsrtl_fileno): New routine.
9029           (#if VMS: fileno): New macro substituted for stdio one.
9030
9031 Thu Jul 17 20:05:59 1997  Arnold D. Robbins  <arnold@gnu.org>
9032
9033         * builtin.c (do_print): When OFMT != CONVFMT, create a new
9034           temporary node with just the numeric value valid and format it,
9035           and use that for printing. Avoids memory corruption.
9036
9037 Wed Jul 16 10:01:16 1997  Arnold D. Robbins  <arnold@gnu.org>
9038
9039         * regex.c: When SYNTAX_TABLE is defined, but not emacs, then
9040           CHAR_SET_SIZE is not defined, though used in regcomp.  It should
9041           be taken out of #ifdef SYNTAX_TABLE. Fix from bug group, from
9042           Akim Demaille, demaille@inf.enst.fr.
9043         * awk.h (isnondecimal): Make test a little smarter.
9044         * builtin.c (nondec2awknum): Add bailout for decimal numbers, e.g.
9045           `00.1'. Fix from Larry Schwimmer <rosebud@cyclone.Stanford.EDU>.
9046
9047 Thu Jun 19 19:00:40 1997  Arnold D. Robbins  <arnold@gnu.org>
9048
9049         * eval.c (interpret): case Node_K_next, Node_K_nextfile: fatal
9050           error if called from BEGIN or END.
9051           (Fixed completely Mon May  3 13:31:42 1999.)
9052
9053 Mon Jun  9 22:40:04 1997  Arnold D. Robbins  <arnold@gnu.org>
9054
9055         * builtin.c (nondec2awknum): Allow `f' and `F' in hexadecimal numbers.
9056           Gotta get more sleep...
9057         * array.c (assoc_lookup): Fix from Tom Karzes (karzes@equator.com)
9058           for memory leak when forcing type to Node_var_array.
9059
9060 Thu May 15 12:49:08 1997  Arnold D. Robbins  <arnold@skeeve.atl.ga.us>
9061
9062         * Release 3.0.3: Release tar file made.
9063
9064 Wed May 14 08:06:08 1997  Arnold D. Robbins  <arnold@skeeve.atl.ga.us>
9065
9066         * io.c (do_close): Add lint warning if closing something that
9067           isn't open.
9068
9069 Tue May 13 12:14:12 1997  Arnold D. Robbins  <arnold@skeeve.atl.ga.us>
9070
9071         * random.c, builtin.c: Remove __GLIBC__ tests, since it breaks
9072           `make test'. I prefer consistency across platforms.
9073         * Makefile.in (gawk): Undid April 25 changes and added comment.
9074           Putting COMPLAGS in breaks with -g on VMS POSIX.
9075
9076 Sun May 11 14:48:04 1997  Darrell Hankerson  <hankedr@mail.auburn.edu>
9077
9078         * io.c [MSC_VER]: Add cases for WIN32.
9079         * regex.c [MSC_VER]: Add cases for WIN32.
9080
9081 Sun May 11 07:04:01 1997  Arnold D. Robbins  <arnold@skeeve.atl.ga.us>
9082
9083         * builtin.c (do_print): In the loop that evaluates each expression
9084           to be printed, do a dupnode to avoid bizarre output. Thanks to
9085           Michal for finding this problem.
9086         * awk.y (yylex): Fix scanning of hexadecimal constants.
9087
9088 Wed May  7 15:09:25 1997  Arnold D. Robbins  <arnold@skeeve.atl.ga.us>
9089
9090         * io.c (get_a_record): Fix casetable indexing with cast to int.
9091           Keeps Michal happy.
9092
9093 Tue May  6 16:40:19 1997  Arnold D. Robbins  <arnold@skeeve.atl.ga.us>
9094
9095         * eval.c (func_call): Removed unneeded variables.
9096
9097 Mon May  5 21:17:37 1997  Pat Rankin  <rankin@eql.caltech.edu>
9098
9099         * missing/strftime.c [case 'v', VMS_EXT]: For VMS date format, two
9100           digit day of month should not be zero padded on the 1st through
9101           the 9th.
9102
9103 Mon May  5 06:33:47 1997  Arnold D. Robbins  <arnold@skeeve.atl.ga.us>
9104
9105         * regex.h, regex.c: Merge with current GLIBC version.
9106
9107 Mon May  5 06:33:47 1997  Pat Rankin  <rankin@eql.caltech.edu>
9108
9109         * io.c (nextfile): Move the check for null return from iop_open
9110           in the normal case and add one for the "no args" case.
9111
9112 Fri Apr 25 16:52:33 1997  Arnold D. Robbins  <arnold@skeeve.atl.ga.us>
9113
9114         * array.c (grow_table): Add a bunch more large primes so arrays
9115           can get really big. Thanks to christos@deshaw.com.
9116         * all files: Remove ifdef'ed out code and update copyrights.
9117         * Makefile.in (gawk): Add $(COMPFLAGS) to command line.
9118         * eval.c (flags2str): Added case for FIELD.
9119
9120 Thu Apr 24 22:39:23 1997  Arnold D. Robbins  <arnold@skeeve.atl.ga.us>
9121
9122         * COPYING: Changed to current official version from FSF.
9123         * regex.c: Merge with GLIBC version.
9124         * awk.h [_GNU_SOURCE]: Bracket definition inside ifdef.
9125           (NODE.source_line): Move name member out of `x' union and
9126           into `nodep'; avoids problems doing diagnostics.
9127           (nondec2num): Put decl into #if BITOPS || NONDECDATA
9128         * posix/gawkmisc.c, missing/system.c, missing/strtod.c,
9129           missing/strerror.c: Move to generic GPL statement at top.
9130         * builtin.c (nondec2num): Put into #if BITOPS || NONDECDATA
9131
9132 Wed Apr 23 22:14:14 1997  Arnold D. Robbins  <arnold@skeeve.atl.ga.us>
9133
9134         * dfa.c: Misc changes for really pedantic SGI compilers.
9135         * builtin.c: Bracket defs of random() etc for GLIBC.
9136         * random.c: Bracket whole file for GLIBC.
9137         * configure.in: Extra goop for GETPGRP test for VMS POSIX.
9138         * custom.h [VMS]: Remove hard definition of GETPGRP_VOID.
9139
9140 Fri Apr 18 07:55:47 1997  Arnold D. Robbins  <arnold@skeeve.atl.ga.us>
9141
9142         * BETA Release 3.0.34: Release tar file made.
9143
9144 Tue Apr 15 21:35:45 1997  Arnold D. Robbins  <arnold@skeeve.atl.ga.us>
9145
9146         NEW UNDOCUMENTED FEATURE. USE THE SOURCE LUKE!
9147         * acconfig.h [NONDECDATA]: New macro.
9148         * awk.h: Add decl of do_strtonum.
9149         * awk.y (tokentab): Add entry for strtonum function.
9150         * builtin.c (do_strtonum): New function.
9151         * configure.in (non-decimal-data): New --enable-* option.
9152         * node.c (r_force_number): Change to allow non-decimal data inside
9153           ifdef NONDECDATA.
9154
9155 Tue Apr 15 06:32:50 1997  Pat Rankin  <rankin@eql.caltech.edu>
9156
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.
9160         * awk.h (freenode, tree_eval, m_tree_eval): Reorganize definitions.
9161         * alloca.c (malloc): If malloc is already defined as a macro,
9162           presumeably by config.h, don't define or declare it.
9163
9164 Wed Apr  9 22:45:27 1997  Arnold D. Robbins  <arnold@skeeve.atl.ga.us>
9165
9166         * Makefile.in [COMPFLAGS]: Per suggestion from Karl Berry, put
9167           $(CFLAGS) last.
9168
9169 Tue Apr  8 23:54:46 1997  Arnold D. Robbins  <arnold@skeeve.atl.ga.us>
9170
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.
9174
9175 Mon Apr  7 18:22:37 1997  Arnold D. Robbins  <arnold@skeeve.atl.ga.us>
9176
9177         * awk.h: Add decls of new routines do_compl() and set_loc().
9178         * awk.y (tokentab): Add entry for "compl" function.
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.
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.
9184         * main.c (catch_sig): Add call to set_loc().
9185         * msg.c (set_loc, srcfile, srcline): New function and private
9186           variables to help out in tracing down source of error messages.
9187
9188 Fri Mar 28 08:42:27 1997  Arnold D. Robbins  <arnold@skeeve.atl.ga.us>
9189
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.
9194
9195 Thu Mar 27 08:48:57 1997  Arnold D. Robbins  <arnold@skeeve.atl.ga.us>
9196
9197         * custom.h [_SEQUENT_]: Undef HAVE_MMAP.
9198
9199 Wed Mar 26 09:08:16 1997  Arnold D. Robbins  <arnold@skeeve.atl.ga.us>
9200
9201         * io.c (iop_alloc): Fix definition to make it static.
9202
9203 Mon Mar 24 23:09:07 1997  Arnold D. Robbins  <arnold@skeeve.atl.ga.us>
9204
9205         * field.c (init_fields, etc..): More clean up use of Null_field
9206           and the various flags.
9207         * node.c (unref): If a field, free the node itself. Fixes
9208           memory leak problems.
9209
9210 Sun Mar 23 22:51:09 1997  Arnold D. Robbins  <arnold@skeeve.atl.ga.us>
9211
9212         * awk.h [FIELD]: New flag for node->flags field.
9213         * builtin.c (sub_common): If FIELD is set, dup the string.
9214         * field.c (init_fields): Set up a new Null_field global var.
9215           (init_fields, set_field, set_record) use the FIELD flag.
9216           (getfield): Use Null_field instead of private variable.
9217         * io.c (wait_any): Comment out calls to pclose and iop_close,
9218           caused weird race conditions. See test/pipeio1.awk. Thanks
9219           to Darrell Hankerson for tracing this one down.
9220
9221 Tue Mar 18 20:57:18 1997  Arnold D. Robbins  <arnold@skeeve.atl.ga.us>
9222
9223         * dfa.c (inboth): Free templist; plugs memory leak.
9224         * field.c (init_fields, grow_fields_arr, set_field, rebuild_record,
9225           set_record): Remove PERM flag from entries in fields_arr[]. Fixes
9226           nasty memory leak.
9227
9228 Tue Mar 18 06:33:00 1997  Arnold D. Robbins  <arnold@skeeve.atl.ga.us>
9229
9230         * awk.y (dup_parms): Robustified against parameter errors.
9231
9232 Sun Mar 16 21:31:40 1997  Arnold D. Robbins  <arnold@skeeve.atl.ga.us>
9233
9234         NEW UNDOCUMENTED FEATURE. USE THE SOURCE LUKE!
9235         * acconfig.h [BITOPS]: New macro. If set, do octal & hex and bit ops.
9236         * awk.h [isnondecimal]: New macro, and decl of new functions.
9237         * awk.y (yylex): Add recognition of octal and hex constants.
9238         * builtin.c (do_and, do_or, do_xor, do_lshift, do_rshift): New
9239           functions that do bit operations.
9240           (nondec2awknum): New function to convert octal or hex to double.
9241         * configure.in: Add AC_ARG_ENABLE for bit operations.
9242         * node.c (r_force_number): Add octal and hex conversion.
9243
9244 Sun Mar 16 21:28:56 1997  Arnold D. Robbins  <arnold@skeeve.atl.ga.us>
9245
9246         * awk.h [IOP_NOFREE_OBJ]: New macro.
9247         * io.c (iop_open, iop_alloc): Add new third parameter, which is
9248           either NULL, meaning allocate a new IOP, or the address of one
9249           already allocated.  Have a static one in the `nextfile'
9250           routine, and use the IOP_NOFREE_OBJ flag for it.  All of this
9251           keeps us from reading freed memory. The `swaplns' test fails
9252           otherwise.
9253           (iop_close): If IOP_NOFREE_OBJ is set, don't free the IOBUF.
9254
9255 Wed Feb 26 06:21:02 1997  Arnold D. Robbins  <arnold@skeeve.atl.ga.us>
9256
9257         * eval.c (in_function, pop_fcall_stack, pop_fcall, push_args):
9258           New functions. These manage "frames" of awk function call arguments.
9259           The problem is that a `next' or a `nextfile' from a function
9260           leaks memory. These changes allow us to free up that memory.
9261           (interpret): for Node_K_next and Node_K_nextfile, check if in
9262           a function call and free all function call frames.
9263
9264 Fri Feb 21 06:23:19 1997  Arnold D. Robbins  <arnold@skeeve.atl.ga.us>
9265
9266         Misc changes from Katsuyuki Okabe <HGC02147@niftyserve.or.jp>:
9267
9268         * builtin.c (do_substr): Change a %d to %ld in warning message.
9269         * eval.c (op_assign): Fix format string for warning about %=.
9270
9271 Wed Feb 19 23:29:02 1997  Arnold D. Robbins  <arnold@skeeve.atl.ga.us>
9272
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.
9276
9277 Fri Feb 14 09:47:31 1997  Arnold D. Robbins  <arnold@skeeve.atl.ga.us>
9278
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.
9283
9284 Tue Feb 11 06:28:29 1997  Arnold D. Robbins  <arnold@skeeve.atl.ga.us>
9285
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.
9290
9291 Wed Feb  5 17:59:04 1997  Arnold D. Robbins  <arnold@skeeve.atl.ga.us>
9292
9293         * eval.c (interpret): For Node_K_delete, just call do_delete; let
9294           it handle the case of `delete array'.
9295         * array.c (do_delete): Changed to handle case of `delete array',
9296           and made smarter if the array is actually an uninitialized
9297           parameter.
9298
9299 Sun Jan 26 22:58:29 1997  Arnold D. Robbins  <arnold@skeeve.atl.ga.us>
9300
9301         * getopt.h, getopt.c, getopt1.c: Replaced with new versions from
9302           GLIBC 2.
9303
9304 Sun Jan 19 23:37:03 1997  Arnold D. Robbins  <arnold@skeeve.atl.ga.us>
9305
9306         * eval.c (nodetype2str): Not static, for debugging.
9307           (flags2str): New function for debugging.
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.
9311         * array.c (in_array): Always evaluate subscript, could have
9312           side effects.
9313         * builtin.c (do_strftime): Way increase size of buffer to make sure
9314           we don't have overflow problem. Keeps Paul Eggert happy.
9315         * custom.h [__amigaos__]: Define fork to vfork. From Fred Fish.
9316         * dfa.c: Move include of config.h to top, for RSXNT. From Kai
9317           Uwe Rommel.
9318           (ISALPHA, etc): Change from Jacob Engelbrecht (jaen@novo.dk)
9319           to better handle non-ASCII environments.
9320         * gawkmisc.c: Remove amigados case, posix should now work fine.
9321         * amiga/*: Nuked per previous entry.
9322         * Makefile.in: Removed all references to amiga
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).
9328         * node.c (more_nodes): Fix to get the last entry in the array.
9329
9330 Wed Jan  8 17:42:37 1997  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>
9331
9332         * io.c (mmap_get_record): Fix return value if file ends without
9333           record separator.
9334
9335 Fri Jan  3 19:57:16 1997  Pat Rankin  <rankin@eql.caltech.edu>
9336
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
9339           stat().
9340
9341 Wed Dec 25 11:25:22 1996  Arnold D. Robbins  <arnold@skeeve.atl.ga.us>
9342
9343         * Release 3.0.2: Release tar file made.
9344
9345 Wed Dec 25 11:17:32 1996  Arnold D. Robbins  <arnold@skeeve.atl.ga.us>
9346
9347         * Makefile.in (install, uninstall): Use $(srcdir)/patchlevel.h.
9348           Thanks to Richard Levitte, LeViMS@stacken.kth.se.
9349           (install): Remove chmod command; let $(INSTALL_PROGRAM) use -m.
9350
9351 Mon Dec 23 20:36:59 1996  Pat Rankin  <rankin@eql.caltech.edu>
9352
9353         * custom.h (#if VMS_POSIX):  Define GETPGRP_VOID.
9354
9355 Fri Dec 20 08:59:55 1996  Arnold D. Robbins  <arnold@skeeve.atl.ga.us>
9356
9357         * getopt.c, getopt1.c: Comment out the `#if defined (_LIBC) ||
9358           !defined (__GNU_LIBRARY__)' and `#endif' to force use of this
9359           getopt, even on systems like Linux.  This will be handled
9360           better in 3.1 / glibc 2.
9361
9362 Thu Dec 19 22:52:39 1996  Arnold D. Robbins  <arnold@skeeve.atl.ga.us>
9363
9364         * awk.y (yylex): In several places, after yyerror(), add call to
9365           exit(). Otherwise, infinite messages. This should probably
9366           be handled better.
9367
9368 Wed Dec 18 22:42:10 1996  Darrel Hankerson  <hankedr@mail.auburn.edu>
9369
9370         * getopt.c (_getopt_internal): If 'W' and ';', if optind == argc,
9371           return c, don't fall through.
9372
9373 Wed Dec 18 10:09:44 1996  Arnold D. Robbins  <arnold@skeeve.atl.ga.us>
9374
9375         * configure.in [AC_PREREQ]: Update to 2.12 in order to switch to
9376           autoconf 2.12. Lots of other files will be rebuilt automatically.
9377           [AM_SANITY_CHECK_CC]: Removed, autoconf does it now.
9378         * aclocal.m4 [AM_SANITY_CHECK_CC]: Removed, autoconf does it now.
9379
9380 Tue Dec 17 22:23:16 1996  Arnold D. Robbins  <arnold@skeeve.atl.ga.us>
9381
9382         * builtin.c (do_strftime): Fix case if format string is "".
9383           Also fix it if format is not "" but result of strftime is "".
9384           See comments in code.
9385
9386 Tue Dec 10 23:09:26 1996  Arnold D. Robbins  <arnold@skeeve.atl.ga.us>
9387
9388         * Release 3.0.1: Release tar file made.
9389
9390 Tue Dec 10 22:39:41 1996  Arnold D. Robbins  <arnold@skeeve.atl.ga.us>
9391
9392         * Makefile.in (dist): Add dependency on `info'. Remove line that
9393           does makeinfo.
9394           (install): Use $(LN) not $(LN_S) to link gawk gawk-version.
9395
9396 Sun Dec  8 07:53:44 1996  Arnold D. Robbins  <arnold@skeeve.atl.ga.us>
9397
9398         * Makefile.in (gawk): Took COMPFLAGS out of link line for help
9399           on VMS posix. Shouldn't (I hope) affect anything else.
9400
9401 Thu Nov 28 11:52:24 1996  Arnold D. Robbins  <arnold@skeeve.atl.ga.us>
9402
9403         * configure.in (AC_PROG_INSTALL): Set INSTALL to install-sh.
9404
9405 Tue Nov 26 22:42:00 1996  Arnold D. Robbins  <arnold@skeeve.atl.ga.us>
9406
9407         * PORTS: Updated list of systems.
9408         * Makefile.in (install): Fix some typos and add some improvements
9409           for Ultrix.
9410
9411 Sun Nov 24 22:16:26 1996  Arnold D. Robbins  <arnold@skeeve.atl.ga.us>
9412
9413         * builtin.c (do_printf): If no args, fatal error. Return silently
9414           if --traditional.
9415
9416 Thu Nov  7 20:54:43 1996  Arnold D. Robbins  <arnold@skeeve.atl.ga.us>
9417
9418         * io.c (inrec): Make sure EOF hasn't already happened before
9419           trying to read; prevents accessing freed buffer. Thanks to
9420           Michal Jaegermann.
9421         * Makefile.in [AWKSRC]: Add random.h.
9422         * random.h: New file, redefines names of the `random' functions.
9423         * random.c, builtin.c: Add include of random.h.
9424
9425 Thu Nov  7 09:06:21 1996  Arnold D. Robbins  <arnold@skeeve.atl.ga.us>
9426
9427         * awk.y (snode): Undo 4 Oct change, put do_split code back.
9428         * field.c (do_split): Restore old code; add test for CONST, so
9429           that re_parse_field is used if third arg to split is a regexp
9430           constant.
9431
9432 Mon Nov  4 12:57:11 1996  Arnold D. Robbins  <arnold@skeeve.atl.ga.us>
9433
9434         * main.c (main): Research -m[fr] options don't need literal '='
9435           characters. Brian's documentation was confusing.  Fixed, not
9436           that anyone actually uses these options with gawk.
9437
9438 Sun Nov  3 11:23:21 1996  Arnold D. Robbins  <arnold@skeeve.atl.ga.us>
9439
9440         * field.c (def_parse_field): Add \n to list of acceptable white space.
9441           (posix_def_parse_field): New routine, just like def_parse_field(),
9442           but only allows space and tab as separators.
9443           (do_split, set_FS): Make appropriate choice between the two
9444           *def_parse_field() routines.
9445
9446 Fri Oct 25 10:13:06 1996  Arnold D. Robbins  <arnold@skeeve.atl.ga.us>
9447
9448         * configure.in: Remove test for random.
9449         * Makefile.in: Add random.c to list of files always compiled.
9450         * missing.c: Remove HAVE_RANDOM test.
9451         * builtin.c: Remove ifdef's for HAVE_RANDOM.
9452           [GAWK_RAND_MAX]: Use constant we know works with our random().
9453         * random.c: New file - moved from missing/ directory.
9454
9455 Wed Oct 23 19:46:01 1996  Pat Rankin  <rankin@eql.caltech.edu>
9456
9457         * builtin.c (do_tolower, do_toupper): Add `unsigned char *' casts.
9458
9459 Tue Oct 22 21:27:52 1996  Arnold D. Robbins  <arnold@skeeve.atl.ga.us>
9460
9461         * builtin.c [GAWK_RANDOM_MAX]: Try to make definition a bit
9462           smarter; don't use RAND_MAX if it's equal to SHRT_MAX, blows
9463           things up.
9464
9465 Tue Oct 22 08:49:20 1996  Arnold D. Robbins  <arnold@skeeve.atl.ga.us>
9466
9467         * main.c (copyleft): Update copyright date to 1996.
9468         * Too many files to list: Update copyright date to 1996.
9469
9470 Sun Oct 20 12:21:09 1996  Arnold D. Robbins  <arnold@skeeve.atl.ga.us>
9471
9472         * awk.y, dfa.c, eval.c, io.c, re.c: Added various FIXME comments.
9473
9474 Sat Oct 19 22:06:42 1996  Arnold D. Robbins  <arnold@skeeve.atl.ga.us>
9475
9476         * eval.c (nodetype2str): Make static, add prototype.
9477         * field.c (sc_parse_field): Cast array subscripts to int to
9478           shut up gcc warnings.
9479         * gawkmisc.c: Add prototype for xmalloc.
9480         * awk.h: Add prototype for getredirect.
9481         * builtin.c (do_fflush): Remove extern decl of getredirect.
9482         * io.c (get_a_record, mmap_get_record): Change decl of rs to int,
9483           to shut up gcc warnings.
9484         * awk.y (isassignable): Add a default to switch to quiet gcc.
9485         * getopt.c (_getopt_internal): Give default value to `indfound'.
9486
9487 Fri Oct 18 09:00:49 1996  Arnold D. Robbins  <arnold@skeeve.atl.ga.us>
9488
9489         * regex.h [RE_SYNTAX_AWK]: Add RE_CONTEXT_INDEP_ANCHORS.
9490
9491 Thu Oct 17 22:32:55 1996  Arnold D. Robbins  <arnold@skeeve.atl.ga.us>
9492
9493         * aclocal.m4 [AM_SANITY_CHECK_CC]: Added.
9494         * configure.in: Use it.
9495
9496 Thu Oct 17 21:43:25 1996  Arnold D. Robbins  <arnold@skeeve.atl.ga.us>
9497
9498         * configure.in: Add checks for locale.h and setlocale().
9499         * awk.h: Include locale.h and define out setlocale() if not available.
9500         * main.c (main): Call setlocale().
9501         * builtin.c (do_tolower, do_toupper): Use unsigned char pointers,
9502           to get other charsets right in different locales.
9503
9504 Wed Oct 16 21:32:53 1996  Arnold D. Robbins  <arnold@skeeve.atl.ga.us>
9505
9506         * builtin.c (format_tree): Change initial buffer size to 512
9507           and use a constant. Allows large values of %f per bug report
9508           from sheyn@cs.bu.edu.
9509
9510 Wed Oct 16 21:22:08 1996  Arnold D. Robbins  <arnold@skeeve.atl.ga.us>
9511
9512         * Makefile.in [MISC]: Removed TAGS and tags.
9513           (local-distclean): Added TAGS and tags.
9514           (maintainer-clean): Removed TAGS and tags.
9515
9516 Wed Oct 16 12:28:43 1996  Arnold D. Robbins  <arnold@skeeve.atl.ga.us>
9517
9518         * main.c (version): Add call to copyleft(), per new standards.
9519           version.c: Fix text of version string to match new standards.
9520
9521 Sun Oct  6 22:19:45 1996  Arnold D. Robbins  <arnold@skeeve.atl.ga.us>
9522
9523         * regex.c: Updated to Emacs 19.34b base.
9524
9525 Sun Oct  6 21:57:34 1996  Arnold D. Robbins  <arnold@skeeve.atl.ga.us>
9526
9527         * re.c (make_regexp): Fixed to handle \8 and \9 in the middle
9528           of a regexp.
9529
9530 Fri Oct  4 10:26:16 1996  Arnold D. Robbins  <arnold@skeeve.atl.ga.us>
9531
9532         * awk.y (snode): Remove case for do_split; always making the
9533           third arg a Node_regex is wrong.
9534         * field.c (do_split): Rationalized to distinguish `/ /' from `" "'.
9535           Generally fixed up.
9536         * node.c (parse_escape): Allow single digit \x escapes.
9537
9538 1996-10-02  Paul Eggert  <eggert@twinsun.com>
9539
9540         * builtin.c (format_tree): Fix bug in %d and %i format: NaNs, and
9541           values in the range LONG_MAX+1 .. ULONG_MAX, were mishandled.
9542           Don't assume that double values <= -1 are converted to unsigned
9543           long in the expected way; the C Standard doesn't guarantee this.
9544
9545 1996-10-02  Paul Eggert  <eggert@twinsun.com>
9546
9547         * awk.h (INT_MAX): Remove unused symbol.
9548
9549 Mon Sep 30 22:19:11 1996  Arnold D. Robbins  <arnold@skeeve.atl.ga.us>
9550
9551         * getopt.c (_getopt_internal): If 'W' is in the optstring followed
9552           by a ';' then search through the long opts table. This makes
9553           `-W foo=bar' same as `--foo=bar'.
9554         * main.c (main): 'W' now prints an error message.
9555           (gawk_option): Deleted the routine.
9556
9557 Sun Sep 29 23:04:54 1996  Arnold D. Robbins  <arnold@skeeve.atl.ga.us>
9558
9559         * builtin.c (sub_common): Fix several bugs with gsub when
9560           matching null strings. See test/gsubtest.awk.
9561
9562 Fri Sep 20 17:35:54 1996  Pat Rankin  <rankin@eql.caltech.edu>
9563
9564         * alloca.c (NULL): Don't define if <config.h> has already done so.
9565
9566 Fri Sep 20 11:54:31 1996  Arnold D. Robbins  <arnold@skeeve.atl.ga.us>
9567
9568         * builtin.c (do_print): Evaluate all the expressions first and
9569           then print them. Avoids surprising behavior. See test/prtoeval.awk
9570           for an example.
9571
9572 Tue Sep 10 06:21:40 1996  Arnold D. Robbins  <arnold@skeeve.atl.ga.us>
9573
9574         * awk.h [FUNC]: New flag, marks a Node_parameter_list as really
9575           being the function name; allows more checking in awk.y.
9576         * awk.y (isassignable): Now takes a NODE * instead of a type, to
9577           check if a function parameter is marked FUNC, then it's the function
9578           name, which is not assignable. Fix call from snode().
9579           (function_prologue): Mark function name as FUNC.
9580           (yyerror): Don't call exit() anymore; gawk will now report
9581           all syntax errors.
9582
9583 Sun Sep  1 19:36:30 1996  Arnold D. Robbins  <arnold@skeeve.atl.ga.us>
9584
9585         * field.c (rebuild_record): After building new field 0, go through
9586           all old fields, and if they used to point into the old one,
9587           have them point into the new one.  Then turn off PERM flag before
9588           unref-ing field 0.
9589
9590 Wed Aug 28 19:13:34 1996  Arnold D. Robbins  <arnold@math.utah.edu>
9591
9592         * eval.c (set_IGNORECASE): Correctly parenthesize bit operations
9593           in test and fix logic for string value.
9594
9595 Wed Aug 28 22:06:33 1996  Arnold D. Robbins  <arnold@skeeve.atl.ga.us>
9596
9597         * main.c (usage): Add email addresses for bug reporting, per
9598           change in GNU Coding Standards from RMS.
9599
9600 Sun Aug 11 23:13:22 1996  Arnold D. Robbins  <arnold@skeeve.atl.ga.us>
9601
9602         * Makefile.in (install): Correct use of $(INSTALL_PROGRAM).
9603
9604 Thu Aug  8 23:29:43 1996  Arnold D. Robbins  <arnold@skeeve.atl.ga.us>
9605
9606         * parse.y (isassignable): New function, checks in type can
9607           be assigned to.
9608           (snode): Changed checking for 3rd arg of gsub to be more
9609           general, supersedes earlier change.
9610
9611 Thu Aug  8 13:58:26 1996  Arnold D. Robbins  <arnold@skeeve.atl.ga.us>
9612
9613         * parse.y (snode): If third arg to sub or gsub is builtin
9614           function, complain, since can't substitute into result.
9615         * eval.c (r_get_lhs): Diagnose Node_builtin as an error, instead
9616           of falling through into default case and using cant_happen().
9617
9618 Thu Aug  1 07:13:14 1996  Arnold D. Robbins  <arnold@skeeve.atl.ga.us>
9619
9620         * regex.h [RE_DEBUG]: New macro.
9621           [RE_SYNTAX_GNU_AWK]: Add RE_DEBUG.
9622           [RE_SYNTAX_POSIX_AWK]: Add RE_INTERVALS.
9623         * regex.c (re_set_syntax): Add #ifdef DEBUG code to turn on `debug'
9624           flag if RE_DEBUG set, and turn off debug if not set and debug
9625           was on.
9626         * main.c (main): Remove `do_intervals = TRUE' from `if (do_posix)',
9627           it's now handled in the definition of RE_SYNTAX_POSIX_AWK.
9628
9629 Mon Jul 29 17:49:07 1996  Pat Rankin  <rankin@eql.caltech.edu>
9630
9631         * io.c (O_ACCMODE): Define it if <fcntl.h> doesn't.
9632
9633 Mon Jul 29 12:02:48 1996  Arnold D. Robbins  <arnold@skeeve.atl.ga.us>
9634
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
9637           for the bug report.
9638
9639 Fri Jul 26 12:04:43 1996  Arnold D. Robbins  <arnold@skeeve.atl.ga.us>
9640
9641         * awk.h (format_val): Add declaration of new routine.
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.
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.
9649
9650 Mon Jul 22 21:59:15 1996  Arnold D. Robbins  <arnold@skeeve.atl.ga.us>
9651
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.
9657
9658 Thu Jul 18 19:43:20 1996  Arnold D. Robbins  <arnold@skeeve.atl.ga.us>
9659
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.
9664
9665 Thu Jul 18 19:23:53 1996  Arnold D. Robbins  <arnold@skeeve.atl.ga.us>
9666
9667         * custom.h: Added ifdef for QNX, based on bug report from
9668           Michael Hunter, mphunter@qnx.com.
9669
9670 Mon Jul 15 09:31:01 1996  Arnold D. Robbins  <arnold@skeeve.atl.ga.us>
9671
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).
9676
9677 Sun Jul 14 18:40:26 1996  Arnold D. Robbins  <arnold@skeeve.atl.ga.us>
9678
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.
9682
9683 Sun Jul 14 18:08:01 1996  Arnold D. Robbins  <arnold@skeeve.atl.ga.us>
9684
9685         * awk.h: Add Jim Meyerings ISASCII etc hacks for ctype macros.
9686         * builtin.c (do_toupper, do_tolower, sub_common): Changed to use
9687           upper-case versions of ctype macros.
9688         * main.c (main): Ditto.
9689         * node.c (r_force_number, parse_escape): Ditto.
9690
9691 Sun Jul 14 06:34:18 1996  Arnold D. Robbins  <arnold@skeeve.atl.ga.us>
9692
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
9695           the fields valid.
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.
9699
9700 Thu Jul 11 23:04:20 1996  Arnold D. Robbins  <arnold@skeeve.atl.ga.us>
9701
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)'
9707           anyway.
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
9710           Chapman Flack.
9711
9712 Thu Jul 11 22:17:14 1996  Arnold D. Robbins  <arnold@skeeve.atl.ga.us>
9713
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.
9718         * Configure.in: Added call to AC_PROG_LN_S for Makefile.in.
9719
9720 Sun Jul  7 15:47:13 1996  Arnold D. Robbins  <arnold@infographix.com>
9721
9722         * main.c (main): Made `--posix' turn on interval expressions.
9723           Gawk now matches its documentation. (What a concept!)
9724
9725 Wed Jul  3 15:02:48 1996  Arnold D. Robbins  <arnold@infographix.com>
9726
9727         * regex.h, regex.c: Upgraded to changes from Emacs 19.31.
9728
9729 Fri May 17 08:46:07 1996  Arnold D. Robbins  <arnold@skeeve.atl.ga.us>
9730
9731         * io.c (get_a_record): Added `continued' flag. Fix from
9732           Darrell Hankerson for when RS = "\n|something".
9733
9734 Wed May 15 02:34:55 1996  Arnold D. Robbins  <arnold@skeeve.atl.ga.us>
9735
9736         * Makefile.in (awklib/all): Now depends on gawk, fixes problem
9737           with parallel make.
9738
9739 Tue May 14 15:02:52 1996  Arnold D. Robbins  <arnold@skeeve.atl.ga.us>
9740
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.
9744
9745 Sun May 12 20:42:06 1996  Arnold D. Robbins  <arnold@skeeve.atl.ga.us>
9746
9747         * eval.c (r_get_lhs): case Node_subscript. Check if array name
9748           is actually a function, fatal error if so.
9749
9750 Sun May  5 10:11:52 1996  Arnold D. Robbins  <arnold@skeeve.atl.ga.us>
9751
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).
9754
9755 Fri Mar 15 06:38:33 1996  Arnold D. Robbins  <arnold@skeeve.atl.ga.us>
9756
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
9761           other stuff.
9762
9763 Wed Mar 13 14:19:38 1996  Arnold D. Robbins  <arnold@skeeve.atl.ga.us>
9764
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.
9769
9770 Sun Mar 10 22:50:23 1996  Arnold D. Robbins  <arnold@skeeve.atl.ga.us>
9771
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>.
9776
9777 Thu Mar  7 08:08:51 1996  Arnold D. Robbins  <arnold@skeeve.atl.ga.us>
9778
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!
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.
9788         * eval.c (nodetype2str): New function, used for diagnostics.
9789           (interpret): Use nodetype2str when finding invalid node.
9790
9791 Mon Mar  4 09:02:28 1996  Arnold D. Robbins  <arnold@skeeve.atl.ga.us>
9792
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.
9796
9797 Mon Feb 26 22:24:44 1996  Arnold D. Robbins  <arnold@skeeve.atl.ga.us>
9798
9799         * builtin.c (sub_common): If no match, and called from gensub,
9800           don't free the temporary string, since the tmp_number then
9801           writes over it.
9802
9803 Sun Feb 25 23:13:01 1996  Arnold D. Robbins  <arnold@skeeve.atl.ga.us>
9804
9805         * builtin.c (format_tree): Fixed %c to treat user input as
9806           numeric also by adding test for MAYBE_NUM.
9807
9808 Tue Feb 20 12:25:50 1996  Arnold D. Robbins  <arnold@skeeve.atl.ga.us>
9809
9810         * configure.in: Added AC_FUNC_MMAP call and add madvise to
9811           list of functions to look for.
9812         * awk.h [IOP_ISMAPPED]: New flag value for mmap support and new
9813           `getrec' structure member in struct iobuf.
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.
9818
9819 Thu Feb  1 08:56:46 1996  Arnold D. Robbins  <arnold@skeeve.atl.ga.us>
9820
9821         * builtin.c (do_substr): Fixed lint message to use indx+1 when
9822           start position is past end of string.
9823
9824 Sun Jan 28 07:00:56 1996  Arnold D. Robbins  <arnold@skeeve.atl.ga.us>
9825
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.
9829
9830 Thu Jan 25 14:09:11 1996  Arnold D. Robbins  <arnold@skeeve.atl.ga.us>
9831
9832         * builtin.c (do_substr): If length exceeds length of actual
9833           string, do computation of needed substring length *after*
9834           the lint warning.
9835
9836 Wed Jan 24 10:06:16 1996  Arnold D. Robbins  <arnold@skeeve.atl.ga.us>
9837
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.
9845         * builtin.c (do_strftime): Remove hard coded limit on length of result.
9846           Based on code from Paul Eggert (eggert@twinsun.com).
9847
9848 Mon Jan 22 13:16:37 1996  Arnold D. Robbins  <arnold@skeeve.atl.ga.us>
9849
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.
9855
9856 Fri Jan 19 08:10:29 1996  Arnold D. Robbins  <arnold@skeeve.atl.ga.us>
9857
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,
9861           a phone number.
9862
9863 Wed Jan 10 23:19:36 1996  Arnold D. Robbins  <arnold@skeeve.atl.ga.us>
9864
9865         * 3.0.0 polished up and release tar file made.
9866
9867 Wed Dec 27 11:46:16 1995  Arnold D. Robbins  <arnold@skeeve.atl.ga.us>
9868
9869         * 2.94.0 released to porting group (no, I haven't been good
9870           about this file; I'll do better once 3.0 is released).
9871
9872 Mon Aug 28 23:04:30 1995  Arnold D. Robbins  <arnold@skeeve.atl.ga.us>
9873
9874         * awk.h updated for NeXT - bracket TRUE/FALSE
9875         * io.c (get_a_record): Removed shadowing of 'start' in
9876         * Makefile.in and doc/Makefile.in: Fixed to use gawk.1 and gawk.texi,
9877           instead of gawk.1.in and gawk.texi.in.
9878
9879 Mon Aug 25 11:04:30 1995  Arnold D. Robbins  <arnold@skeeve.atl.ga.us>
9880
9881         * 2.90.0 released to porting group.
9882
9883 Fri Aug 18 12:43:31 1995  Arnold D. Robbins  <arnold@puny.ssc.com>
9884
9885         * ChangeLog created.