1
2019-04-12 Arnold D. Robbins <arnold@skeeve.com>
3
* README: Updated in preparation for a release.
5
2019-04-07 Arnold D. Robbins <arnold@skeeve.com>
7
* config.sub: Updated from GNULIB.
9
2019-04-05 Arnold D. Robbins <arnold@skeeve.com>
11
* eval.c (load_casetable): Always use the locale's settings.
12
(set_IGNORECASE): Don't call load_casetable.
13
* main.c (main): Call load_casetable if in a single-byte locale.
15
2019-03-22 Arnold D. Robbins <arnold@skeeve.com>
17
* config.guess: Updated from GNULIB.
19
2019-03-17 Arnold D. Robbins <arnold@skeeve.com>
21
* configure.ac: Fix test for ZOS_FAIL.
23
2019-03-15 Arnold D. Robbins <arnold@skeeve.com>
25
* Makefile.am (pc/Makefile.tst): Yet another fix for out-
26
of-tree builds. Thanks to `make distcheck'.
27
* configure.ac: Update version for next tar ball.
29
2019-03-03 Arnold D. Robbins <arnold@skeeve.com>
31
* main.c (usage): Fix help message.
33
2019-03-01 Arnold D. Robbins <arnold@skeeve.com>
35
* Makefile.am (pc/Makefile.tst): Make sure pc/ directory exists
36
first. Needed for `make distcheck'. Not sure what changed such
37
that this is only showing up now.
38
* configure.ac: Update version for next test tarball.
40
2019-02-28 Arnold D. Robbins <arnold@skeeve.com>
42
* README.cvs: Removed. Six years is long enough.
44
2019-02-25 Arnold D. Robbins <arnold@skeeve.com>
46
* config.guess: Updated from GNULIB.
48
2019-02-25 Arnold D. Robbins <arnold@skeeve.com>
52
2019-02-25 Arnold D. Robbins <arnold@skeeve.com>
54
Small profiling improvements. Suggested by mukti
55
<ferida.cicatriz@gmail.com>.
57
* main.c (parse_args): Add warnings that --profile overrides
59
(main): Move setuid warning to after all the warnings for conflicting
61
* profile.c (pprint): Don't print extra trailing space after return
62
and exit if no value associated with the statement.
64
2019-02-25 Arnold D. Robbins <arnold@skeeve.com>
66
* configure.ac: Set ZOS_FAIL if on ZOS to improve test suite on that
68
* awk.h (is_valid_identifier): Move declaration outside ifdef DYNAMIC.
69
* command.y: Fix test for EBCDIC to use USE_EBCDIC.
70
* custom.h: Remove definitions of __builtin_expect.
71
* eval.c (update_ERRNO_string): Add untested and disabled code for z/OS
72
to remove leading IBM error codes. This might one day make more of the
75
2019-02-20 Arnold D. Robbins <arnold@skeeve.com>
77
* awk.h (is_valid_identifier): Move declaration outside of
78
`#if DYNAMIC'. Thanks to Daniel Richard G.
79
* custom.h (builtin_expect): Remove definitions, now
80
handled by support/cdefs.h.
82
2019-02-17 Arnold D. Robbins <arnold@skeeve.com>
84
Fix debugger eval command so that return from a called
85
user-defined function works. Thanks to Lothar Langer
86
<lotharla@gmail.com> for the report.
88
* awk.h (Op_K_return_from_eval): New opcode.
89
(parse_program): Add boolean second parameter, `from_eval'.
90
* awkgram.y (called_from_eval): New variable
91
(Grammar): Check it for return statements. If true, change the
92
opcode to Op_K_return_from_eval.
93
(parse_program): Set called_from_eval to value of from_eval parameter.
94
* debug.c (pre_execute_code): Change test for Op_K_return to test
95
for Op_K_return_from_eval.
96
(do_eval): Call parse_program with second parameter true.
97
* eval.c (optypetab): Add entry for Op_K_return_from_eval.
98
* interpret.h (r_interpret): Ditto: can't-happen error.
99
* main.c (main): Call parse_program with second parameter false.
102
2019-02-15 Arnold D. Robbins <arnold@skeeve.com>
104
* awkgram.y: If profiling, correctly turn `print' into `print $0'.
105
Thanks to Hermann Peifer for the bug report.
108
2019-02-11 Arnold D. Robbins <arnold@skeeve.com>
110
* configure.ac: Update version for next test tarball.
112
2019-02-07 Arnold D. Robbins <arnold@skeeve.com>
115
* config.guess, config.rpath, config.sub: Updated from GNULIB.
117
2019-02-05 Arnold D. Robbins <arnold@skeeve.com>
119
* Makefile.am (EXTRA_DIST): Add NEWS.1.
121
2019-02-04 Arnold D. Robbins <arnold@skeeve.com>
123
* NEWS.1: Rotated in from NEWS.
124
* NEWS: Shortened to start over again with 5.0 changes.
125
* ext.c (is_valid_identifier): Move outside of ifdefs so that
126
DJGPP (and other code) can find it.
128
2019-02-03 Arnold D. Robbins <arnold@skeeve.com>
130
* awkgram.y (snode): Disallow @/.../ as second param of index, also.
133
2019-02-02 Arnold D. Robbins <arnold@skeeve.com>
135
* awkgram.c, command.c: Regenerated with Bison 3.3.
138
2019-02-02 Eli Zaretskii <eliz@gnu.org>
140
* debug.c (execvp) [__MINGW32__]: Redirect to w32_execvp.
141
(restart): No need for MinGW-specific code anymore.
143
* nonposix.h: If setlocale is already a defined macro, #undef it
144
before redefining. This avoids compilation warnings if someone
145
tries to compile Gawk with Gettext's libintl.h, which redirects
146
setlocale to its own function.
147
Reported by Budi <budikusasi@gmail.com>.
149
* debug.c [__MINGW32__]: Prototype for w32_execvp.
150
(restart) [__MINGW32__]: Call w32_execvp instead of execvp. Don't
151
type-cast d_argv anymore.
153
2019-01-27 Arnold D. Robbins <arnold@skeeve.com>
155
* awkgram.y (qualify_name): Return duplicated strings.
156
(yylex): Qualify names before returning either NAME or FUNC_CALL.
157
(Grammar): Replace qualified_name non-token with NAME, remove
158
`qualified_name' production.
160
2019-01-27 Arnold D. Robbins <arnold@skeeve.com>
162
* Makefile.am, NEWS, awkgram.y, cint_array.c, custom.h, debug.c,
163
eval.c, ext.c, gawkapi.c, int_array.c, interpret.h, nonposix.h,
164
profile.c, re.c, replace.c, str_array.c, symbol.c: Update
167
2019-01-26 Arnold D. Robbins <arnold@skeeve.com>
169
* Makefile.am (pc/Makefile.tst): Fix to work for out of tree builds.
171
2019-01-25 Arnold D. Robbins <arnold@skeeve.com>
173
* main.c (UPDATE_YEAR): Bump to 2019.
174
(usage): Revise help message a little bit.
175
* configure.ac: Bump version to start a release spiral.
178
2019-01-24 Arnold D. Robbins <arnold@skeeve.com>
180
* awkgram.y (Grammar): Add new production `qualified_name' which
181
is NAME + qualification call. Use it everywhere that NAME was
182
used, except for function parameters.
184
2019-01-23 Arnold D. Robbins <arnold@skeeve.com>
186
* profile.c (adjust_namespace): Check for all upper case
187
identifiers so we don't get things like awk::NF.
189
2019-01-23 Arnold D. Robbins <arnold@skeeve.com>
191
* symbol.c (lookup): Remove second `do_qualify' parameter.
192
Remove calls to `fix_up_namespace'. If name starts with
193
"awk::" just lookup the compnent name.
194
Adjust all calls to `lookup' in other files.
195
(install): Don't use `fix_up_namespace'.
196
(fix_up_namespace): Remove function.
197
* awk.h (lookup): Adjust declaration.
199
2019-01-23 Arnold D. Robbins <arnold@skeeve.com>
201
* awkgram.y (qualify_name): Don't qualify a name if it's
204
2019-01-21 Arnold D. Robbins <arnold@skeeve.com>
206
* awkgram.y (Grammar): Use qualify_name for array subscript
207
expressions. Fixes the last leak in the test suite.
208
* awk.h (is_all_upper): Declare.
209
* symbol.c (is_all_upper): Remove static.
210
* awkgram.y (is_all_upper): Remove.
211
(Grammar): Clean up `#if 0' code.
213
2019-01-20 Arnold D. Robbins <arnold@skeeve.com>
215
Restore functionality.
217
* awkgram.y (qualify_name): Remove `is_var' param, always check
218
for all upper case. Adjust all calls.
219
(Grammar): Do qualify_name for function calls also.
221
2019-01-19 Arnold D. Robbins <arnold@skeeve.com>
223
Continue fixing memory leaks.
225
* awk.h (set_current_namespace): Declare function.
226
* awkgram.y: Change all assignments of current_namespace to calls
227
to set_current_namespace.
228
(is_all_upper, qualify_name): New functions.
229
(in_function): Change type to bool, and fix usages.
230
(Grammar): Use qualify_name on variables and function names.
231
* main.c: Change all assignments of current_namespace to calls
232
to set_current_namespace.
233
(set_current_namespace): New function.
234
* profile.c (pp_namespace): Don't free old current_namespace. Add
235
comment explaining why.
237
2019-01-18 Arnold D. Robbins <arnold@skeeve.com>
239
Start fixing memory leaks related to namespaces.
241
* awkgram.y (Grammar): At simple_variable -> NAME, qualify names
242
before lookup/install.
243
(next_sourcefile): Check if need to free current_namespace before
245
(yylex): Fix length of string to be dup'ed before returning
247
(set_namespace): Always free ns->lextok, adjust memory allocations
249
* main.c (main): Check if need to free current_namespace before
251
* profile.c (pp_namespace): Ditto. (This may not be necessary.)
253
2019-01-18 Arnold D. Robbins <arnold@skeeve.com>
255
* debug.c (do_set_var): Add comments before calls to assoc_set.
256
* interpret.h (r_interpret): For Op_sub_array, deref the subscript
257
appropriately. Thanks to Andy Schorr for the catch.
259
2019-01-15 Arnold D. Robbins <arnold@skeeve.com>
261
* array.c (asort_actual): Use assoc_set in 2 places.
262
* awk.h (assoc_set): Improve leading comment.
263
* debug.c (do_set_var): Use assoc_set in 2 places.
264
* field.c (set_element, update_PROCINFO_str, update_PROCINFO_num):
265
Use assoc_set in each.
266
* gawkapi.c (api_set_array_element): Use assoc_set.
267
* interpret.h (r_interpret): Use assoc_set.
268
* main.c (init_args, load_environ, load_procinfo_argv):
269
Use assoc_set in each.
270
* mpfr.c (do_mpfr_intdiv): Use assoc_set in 2 places.
271
* str_array.c (str_lookup): Fix leading comment.
272
* symbol.c (install): Use assoc_set.
274
2019-01-15 Andrew J. Schorr <aschorr@telemetry-investments.com>
276
* builtin.c (do_match, do_intdiv): Remove unused `sub' and `lhs'
277
variables, since assoc_set is now doing all of the work.
279
2019-01-15 Andrew J. Schorr <aschorr@telemetry-investments.com>
281
* awk.h (assoc_set): Move the definition lower down because it
282
needs to be after unref is declared.
283
* builtin.c (do_match): Use assoc_set in 3 places.
284
(do_intdiv): Use assoc_set in 2 places.
285
(do_typeof): Use assoc_set in 2 places.
287
2019-01-14 Andrew J. Schorr <aschorr@telemetry-investments.com>
289
* awk.h (assoc_set): Add new inline function to set an array element
290
to eliminate code duplication and reduce the chance of memory leaks.
292
2019-01-14 Andrew J. Schorr <aschorr@telemetry-investments.com>
294
* builtin.c (do_typeof): Fix memory leak when populating the
295
optional array, and make sure to call the astore method.
297
2019-01-14 Arnold D. Robbins <arnold@skeeve.com>
299
* builtin.c (do_intdiv): Add unref of subscripts.
300
* mpfr.c (do_mpfr_intdiv): Ditto.
301
Thanks to Andy Schorr for noticing.
303
2019-01-09 Andrew J. Schorr <aschorr@telemetry-investments.com>
305
* awkgram.y (tokentab): Indicate that typeof may take 2 arguments.
306
(snode): Add support for typeof's optional 2nd array argument.
307
* builtin.c (do_typeof): Add support for optional 2nd array arg,
308
returning flag info for scalars and backend array type for arrays.
310
2019-01-09 John E. Malmberg <wb8tyw@qsl.net>
312
* awk.h: For non GCC, have __attribute__ definition match
313
support/regex_internal.h exactly.
315
2019-01-08 Arnold D. Robbins <arnold@skeeve.com>
317
* interpret.h (r_interpret): For a translatable string, only copy
318
the gettext return value if it's different from the original.
319
Otherwise, use the original.
321
2019-01-07 Andrew J. Schorr <aschorr@telemetry-investments.com>
323
Use a struct instead of an array to contain the array methods
324
for improved code clarity and flexibility.
326
* awk.h (array_funcs_t): Define new struct to contain the array
328
(NODE): Change type of array_funcs (sub.nodep.l.lp) from `afunc_t *'
329
to `const array_funcs_t *' (from a pointer to an array of function
330
methods to a pointer to a struct containing the methods).
331
(a*_ind): Remove obsolete method array index defines.
332
(a*): Redefine array methods to use struct members instead of
334
(str_array_func, cint_array_func, int_array_func): Change type
335
from array of afunc_t to 'const array_funcs_t'.
336
(register_array_func): Remove global declaration, since this function
337
is called only inside array.c.
338
* array.c (null_array_func): Change from array of methods to a struct.
339
(array_types): Now an array of pointers to array_funcs_t.
340
(AFUNC): Remove obsolete macro.
341
(register_array_func): Change scope to static, and change argument
342
to a pointer to array_funcs_t instead of a pointer to an array of
344
(array_init): Modify calls to register_array_func to pass the address
345
of the new array method structs.
346
(make_array): Set array_funcs to & null_array_func.
347
(null_lookup): Modify to use new array method structs.
348
(assoc_list): Update cint check to use & cint_array_func.
349
* str_array.c (str_array_func, env_array_func): Change from array of
350
methods to an array_funcs_t struct.
351
(env_clear, init_env_array): Set array_funcs to & env_array_func.
352
* int_array.c (int_array_func): Change from array of methods to an
353
array_funcs_t struct.
354
* cint_array.c (cint_array_func): Ditto.
355
(cint_lookup): When setting xn->array_funcs, must now use &.
356
(cint_dump): Compare xn->array_funcs to & int_array_func.
358
2019-01-06 Andrew J. Schorr <aschorr@telemetry-investments.com>
360
* array.c (do_delete): If the array is now empty, reset it to the
361
null implementation to avoid being locked into the backend
362
optimization previously selected.
364
2019-01-06 Andrew J. Schorr <aschorr@telemetry-investments.com>
366
Remove pointless alength macro/method that uses a needless
367
function call indirection to access the table_size value.
369
* awk.h (alength, alength_ind): Remove these defines, and also renumber
370
the array_funcs items after that, and use the <blah>_ind define to
371
define <blah> instead of repeating the hardcoded numeric value.
372
(NUM_AFUNCS): Remove unused define.
373
(assoc_length): Redefine to access table_size directly.
374
(null_length): Remove prototype.
375
* array.c (null_array_func): Remove null_length entry.
376
(null_length): Remove obsolete function.
377
* cint_array.c (cint_array_func): Remove null_length entry.
378
* int_array.c (int_array_func): Remove null_length entry.
379
* str_array.c (str_array_func, env_array_func): Remove null_length
381
* gawkapi.c (api_flatten_array_typed): Use the assoc_empty macro to
382
check for an empty array instead of comparing table_size to 0.
383
* symbol.c (lookup, check_param_names): Ditto.
385
2018-12-31 Arnold D. Robbins <arnold@skeeve.com>
387
Clean up namespace handling for the profiler.
389
* awkgram.y (make_pp_namespace): Remove function, not needed.
390
(set_namespace): Use estrdup to save the current namespace.
391
* main.c (main): Before dumping the program, set current_namespace
393
* profile.c (pprint): Use "awk" for comparison, not "awk::".
394
(pp_namespace): Just print the name in the @namespace line.
395
(adjust_namespace): Adjust for the fact that namespaces no longer
396
have the trailing "::".
398
2018-12-30 Arnold D. Robbins <arnold@skeeve.com>
400
* awk.h (check_qualified_name): Remove declaration.
401
* awkgram.y (check_qualified_special): Renamed from
402
check_qualified_name and made static.
403
* profile.c (pprint): Improve comment on namespace list.
405
2018-12-21 Arnold D. Robbins <arnold@skeeve.com>
407
* configure.ac: Remove -O only if .developing has 'debug' in it.
409
2018-12-18 Arnold D. Robbins <arnold@skeeve.com>
411
* Makefile.am (distclean-local): Remove .deps directory.
413
2018-12-14 Arnold D. Robbins <arnold@skeeve.com>
415
* config.guess: Updated from GNULIB.
417
2018-12-12 Arnold D. Robbins <arnold@skeeve.com>
421
2018-12-12 Andrew J. Schorr <aschorr@telemetry-investments.com>
423
* configure.ac (AC_CHECK_FUNCS): Check for timegm.
424
* builtin.c (mktime_tz): Remove function; we will use timegm instead.
425
(do_mktime): Replace 'mktime_tz(& then, "UTC+0")' with 'timegm(& then)'.
426
* protos.h (timegm): Add timegm proto on systems lacking it.
427
* replace.c (timegm): Include missing_d/timegm.c if needed.
429
2018-12-12 Arnold D. Robbins <arnold@skeeve.com>
431
* NEWS: Updated some.
433
2018-12-12 Arnold D. Robbins <arnold@skeeve.com>
435
* awk.h: Add new Op_K_namespace opcode for pretty printing.
436
* awkgram.y (namespace_chain): New variable, list of successive
437
@namespace directives seen, for the pretty printer.
438
(namespace_comment): Removed.
439
(set_namespace): Takes comment as second argument, builds the chain.
440
(mk_function, append_rule): Adjust to store the chain.
441
* debug.c (print_ns_list): New function.
442
(print_instruction): Adjust Op_rule and Op_func to use print_ns_list.
443
Add case for Op_K_namespace.
444
* eval.c (optable): Add entry for Op_K_namespace.
445
(opcode2str, op2str): Edit / add leading comments, respectively.
446
* profile.c (pp_namespace_list): New function.
447
(pprint): Adjust code to call pp_namespace_list.
449
2018-12-06 Arnold D. Robbins <arnold@skeeve.com>
451
* configure.ac: Add -ggdb3 to CFLAGS if developing and remove
452
-O2 from Makefile, extension/Makefile, and support/Makefile.
453
* config.guess, config.sub: Updated from GNULIB.
455
2018-12-06 Arnold D. Robbins <arnold@skeeve.com>
457
* awkgram.y (namespace_comment): New variable.
458
(Grammar): Handle comments after @namespace statements.
459
(mk_function): Add any comment onto the saved namespace.
460
(append_rule): Ditto.
461
* profile.c (pp_namespace): Add second argument for a comment.
464
2018-12-02 Arnold D. Robbins <arnold@skeeve.com>
466
* awkgram.y (mk_program): Add in leading and trailing comments
467
when program block is empty.
469
2018-11-29 Arnold D. Robbins <arnold@skeeve.com>
471
* awkgram.y (first_rule, func_first): Remove unused variables.
472
(Grammar): Simplify rule for range pattern.
474
2018-11-28 Arnold D. Robbins <arnold@skeeve.com>
476
* awkgram.y (debug_print_comment): New macro and function.
477
(load_library): Rework to not try to open the file if pretty printing.
478
(append_rule): Adjust handling of interblock_comment.
480
2018-11-27 Arnold D. Robbins <arnold@skeeve.com>
482
* awkgram.y (Grammar): In rule for function, set interblock_comment.
483
(mk_function): Hook interblock_comment onto fi->comment, merge it
484
with the existing one first, if any. Append trailing_comment.
486
2018-11-26 Arnold D. Robbins <arnold@skeeve.com>
488
* main.c (platform_name): Add os390. Treat Cygwin and Mac OS X
489
as POSIX, per discussion with the dev team.
493
* profile.c (print_comment): Indent for chained comment.
494
* awkgram.y (load_library): Return early if just pretty printing.
495
(yylex): Fix handling of ?: and allow_newline etc.
497
2018-11-25 Arnold D. Robbins <arnold@skeeve.com>
499
* main.c (platform_name): New function returning platform name.
500
(load_procinfo): Use `platform_name()' to add "platform" element.
501
Thanks to Eli Zaretskii for the suggestion.
502
* NEWS: Updated with info about PROCINFO["platform"].
504
2018-11-25 Arnold D. Robbins <arnold@skeeve.com>
506
* config.sub: Updated from GNULIB.
508
2018-11-24 Arnold D. Robbins <arnold@skeeve.com>
510
* awkgram.y (interblock_comment, pending_comment): New variables.
511
(Grammar, mk_program, add_rule): Adjust to use them. Changes
512
handle comments at the outermost level, between blocks and functions.
514
2018-11-24 Arnold D. Robbins <arnold@skeeve.com>
516
* main.c (arg_assign): Allow assigning strongly typed regexp
517
constants to variables on the command line and with -v.
518
Thanks to Peng Yu <pengyu.ut@gmail.com> for the report.
520
2018-11-17 Arnold D. Robbins <arnold@skeeve.com>
522
* awkgram.c, command.c: Updated to Bison 3.2.1.
524
* Makefile.am (pc/Makefile.tst): Make it work for out-of-tree
525
builds. Thanks to `make distcheck' for the report.
527
2018-11-17 Arnold D. Robbins <arnold@skeeve.com>
529
* config.guess: Updated from GNULIB.
531
2018-11-11 Arnold D. Robbins <arnold@skeeve.com>
533
* main.c (usage): Improve output for -Z in the help.
535
2018-11-11 Arnold D. Robbins <arnold@skeeve.com>
537
* awkgram.y (outer_comment): New variable.
538
(Grammar): More changes. We now get the simple case of leading
539
and trailing comments, but not all the cases.
541
2018-11-11 Arnold D. Robbins <arnold@skeeve.com>
543
* awkgram.y (trailing_comment): New variable.
544
(Grammar): For `action', append both trailing comments. This may
545
change. For `statements', append the value of `trailing_comment'
546
if set. At `statement := l_brace statements rbrace' save
547
trailing_comment from r_brace.
548
(make_braced_statements): Don't append the comment from r_brace
549
to the statement list.
551
2018-10-30 Arnold D. Robbins <arnold@skeeve.com>
553
* awk.h (NODE): New field: sub.nodep.x.cmnt, holds comment for
554
expressions being pretty-printed.
555
* awkgram.y (Grammar): For expression lists, save any comment
556
that came after a comma in the list.
557
* profile.c (pp_push): Accept a fourth argument which is any
558
comment associated with the expression. Either it's there or
559
it's NULL. Save it in the pp_comment field of the node being pushed.
560
(tabs, tabs_len, check_indent_level): Made into static globals.
561
(pprint): Adjust all calls to pp_push(). Fix parenthesization
562
for casts in string lengthes when indenting.
563
(pp_list): If a popped item has a comment, include it and the
564
following indentation in the formatted result.
566
2018-10-28 Arnold D. Robbins <arnold@skeeve.com>
568
* awkgram.y (include_source): Add second parameter to return
570
(Grammar): For @include, save the comment for later dumping
571
along with the list of include files.
572
(make_include_comment): Removed. No longer used.
573
* profile.c: Update copyright year.
574
(print_include_list): New function.
575
(dump_prog): Call it.
577
2018-10-24 Arnold D. Robbins <arnold@skeeve.com>
579
* main.c (usage): Improve output for -Y and add -Z in the help.
581
2018-10-23 Arnold D. Robbins <arnold@skeeve.com>
583
* config.sub: Updated from GNULIB.
585
2018-10-20 Arnold D. Robbins <arnold@skeeve.com>
587
* awk.h (SRCFILE): Add comment field for comments on @load statements.
588
* awkgram.y (include_source): Type change to boolean.
589
(load_library): Type change to boolean, additiona parameter to
590
bring the SRCFILE struct up to where we can add the comment into it.
591
(make_include_comment): New function. Not used yet.
592
(Grammar): Add comment for @load statements. Start on preserving
593
@include statements and their comments for eventual inclusion
594
into the pretty-printed code.
595
* profile.c (print_lib_list): Made a little smarter about printing
596
the header and indentation. Print the comment if there is one.
598
2018-10-17 Arnold D. Robbins <arnold@skeeve.com>
600
* awk.h (commenttype): Add FOR_COMMENT.
601
* awkgram.y (Grammar): Handle all the opt_nls cases in
602
regular for statements.
603
* debug.c (print_instruction): Print the comments in Op_K_for.
604
* profile.c (pprint): Handle printing comments.
606
2018-10-17 Arnold D. Robbins <arnold@skeeve.com>
609
* awkgram.y (Grammar): Distinguish `print' and `print $0' in
610
what gets profiled / pretty-printed.
611
* profile.c (pprint): For case and default, add final newline
612
if there is no comment to print.
614
2018-10-16 Arnold D. Robbins <arnold@skeeve.com>
616
* awkgram.y (Grammar): Improve comment handling for many plain
617
statements. Improve handling for case and default.
618
Handle comments in `for (iggy in foo)' loops.
619
(yylex): After a colon, only allow newline if was part of ?:.
620
(merge_comments): Improve coding so we don't get two newlines
621
at the end of a merged comment.
622
* debug.c (print_instruction): Handle comments for case and default.
623
Simplify printing of comments.
624
* profile.c (pprint): Handle comments for case and default.
625
Remove compiler warning in Op_and/Op_or handling.
627
2018-10-14 Arnold D. Robbins <arnold@skeeve.com>
629
* awkgram.y (Grammar): Add comment handling for do...while.
630
Regularize comments about `else ...'.
631
* debug.c (print_instruction): Improve handling of comments for
632
do-while and switch, and in general.
633
* profile.c (pprint): Revise for do...while.
635
2018-10-10 Arnold D. Robbins <arnold@skeeve.com>
637
* awkgram.y (make_braced_statements): New function.
638
(Grammar): Use it in the right places instead of inline code.
639
* debug.c (print_instruction): For Op_comment, fix type string.
640
* profile.c (pprint): Move tabs and tabs_len to top of function.
641
For Op_and and Op_or, handle comments. Use new check_indent_level
642
for Op_and, Op_or and Op_cond_exp.
644
2018-10-10 Arnold D. Robbins <arnold@skeeve.com>
646
* debug.c (print_instruction): For Op_comment, use print_func
647
instead of fprintf to print the comment type.
649
2018-10-10 Arnold D. Robbins <arnold@skeeve.com>
651
* awkgram.y (Grammar): For statement -> { statements }, fix comment
652
handling. For `if' statement add comment support.
653
* profile.c (pp_print): Print comments associated with `if' and `else'.
655
2018-10-09 Arnold D. Robbins <arnold@skeeve.com>
657
* awkgram.y (Grammar): Fix handling of empty statement (just a semi-
659
(merge_comments): If no chained comment and no second comment,
662
2018-10-09 Arnold D. Robbins <arnold@skeeve.com>
664
* awk.h (enum commenttype): New enum.
665
(NODE): Add it to sub.val.
666
(EOL_COMMENT, FULL_COMMENT): Replaced with above enum values.
667
* awkgram.y (Grammar): Finish up handling comments in function headers
668
and bodies. Get trailing comments at end of program
669
(get_comment): When doing comments, if we got EOF, push it back so that
670
multiple comments get merged together.
671
(merge_comments): Allow second parameter to be NULL.
672
* profile.c (pp_print): Change to use above enum everywhere. For
673
Op_K_print_rec produce plain `print' instead of `print $0'. Handle
674
comments in ?:. Handle printing function comments.
675
(print_comment): Simplify `after_newline' assignment. Add assertion
676
that chaining is only two deep.
678
2018-10-06 Arnold D. Robbins <arnold@skeeve.com>
680
* awkgram.y (action): Improve handling of comments attached
681
to braces. Helps with function bodies.
683
2018-10-04 Arnold D. Robbins <arnold@skeeve.com>
685
* awkgram.y (merge_comments): Change return type to void. Adjust calls.
686
(Grammar): For action, pull comments out of braces and stick
687
into the list. For function_prologue, get comments from parameters
688
and ending newline, merge, and save. Wherever nls and opt_nls
689
are used, be sure to pass their values up via $$. For various
690
cases that can be empty, explicitly set $$ = NULL.
691
* profile.c (pprint): Get switch working. Get ?: working.
692
(print_comment): Print any chained comment.
693
(pp_func): Start revising.
695
2018-10-03 Arnold D. Robbins <arnold@skeeve.com>
697
* awkgram.y: Range expressions, enable comment stuff.
698
Switch statement: start on comment handling.
700
2018-10-01 Nelson H.F. Beebe <beebe@math.utah.edu>
702
* custom.h (__builtin_expect): Define for non-GNU compilers.
704
2018-09-27 Andrew J. Schorr <aschorr@telemetry-investments.com>
706
* mpfr.c (force_mpnum): Check that base is 10 also before
707
computing MPG integer. Found based on bug report from
708
Luu Vinh Phuc <phuclv90@gmail.com>.
710
2018-09-26 Arnold D. Robbins <arnold@skeeve.com>
712
Add more lint checks.
714
* awk.h (POP_ARRAY): Add boolean parameter to check for untyped
715
value and include lint warning.
716
* interpret.h (r_interpret): Adjust all calls to POP_ARRAY.
717
* field.c (do_split): Improve lint warning text for empty
719
* re.c (make_regexp): Add lint check for '\0' in contents of
720
regexp to be matched (dynamic or otherwise).
722
2018-09-23 Steven Packard <spackard1@bloomberg.net>
724
* awk.h: Add `#if !defined(__SUNPRO_C)' around check for non-ANSI
725
compilers. Needed for some Solaris systems.
727
2018-09-21 Arnold D. Robbins <arnold@skeeve.com>
729
* awk.h (INSTRUCTION): Add comment field to carry
730
comment around during parsing.
731
* awkgram.y (merge_comments): New function.
732
(split_comment, check_comment, comment, prior_comment,
733
comment_to_save, program_comment, function_comment,
734
block_comment): Removed.
735
(grammar): Remove old code and start passing the comment
736
up via yylval and the newlines in the grammar.
738
2018-09-21 Arnold D. Robbins <arnold@skeeve.com>
740
* awkgram.y: Undo change of 2016-11-28 to make switch
741
head a separate production, in preparation for revamping
744
2018-09-21 Arnold D. Robbins <arnold@skeeve.com>
746
* re.c (make_regexp): Handle backslash at end of
747
input string. Thanks to Anatoly Trosinenko
748
<anatoly.trosinenko@gmail.com> for the report.
749
Also, improve the error message when compilation of
752
2018-09-21 Arnold D. Robbins <arnold@skeeve.com>
754
* io.c (fork_and_open_slave_pty): Move an errant close brace
755
inside the #endif so that gawk will compile on AIX. Thanks to
756
Fredrik Laurin <fredrik_laurin@yahoo.se> for the report.
758
2018-09-18 Arnold D. Robbins <arnold@skeeve.com>
760
* NEWS: Fix typo in gettext version.
764
* field.c (get_field): Move lint check for field access in an
765
END rule to top level, make wording more general.
766
* builtin.c (do_print_rec): Restore check before calling get_field()
767
and add do_lint to the condition.
771
* field.c (set_NF): Add lint warning if decrementing NF, which
772
doesn't work on older Unix awks.
776
* config.rpath: Sync to GNULIB.
778
2018-09-16 gettextize <bug-gnu-gettext@gnu.org>
780
* configure.ac (AM_GNU_GETTEXT_VERSION): Bump to 0.19.8.
781
* ABOUT-NLS, config.rpath: Updated by gettext 0.19.8.1.
783
2018-09-16 Arnold D. Robbins <arnold@skeeve.com>
785
* field.c (get_field): Add lint check if accessing $0 inside
786
an END rule, print a "may not be portable" warning.
787
* builtin.c (do_print_rec): Call get_field() unconditionally
788
in order to do lint check.
792
* awkgram.c, command.c: Updated to Bison 3.1.
797
* Makefile.in, aclocal.m4, configure: Regenerated, using
802
* gettext.h: Synced with that from Gettext 0.19.8.1.
804
2018-09-14 Adrian Bunk <bunk@debian.org>
806
* awk.h (init_debug, debug_prog): Move prototypes to here from ...
808
Thanks to Michael Tautschnig for noticing the type mismatch.
810
2018-09-07 Arnold D. Robbins <arnold@skeeve.com>
812
* awkgram.y, debug.c, ext.c, gawkapi.c, gawkapi.h,
813
io.c: Remove unneeded \n in calls to warning(), fatal(),
815
* config.guess, config.sub: Updated from GNULIB.
817
2018-08-24 Arnold D. Robbins <arnold@skeeve.com>
819
* NEWS: Updated w.r.t. GNULIB regex routines.
820
* config.sub: Updated from GNULIB.
822
2018-08-17 Arnold D. Robbins <arnold@skeeve.com>
824
* config.sub: Updated from GNULIB.
826
2018-08-10 Arnold D. Robbins <arnold@skeeve.com>
828
* config.guess, config.sub: Updated from GNULIB.
830
2018-08-05 John E. Malmberg <wb8tyw@qsl.net>
832
* custom.h: Define macros needed for building with gnu regex.
834
2018-08-02 Arnold D. Robbins <arnold@skeeve.com>
836
* awkgram.y (yylex): Add lint warning upon encountering escaped
837
physical newlines in a string.
838
* node.c (make_str_node): Ditto.
840
2018-08-01 John E. Malmberg <wb8tyw@qsl.net>
842
* custom.h: Include fp.h on OpenVMS.
843
Workaround for bug in math.h missing some declarations.
845
2018-07-31 Arnold D. Robbins <arnold@skeeve.com>
847
* interpret.h (unfield): Add a call to force_string() on
848
new value. See test/assignnumfield.awk. Thanks to
849
Ralph Corderoy <ralph@inputplus.co.uk> for the bug report.
851
2018-07-31 Arnold D. Robbins <arnold@skeeve.com>
853
Handle newlines in -v and fix \-<newline>. Thanks to
854
Samy Mahmoudi <samy.mahmoudi@gmail.com> for the report.
856
* awk.h [ELIDE_BACK_NL]: New constant.
857
* awkgram.y (yylex): Disallow any physical newlines in a string
858
even if escaped, in POSIX mode.
859
* main.c (arg_assign): In POSIX mode disallow physical newline
860
in a -v value. Otherwise call make_str_node() with ELIDE_BACK_NL.
861
* node.c (make_str_node): Handle ELIDE_BACK_NL.
863
2018-07-31 Arnold D. Robbins <arnold@skeeve.com>
865
* array.c (cmp_strings): Preserve value of lmin so it can be passed
866
to memcmp() if IGNORECASE comparison failed. Thanks to
867
M. Rashid Zamani <rashid.z@gmail.com> for the report.
869
2018-07-27 Arnold D. Robbins <arnold@skeeve.com>
871
* re.c (make_regexp): Add warnings for unknown escape sequences,
872
similar to what we already do for strings.
873
* awkgram.y: Add lint warning about concatenation as target
874
of `>' redirection. Always use Op_parens so that
875
print "foo" > ("foo" 1) does not warn.
877
2018-07-26 Arnold D. Robbins <arnold@skeeve.com>
879
* awk.h (_GNU_SOURCE): Don't define it here, it's already
882
2018-07-13 Arnold D. Robbins <arnold@skeeve.com>
884
* builtin.c (format_nan_inf): New function to generate +nan, -nan,
885
+inf, -inf, so that gawk output for NaN and INF always has a sign.
886
Handles regular and MPFR.
887
(out_of_range): New function to check if a value is out of range,
888
both regular and MPFR.
889
(format_tree): Use them in out of range calculation. Check for out
890
of range in floating point formats also. Allow new *undocumented*
891
'P' flag to not do out of range formantting. Used mainly for
893
* awk.h (out_of_range, format_nan_inf): Declare functions.
894
* mpfr.c (mpg_format_val): Check for out of range and format the
895
the result appropriately if so.
896
* node.c (r_format_val): Ditto.
898
2018-06-27 Arnold D. Robbins <arnold@skeeve.com>
900
* config.guess, config.sub: Updated from GNULIB.
902
2018-06-22 Andrew J. Schorr <aschorr@telemetry-investments.com>
904
* node.c (r_force_number): If strtod returns ERANGE, accept the
905
value as being numeric instead of forcing it to zero. The impact
906
is that huge string values that overflow IEEE 754 limits will now
907
be converted to inf or -inf instead of 0. Thanks to Daniel
908
Pettet for reporting this issue.
910
2018-06-17 Arnold D. Robbins <arnold@skeeve.com>
912
Fix a corner case with EPIPE to stdout/stderr.
913
Thanks to Peng Yu for the report.
915
* io.c (close_io): Add new parameter for indicating EPIPE happened,
916
update the code to set it if so.
917
* awk.h (close_io): Revise declaration.
918
* debug.c (close_all): Change call to close_io().
919
* interpret.h (interpret): For Op_atexit, if got an EPIPE, call
922
2018-05-24 Arnold D. Robbins <arnold@skeeve.com>
924
* awkgram.y (add_lint): For no-effect case, also check for
925
Op_push_i. Makes statements consisting of a single constant
928
2018-05-23 Arnold D. Robbins <arnold@skeeve.com>
930
* config.guess, config.sub: Updated from GNULIB.
932
2018-05-14 Arnold D. Robbins <arnold@skeeve.com>
936
2018-05-13 Arnold D. Robbins <arnold@skeeve.com>
938
* config.sub: Update from GNULIB.
940
2018-05-03 Arnold D. Robbins <arnold@skeeve.com>
942
* Makefile.am (pc/Makefile.tst): New target.
943
(dist-hook): Now depends upon pc/Makefile.tst.
945
2018-04-30 Arnold D. Robbins <arnold@skeeve.com>
947
* gawkapi.h [dl_load_func]: Minor improvement in version mismatch
948
message as suggested by Manuel Collado
949
<m-collado@users.sourceforge.net>.
951
2018-04-18 Arnold D. Robbins <arnold@skeeve.com>
953
* config.sub: Updated from GNULIB.
955
2018-04-14 Manuel Collado <m-collado@users.sourceforge.net>
957
* field.c (reset_record): Disable fieldwidth from API
958
get_record() if $0 is explicitly assigned a new value.
960
2018-04-02 Arnold D. Robbins <arnold@skeeve.com>
962
* config.guess, config.sub, install-sh: Updated from GNULIB.
964
2018-04-01 Arnold D. Robbins <arnold@skeeve.com>
966
Fix a nasty MPFR bug in r_dupnode. If the value being copied
967
is MPFN / MPFR, copy those bits over too. Thanks to
968
Noah Dean <N.Dean@gaminglabs.com> for the report.
970
* node.c (r_dupnode): Check for MPFN / MPFR and copy the bits
975
* interpret.h (UNFIELD): Turn into an inline function and
976
let UNFIELD macro call it, allows stepping in with a debugger.
977
(unfield): Function holding former body of UNFIELD macro.
979
2018-03-26 Arnold D. Robbins <arnold@skeeve.com>
981
Remove the tail recursion optimization. It's fundamentally
982
broken, in the case where a local var becomes a parameter.
983
Thanks to Denis Shirokov <cosmogen@gmail.com> for the report.
984
See test/tailrecurse.awk.
986
* awk.h [num_tail_calls, tail_call]: Remove definitions.
987
* awkgram.y (grammar, mk_function): Remove code related to
988
the tail recursion optimization.
989
* eval.c (dump_fcall_stack): Adjust dumping code since no longer
990
looping through tail call recursion.
991
(setup_frame): Remove code related to the tail recursion optimization.
992
(init_interpret): Ditto.
994
2018-03-22 Arnold D. Robbins <arnold@skeeve.com>
996
* configure.ac: Check for %a support in system printf.
997
* builtin.c (format_tree): Add support for %a and %A, including
999
* NEWS: Add a note about %a support.
1001
2018-03-13 Arnold D. Robbins <arnold@skeeve.com>
1003
* debug.c, nonposix.h: Update copyright year.
1005
2018-03-11 Arnold D. Robbins <arnold@skeeve.com>
1007
* compile, config.guess, config.sub, configure.ac, depcomp,
1008
install-sh, mkinstalldirs: Updated.
1010
2018-03-05 Arnold D. Robbins <arnold@skeeve.com>
1012
* awk.h [PUSH_BINDING, POP_BINDING]: Moved to ...
1014
* awkgram.y (yylex): Make do_etoa_init into a boolean.
1015
* io.c (rs1scan): Make found into a boolean.
1017
2018-02-25 Arnold D. Robbins <arnold@skeeve.com>
1019
* 4.2.1: Release tar ball made.
1021
2018-02-25 Arnold D. Robbins <arnold@skeeve.com>
1023
* config.guess, config.sub: Updated.
1025
2018-02-23 Arnold D. Robbins <arnold@skeeve.com>
1027
* configure.ac: Restore checking for PPC Macintosh before
1028
checking for MPFR. See README_d/README.macosx for info.
1030
2018-02-21 Arnold D. Robbins <arnold@skeeve.com>
1032
* configure.ac: Remove checking for PPC Macintosh before
1033
checking for MPFR. Installing a newer compiler on that
1034
system allows things to work.
1036
2018-02-19 Arnold D. Robbins <arnold@skeeve.com>
1038
* gawkapi.h, io.c, msg.c: Update copyright year.
1040
2018-02-10 Arnold D. Robbins <arnold@skeeve.com>
1042
* main.c, msg.c: Add a call to fflush(NULL) before each call
1043
to abort(), since GLIBC 2.27 doesn't necessarily flush before
1044
aborting. Thanks to Nelson H.F. Beebe for the report.
1046
2018-02-09 Arnold D. Robbins <arnold@skeeve.com>
1048
* io.c (socketopen): Rearrange assigning the flags to use
1049
AI_ADDRCONFIG only if family is AF_UNSPEC. Thanks to
1050
Houder <houder@xs4all.nl> for the report and initial
1053
2018-02-07 Andrew J. Schorr <aschorr@telemetry-investments.com>
1055
Print +"01" should print "1", not "01".
1056
* interpret.h (Op_unary_plus): Need to make a new number node that does
1057
not contain the original string representation. The logic is copied
1058
from Op_unary_minus.
1059
* mpfr.c (mpg_interpret): Add new case for Op_unary_plus based on
1060
the Op_unary_minus logic. We need a fresh number node that does not
1063
2018-01-28 Arnold D. Robbins <arnold@skeeve.com>
1065
* config.guess, config.sub: Updated.
1067
2018-01-25 Arnold D. Robbins <arnold@skeeve.com>
1069
* main.c (main): Add explanatory comment about O_APPEND stuff.
1072
2018-01-22 Arnold D. Robbins <arnold@skeeve.com>
1074
Fix the inplace tests on *BSD systems.
1076
* main.c (main): Add O_APPEND flag to fileno(stderr).
1078
2018-01-17 Arnold D. Robbins <arnold@skeeve.com>
1080
* builtin.c (do_isarray): Check that tmp is Node_var
1081
before calling DEREF. Thanks to Denis Shirokov
1082
<cosmogen@gmail.com> for the report.
1084
2018-01-15 Arnold D. Robbins <arnold@skeeve.com>
1086
* NEWS: Small typo fix.
1087
* config.sub: Updated.
1088
* io.c (fork_and_open_slave_pty): Rationalize down to one
1089
function with two bodies.
1090
(set_slave_pty_attributes, push_pty_line_disciplines): Move
1091
into #ifdef for TERMIOS_H. Helps out with VMS compiling.
1093
2018-01-12 Arnold D. Robbins <arnold@skeeve.com>
1095
* gawkapi.h: Remove extraneous '*' on parameters of
1096
type awk_ext_id. Thanks to Andrew Schorr for the report.
1098
2018-01-11 Arnold D. Robbins <arnold@skeeve.com>
1100
* compile, config.guess, config.rpath, config.sub,
1101
depcomp: Updated from GNULIB.
1103
2018-01-08 John E. Malmberg <wb8tyw@qsl.net>
1105
* io.c (set_slave_pty_attributes): Currently no termios on VMS.
1106
(set_slave_pty_attributes): No fork on VMS.
1108
2018-01-04 Arnold D. Robbins <arnold@skeeve.com>
1110
Refactor handling of slave pty. On AIX and HP-UX open
1111
slave in the child. Otherwise open slave in the parent
1112
before forking (restoring code mostly from 4.1.3). Thanks
1113
to Andrew Schorr for the bug report.
1115
* io.c (fork_and_open_slave_pty): New routine. Two versions.
1116
(set_slave_pty_attributes): New routine. Common code used by
1117
both versions of fork_and_open_slave_pty.
1118
(push_pty_line_disciplines): New routine. Common code used by
1119
both versions of fork_and_open_slave_pty.
1120
(two_way_open): Call fork_and_open_slave_pty instead of
1123
2018-01-03 Arnold D. Robbins <arnold@skeeve.com>
1125
* main.c (UPDATE_YEAR): Move to 2018. Revise copyright year.
1126
* NEWS: Bring up to date.
1128
2018-01-02 Arnold D. Robbins <arnold@skeeve.com>
1130
If ROUNDMODE changes, cause cached string conversions
1131
to become invalid. Thanks to Nethox <nethox@gmail.com>
1132
for the report. Day 1 bug from 4.1.0 release.
1134
In all the below files, bump copyright year, too.
1136
* array.c (value_info): Include strndmode in the output.
1137
* awk.h (NODE): New member, strndmode.
1138
(MPFR_round_mode): Add extern declaration.
1139
(force_string_fmt): Check s->strnmode against MPFR_round_mode.
1140
* awkgram.y (set_profile_text): Set n->strndmode to MPFR_round_mode.
1141
* builtin.c (do_print): Remove tests and just call force_string_fmt.
1142
* field.c (set_record): Set n->strndmode to MPFR_round_mode.
1143
* gawkapi.c (api_sym_update_scalar): Set r->strndmode to
1145
* interpret.h (r_interpret): For Op_assign_concat, set t1->strndmode
1147
* mpfr.c (MPFR_round_mode): Define and initialize.
1148
(mpfr_format_val): Set s->strndmode to MPFR_round_mode.
1149
(set_ROUNDMODE): Update MPFR_round_mode when ROUNDMODE changes
1151
* node.c (r_format_val): Set s->strndmode to MPFR_round_mode.
1152
(make_str_node): Set r->strndmode to MPFR_round_mode.
1153
* str_array.c (str_kilobytes): Update a comment.
1154
* symbol.c (check_param_names): Set n.strndmode to MPFR_round_mode.
1156
2017-12-24 Arnold D. Robbins <arnold@skeeve.com>
1158
Avoid some compiler warnings. Thanks to Michal Jaegermann
1159
<michal.jnn@gmail.com> for the report.
1161
* builtin.c (do_strftime): Initialize save.
1162
(do_dcgetttext): Initialize save and save2.
1163
(do_dcngettext): Ditto.
1164
(do_bindtextdomain): Initialize save and save1.
1168
* main.c (optlist): Make 'L' option's argument optional, to
1169
match --lint. Thanks to Manuel Collado <mcollado2011@gmail.com>
1172
2017-12-22 Arnold D. Robbins <arnold@skeeve.com>
1174
* config.guess, config.sub, depcomp, install-sh: Updated
1177
2017-12-20 Arnold D. Robbins <arnold@skeeve.com>
1179
* configure.ac: Add --enable-versioned-dir option for a
1180
directory with API version in it to hold extensions.
1182
2017-12-19 Arnold D. Robbins <arnold@skeeve.com>
1184
* configure.ac: Remove x's from `test "x$something" = "xyes"
1185
kinds of things. With correct quoting, the x isn't needed.
1186
(DYNAMIC): Remove use of -Wl,-export-dynamic on Linux
1187
and FreeBSD. It was needed for old-style extensions, which are
1188
no longer supported.
1190
2017-12-10 Arnold D. Robbins <arnold@skeeve.com>
1192
* awkgram.y: For '!' optimization on a string constant, don't
1193
apply the optimization if it's a translatable string. Thanks
1194
to Jeremy Feusi <jeremy@feusi.co> for the report.
1196
2017-11-25 Andrew J. Schorr <aschorr@telemetry-investments.com>
1198
* debug.c (do_set_var): As in interpret.h (Op_store_field), we should
1199
call the assign function before unref to give it a chance to copy
1200
any non-malloced $n string values before freeing $0.
1202
2017-11-14 Andrew J. Schorr <aschorr@telemetry-investments.com>
1204
* mpfr.c (get_rnd_mode): Fix MPFR_RNDA comment.
1206
2017-11-14 Andrew J. Schorr <aschorr@telemetry-investments.com>
1208
Fix corruption when $0 is reassigned while other NODEs have open
1209
references to $n. Thanks to Eric Pruitt <eric.pruitt@gmail.com> for
1212
* field.c (purge_record): For each $n field variable, if valref > 1
1213
and it has not already been malloced, make a copy of the string, since
1214
$0 is about to be reset.
1215
* interpret.h (Op_store_field): We must call the assign function
1216
before unref, since we must copy any non-malloced $n string values
1219
2017-11-09 Arnold D. Robbins <arnold@skeeve.com>
1221
* main.c (usage): Add a note to not post bugs in comp.lang.awk.
1224
2017-11-08 Arnold D. Robbins <arnold@skeeve.com>
1226
* gawkapi.h (AWK_NUMBER_TYPE): Move this enum out to the
1227
top level so that it works correctly with C++.
1229
2017-10-24 Arnold D. Robbins <arnold@skeeve.com>
1231
* NEWS: Updated with info about OS/2.
1233
2017-10-21 Arnold D. Robbins <arnold@skeeve.com>
1235
* awkgram.y: For string concatenation, don't fold constants
1236
if one or the other is translatable. Thanks to Harald van Dijk
1237
<harald@gigawatt.nl> for the report.
1239
2017-10-21 KO Myung-Hun <komh78@gmail.com>
1241
* nonposix.h [__KLIBC__]: Include dlfcn.h, declare os2_dlsym, and
1242
redirect dlsym to os2_dlsym. Declare os2_fixdllname. Declare
1243
os2_dlopen and redirect dlopen to os2_dlopen.
1244
* io.h (find_source) [__EMX__]: Truncate extension file basename
1247
2017-10-19 Arnold D. Robbins <arnold@skeeve.com>
1249
* 4.2.0: Release tar ball made.
1251
2017-10-17 Andrew J. Schorr <aschorr@telemetry-investments.com>
1253
* NEWS: Actually, isarray is not deprecated in this release.
1254
* builtin.c (do_isarray): Remove lint warning deprecating isarray.
1256
2017-10-14 Arnold D. Robbins <arnold@skeeve.com>
1258
* field.c (do_split): Simplify the lint warnings.
1259
Based on suggested code by Eric Pruitt <eric.pruitt@gmail.com>.
1263
* awkgram.y (check_funcs): Remove the REALLYMEAN ifdef and
1264
simplify the lint checking code for function defined but not
1265
called or called but not defined.
1267
2017-10-13 Arnold D. Robbins <arnold@skeeve.com>
1269
Assume a more C99 environment:
1271
* awk.h: Assume we have limits.h, stdarg.h and stdbool.h.
1272
* configure.ac: Remove checks for limits.h and stdarg.h.
1274
2017-10-10 Arnold D. Robbins <arnold@skeeve.com>
1276
* configure.ac: Remove --with-whiny-user-strftime option.
1278
* ChangeLog.0: Fix a typo. :-)
1280
2017-10-08 Arnold D. Robbins <arnold@skeeve.com>
1282
* command.y: Fix the FSF's address.
1284
2017-10-08 Arnold D. Robbins <arnold@skeeve.com>
1286
* NEWS: Rationalized with respect to stuff on the API.
1287
Also rationalized with respect to the pretty printer changes.
1289
2017-10-04 Andrew J. Schorr <aschorr@telemetry-investments.com>
1291
* README: Fix grammar by removing a stray word.
1293
2017-10-04 Arnold D. Robbins <arnold@skeeve.com>
1295
* NEWS: Add a note about OS/2 not working.
1297
2017-10-02 Arnold D. Robbins <arnold@skeeve.com>
1299
Undo change of 2014-09-07:
1301
* configure.ac: Remove the undocumented option to enable locale
1302
letters in identifiers.
1303
* awkgram.y (is_alpha): Remove related code.
1305
2017-10-02 Arnold D. Robbins <arnold@skeeve.com>
1307
* config.guess, config.sub: Updated.
1309
2017-09-28 Arnold D. Robbins <arnold@skeeve.com>
1311
* io.c (devopen): Move declaration of `cp' to where it's first used.
1313
2017-09-18 Arnold D. Robbins <arnold@skeeve.com>
1315
* README: Update required version of texinfo.tex.
1316
* compile, config.guess, config.sub, depcomp: Updated.
1318
2017-09-17 Arnold D. Robbins <arnold@skeeve.com>
1320
* gawkapi.h: Small changes to make it usable with C++.
1322
2017-09-13 Arnold D. Robbins <arnold@skeeve.com>
1324
* Makefile.am (command.c): Don't need the dependency on awkgram.c
1326
* bisonfix.awk: Removed.
1327
* README: Revised to describe use of Bison exclusively.
1329
2017-09-13 Andrew J. Schorr <aschorr@telemetry-investments.com>
1331
* Makefile.am (awkgram.c): Use -o option to bison. Get rid of
1332
messing with y.tab.h, that was obsolete.
1333
(EXTRA_DIST): Don't need bisonfix.awk anymore.
1335
2017-09-12 Petr Ovtchenkov <ptr@void-ptr.info>
1336
Andrew J. Schorr <aschorr@telemetry-investments.com>
1338
* Makefile.am (command.c): Make dependant on awkgram.c so
1339
that bison is run serially with make -j. Use -o option so
1340
that we no longer need bisonfix.awk in this rule.
1342
2017-08-28 Arnold D. Robbins <arnold@skeeve.com>
1344
* interpret.h (r_interpret): Add some casts to avoid warning
1345
messages in printf statements.
1349
* configure.ac: Add check for gai_strerror.
1350
* io.c (socketopen): Use gai_strerror to add more information
1351
if getaddrinfo fails.
1353
2017-08-25 Pat Rankin <r.pat.rankin@gmail.com>
1355
* builtin.c (TYPE_MINIMUM): Use type uintmax_t for the calculation,
1356
deferring the cast to the target type until the final result.
1358
2017-08-27 Juan Manuel Guerrero <juan.guerrero@gmx.de>
1360
* mbsupport.h [__DJGPP_]: Provide multi-byte specific declarations
1361
and definitions for DJGPP.
1363
2017-08-23 Arnold D. Robbins <arnold@skeeve.com>
1365
* README.git: Minor edits to make build steps clearer.
1367
2017-08-21 Daniel Richard G. <skunk@iSKUNK.ORG>
1369
* awk.h (c_func): Renamed to c_function to avoid conflict.
1371
* ext.c, interpret.h: Ditto.
1372
* configure: Regenerated after update to m4/arch.m4.
1374
2017-08-18 Arnold D. Robbins <arnold@skeeve.com>
1376
* debug.c (do_set_var): Fix typos in error messages.
1377
Thanks to Jean-Philippe Guerard
1378
<jean-philippe.guerard@xn--tigreray-i1a.org> for the report.
1380
2017-08-17 Arnold D. Robbins <arnold@skeeve.com>
1382
* field.c (rebuild_record): Set new fields valref to 1 if
1383
original field's valref was > 1. Update the comment. Found
1385
* mpfr.c (do_mpfr_compl): Fix typo in warning message.
1386
Thanks to Jean-Philippe Guerard
1387
<jean-philippe.guerard@xn--tigreray-i1a.org> for the report.
1388
* NEWS: Mention the Italian translation of the manual.
1390
2017-08-16 Arnold D. Robbins <arnold@skeeve.com>
1392
* gawkapi.c (assign_number): Clean up the code a bit.
1393
(api_get_mpfr, api_get_mpz): Add return NULL in non-MPFR case
1394
to avoid compiler warnings.
1396
2017-08-16 Arnold D. Robbins <arnold@skeeve.com>
1398
* config.guess: Update from GNULIB.
1399
* NEWS, README: Updated in preparation for release.
1401
2017-08-16 Andrew J. Schorr <aschorr@telemetry-investments.com>
1403
* gawkapi.c (assign_number): Add 'ifdef HAVE_MPFR' tests to get this
1404
to build in the absence of MPFR.
1406
2017-08-13 Arnold D. Robbins <arnold@skeeve.com>
1408
* gawkapi.h (gawk_api_major_version): Reset to 2 after merging
1409
in feature/api-mpfr branch.
1410
* NEWS: `intdiv' is not built-in; remove the entry for up and update
1411
numbering. Add note about API supporting GMP and MPFR values.
1413
2017-08-09 Arnold D. Robbins <arnold@skeeve.com>
1415
* gawkapi.h (check_mpfr_versions): Define differently based on if
1416
MPFR version macro is defined. Enhance body to use do/while(0).
1417
(dl_load): Call check_mpfr_versions unconditionally.
1419
2017-08-09 Arnold D. Robbins <arnold@skeeve.com>
1421
* main.c (usage): Add URL for Bug reporting info to the help message.
1425
* str_array.c (str_lookup): Make a copy of the string if it
1426
came from Nnull_string or a null field. Thanks to
1427
Daniel Pettet for the report.
1429
2017-08-04 Arnold D. Robbins <arnold@skeeve.com>
1431
* array.c, awk.h, awkgram.y, builtin.c, cint_array.c,
1432
cmd.h, debug.c, eval.c, ext.c, field.c, gawkapi.c, gawkmisc.c,
1433
gettext.h, int_array.c, main.c, mpfr.c, msg.c, node.c, profile.c,
1434
re.c, str_array.c, symbol.c: Update copyright years.
1436
2017-08-04 Arnold D. Robbins <arnold@skeeve.com>
1438
* config.guess, mkinstalldirs: Updated from GNULIB.
1440
2017-08-01 Juan Manuel Guerrero <juan.guerrero@gmx.de>
1442
Bring DJGPP support up to speed.
1444
* awk.h: Add DJGPP in #if for include of nonposix.h
1445
* nonposix.h (btowc, putwc): Add declarations for DJGPP.
1447
2017-07-26 Arnold D. Robbins <arnold@skeeve.com>
1449
* awk.h (validate_qualified_name): Return type back to bool.
1450
* awkgram.y (validate_qualified_name): Return type back to bool.
1451
(lookup_builtin): Make allowances for `awk::' prefix on name.
1452
* interpret.h (r_interpret): For indirect call, always pass true
1453
for do_qualify argument of lookup.
1454
* main.c (main): Make note of errors in -v values, use this
1455
to exit failure if any happen. Only change current_namespace
1456
to 'awk::' if doing pretty printing.
1457
(arg_assign): If validate_qualified name returns false, error out.
1459
2017-07-26 Arnold D. Robbins <arnold@skeeve.com>
1461
* awkgram.y (set_namespace): Change return type void, adjust
1462
all return statements.
1463
[@namespace]: Don't YYABORT on bad namespace so that we can check
1464
the rest of the program.
1465
(validate_qualified_name): Check traditional / posix first. Return
1466
after printing an error message; we don't want to print multiple
1467
messages for the same identifer.
1468
* interpret.h (r_interpret): For indirect call, set do_qualify
1469
parameter of lookup based on presence of a colon.
1471
2017-07-20 Arnold D. Robbins <arnold@skeeve.com>
1473
Make qualified names work with -v and command-line assignments.
1475
* awk.h (validate_qualified_name, check_qualified_name): Declare.
1476
* awkgram.y (validate_qualified_name): No longer static.
1477
(check_qualified_name): Ditto.
1478
* main.c (arg_assign): Allow colons in identifiers. If not a
1479
bad identifier, call validate_qualified_name and instead of
1480
check_special use check_qualified_name.
1482
2017-07-17 Arnold D. Robbins <arnold@skeeve.com>
1484
Allow identifiers that are gawk extensions to be used as plain
1485
identifiers outside the "awk" namespace. Make the real
1486
builtins available via awk::builtin_name(). Standard awk reserved
1487
words and builtin functions remain reserved.
1489
* awk.h (getfname): Add boolean parameter to prepend namespace
1491
* awkgram.y (check_qualified_name): New function. Enforces that
1492
standard awk reserved words and functions aren't allowed, and
1493
allows awk::gawk_extension from non-"awk" namespace.
1494
[direct_func_call]: Always convert name to fully qualified.
1495
(getfname): Add boolean parameter to prepend namespace
1496
or not. Adjust code.
1497
(yylex): Separate out validation code from code building the
1498
NAME token. Use check_qualified_name to decide if token is
1499
special instead of check_special.
1500
(validate_qualified_name): Just checks the form of the fully
1502
* debug.c (print_instruction): Update call to getfname.
1503
* profile.c (pprint): Update call to getfname.
1505
2017-07-17 Arnold D. Robbins <arnold@skeeve.com>
1507
* awkgram.y [direct_func_call]: Save full variable name for
1510
2017-07-17 Arnold D. Robbins <arnold@skeeve.com>
1512
* awkgram.y [non_post_simp_exp]: Merge LEX_BUILTIN and
1513
LEX_LENGTH expansions.
1514
(lookup_builtin): Move MPFR test to after test for sub builtin.
1516
* awkgram.y [non_post_simp_exp]: Unmerge LEX_BUILTIN and
1517
LEX_LENGTH expansions. This introduced a reduce/reduce
1518
conflict, and those are bad. I don't know why I didn't
1519
notice this earlier. Sigh.
1521
2017-07-15 Arnold D. Robbins <arnold@skeeve.com>
1523
Revert change of 2016-07-24 that always runs the dfa
1524
matcher. Based on a bug report from Alexandre Oliva
1525
<lxoliva@fsfla.org>, DFA can cause gawk to hang, even
1528
* re.c (research): Don't use dfa if need_start is true.
1530
2017-07-13 Arnold D. Robbins <arnold@skeeve.com>
1532
More rationalization of the namespace code.
1534
* awk.h (is_valid_identifier): Declare.
1535
* awkgram.y (grammar: direct_func_call): Store the fully qualified
1536
name in the op code.
1537
(yylex): Disallow reserved words and functions as namespace name.
1538
(check_params): Small code edit
1539
(validate_qualified_name): Use is_lsetter.
1540
(set_namespace): Check for NULL pointer first! Use is_valid_identifier
1541
instead of inline code. Disallow using reserved words as namespace
1543
* ext.c (is_valid_identifier): No longer static.
1544
(make_builtin): Check name and namespace against reserved words and
1545
fatal error if found.
1546
* gawkapi.c (ns_lookup): New function to look for variables
1548
(api_sym_lookup): Check namespace for validity and use ns_lookup.
1549
(api_sym_update): Ditto.
1550
* profile.c (pp_print): Correctly print full function name
1553
2017-07-11 Arnold D. Robbins <arnold@skeeve.com>
1555
Continue adding namespace support to the extension API.
1557
* awk.h (make_builtin): Add leading name_space parameter.
1558
* ext.c (make_builtin): Add leading name_space parameter.
1559
Do the appropriate checking and building of a name before
1560
installing in the symbol table.
1561
* gawkapi.c (add_ext_func): Use name_space, not namespace.
1562
Check that the parameter isn't NULL.
1563
(api_sym_lookup, api_sym_update): Use name_space, not namespace.
1564
* gawkapi.h: Use name_space, not namespace, everywhere.
1566
2017-07-11 Arnold D. Robbins <arnold@skeeve.com>
1568
* awk.h (is_letter): Add declaration.
1569
* ext.c (is_valid_identifier): New function.
1570
(make_builtin): Use is_valid_identifier instead of inline code.
1571
(is_letter): Moved from here ...
1572
* awkgram.y (is_letter): ... to here.
1573
(yylex): Use is_letter instead of a test.
1574
* command.y (yylex): Ditto.
1575
* main.c (arg_assign): Ditto.
1577
2017-07-07 Arnold D. Robbins <arnold@skeeve.com>
1579
Remove warnings from GCC 7.1 compilation.
1581
* awk.h (fatal_tag_valid): Change type to int.
1582
* awkgram.y (yylex): Set did_newline to true instead of using ++.
1583
* builtin.c (format_tree): Set lj to true instead of using ++.
1584
* cmd.h (pager_quit_tag_valid): Change type to int.
1585
* debug.c (pager_quit_tag_valid): Change type to int.
1586
(do_clear): Make bp_found an int, change uses.
1587
(do_run): Treat fatal_tag_valid as an int.
1588
* msg.c (fatal_tag_valid): Change type to int.
1590
2017-07-07 Arnold D. Robbins <arnold@skeeve.com>
1592
* awkgram.y (yyerror): Produce better diagnostics for source
1593
files that are not whole syntactic units.
1595
* gawkapi.c (api_sym_lookup, api_sym_update): Add namespace parameter.
1597
* gawkapi.h (api_sym_lookup, api_sym_update): Add namespace parameter.
1598
(api_sym_lookup_ns, api_sym_update_ns): New macros.
1599
(api_sym_lookup, api_sym_update): Adjust macro bodies.
1601
2017-07-07 Arnold D. Robbins <arnold@skeeve.com>
1603
* gawapi.h: Bring descriptive comments up to date, minor edits.
1604
* io.c: Add some initial comments to functions where they were missing.
1606
2017-07-03 Arnold D. Robbins <arnold@skeeve.com>
1608
* gawkapi.h, gawkapi.c: Typo fixes in comments.
1610
2017-07-01 Arnold D. Robbins <arnold@skeeve.com>
1612
* symbol.c (install): Don't call fix_up_namespace if
1613
installing parameters.
1614
* profile.c (remove_namespace): Renamed to
1615
(adjust_namespace): Make smarter and add boolean parameter for
1616
if return was mallc'ed. Adjust calls.
1618
2017-06-30 Arnold D. Robbins <arnold@skeeve.com>
1620
Add namespace info into Op_Rule and Op_Func.
1621
Fix memory management problem.
1622
The changes temporarily break the test suite.
1624
* awk.h (MAX_INSTRUCTION_ALLOC): Increase to 4.
1625
(Op_K_namespace): Remove, not needed.
1626
* eval.c (optypetab): Remove Op_K_namespace.
1627
* awkgram.y (make_pp_namespace): New function.
1628
(yylex): For BEGIN etc, allocate 4 in the instruction.
1629
(install_func): Save namespace name for Op_rule.
1630
(append_rule): Save namespace name for Op_rule.
1631
* debug.c (print_instruction): Print namespace for Op_rule, Op_func.
1632
Remove Op_K_namespace.
1633
* profile.c (pp_namespace, remove_namespace): New functions.
1634
(pprint): Call `pp_namespace'. Use `remove_namespace' on variable
1636
(pp_func): Ditto on both.
1637
* symbol.c (lookup): Initialize `malloced' to false.
1640
Unbreak the test suite:
1642
* awk.h (namespace_changed): Declare new boolean variable.
1643
* awkgram.y (namespace_changed): Define new boolean variable.
1644
(set_namespace): Set it to true when the namespace is changed.
1645
* main.c (main): Set current_namespace to "awk::" for the pretty
1647
* profile.c (pp_namespace): If namespace_changed is false, return.
1649
2017-06-28 Arnold D. Robbins <arnold@skeeve.com>
1651
* awk.h [ns_name]: Add macro in preparation for use.
1652
* debug.c (print_instruction): Add case for Op_K_namespace.
1653
Not really used yet.
1654
* symbol.c (fix_up_namespace): Bug fix to always allocate
1655
memory for a full name. Add boolean parameter to indicate
1656
if memory was malloc'ed or not.
1657
(lookup): Adjust call to fix_up_namespace and use make_str_node
1658
if the string was malloced.
1661
2017-06-26 Arnold D. Robbins <arnold@skeeve.com>
1663
* configure.ac: Turn a tab into a space in AC_DEFINE(SUPPLY_INTDIV).
1665
2017-06-25 Andrew J. Schorr <aschorr@telemetry-investments.com>
1667
* gawkmisc.c (xmalloc): Remove function now in support/xalloc.h.
1669
2017-06-22 Arnold D. Robbins <arnold@skeeve.com>
1671
Make pretty-printing include parentheses that were explicitly
1672
in the source code. Thanks to Hermann Peifer for the bug report.
1674
* awk.h (OPCODE): Add Op_parens.
1675
* awkgram.y [Grammar]: If pretty-printing, add Op_parens ot end of
1676
list for parenthesized expression.
1677
* eval.c (optypetab): Add Op_parens.
1678
* interpret.h (r_interpret): Ditto.
1679
* profile.c (pprint): Ditto. For ?:, don't parenthesize it.
1680
(pp_parenthesize): If string starts with left paren, return early.
1681
(parenthesize): Don't call div_on_left_mul_on_right.
1682
(div_on_left_mul_on_right): Remove function.
1683
(pp_concat): Don't add parentheses if expressions already have them.
1686
2017-06-21 Andrew J. Schorr <aschorr@telemetry-investments.com>
1688
Replace malloc/memset combinations with calloc by using the new ezalloc
1690
* awkgram.y (yyerror, do_add_srcfile, funcuse): Replace emalloc+memset
1692
* cint_array.c (cint_lookup, cint_copy, tree_lookup, tree_copy,
1693
leaf_lookup, leaf_copy): Ditto.
1694
* command.y (mk_cmdarg): Ditto.
1695
* debug.c (add_item): Ditto.
1696
* eval.c (setup_frame): Ditto.
1697
* field.c (set_record): Ditto.
1698
* gawkapi.c (api_flatten_array_typed): Ditto.
1699
* int_array.c (int_copy, grow_int_table): Ditto.
1700
* io.c (init_awkpath, iop_alloc): Ditto.
1701
* node.c (str2wstr): Ditto.
1702
* re.c (make_regexp): Ditto.
1703
* str_array.c (str_copy, grow_table): Ditto.
1704
* symbol.c (make_params, new_context): Ditto.
1706
2017-06-19 Andrew J. Schorr <aschorr@telemetry-investments.com>
1708
* awk.h (ezalloc): Add new macro to allocate memory initialized to zero.
1709
(ezalloc_real): New inline function to call calloc.
1710
* gawkapi.h (ezalloc): Add new API macro to allocate memory initialized
1713
2017-06-18 Arnold D. Robbins <arnold@skeeve.com>
1715
* builtin.c (mbc_char_count): Fix code to correctly traverse
1716
the string. Thanks to Hermann Peifer for the bug report.
1717
* config.guess, config.sub: Update to latest from GNULIB.
1718
* gettext.h: Pull in a few nice changes from GNULIB version.
1720
2017-06-16 Arnold D. Robbins <arnold@skeeve.com>
1722
* awk.h (lookup): Add second parameter.
1723
* array.c (assoc_list): Adjust call to lookup.
1724
* awkgram.y (grammar, parms_shadow, install_function, variable):
1726
* command.y [Grammar]: Ditto.
1727
* debug.c (find_symbol): Ditto.
1728
* ext.c (make_builtin): Ditto.
1729
* gawkapi.c (api_sym_lookup, api_sym_update): Ditto.
1730
* interpret.h (r_interpret): Ditto.
1731
* main.c (arg_assign): Ditto.
1732
(main): Reset current_namespace after parsing.
1733
* symbol.c (lookup): New second parameter, do_qualify. Use it
1734
to qualify names or not.
1735
(install): Call fix_up_namespace.
1736
(is_all_upper): New helper routine.
1737
(fix_up_namespace): New function.
1739
2017-06-13 Arnold D. Robbins <arnold@skeeve.com>
1741
* awk.h (awk_namespace, current_namespace): Move to const char.
1742
(SRCFILE): Add namespace element.
1743
* awkgram.y (awk_namespace, current_namespace): Move to const char.
1744
(set_namespace): New function.
1746
(tokentab): Add "namespace" entry.
1747
(include_source): Push the current namespace.
1748
(next_sourcefile): Pop the current namespace.
1749
(yylex): Add lint warning if a reserved word is used as a namespace
1751
(validate_qualified_name): Make it an error to use a reserved
1752
word as the second part of a fully qualified name.
1754
2017-06-11 Arnold D. Robbins <arnold@skeeve.com>
1756
* awk.h (awk_namespace, current_namespace): Declare.
1757
(opcodeval): Add Op_K_namespace.
1758
* awkgram.y (awk_namespace, current_namespace): Define.
1759
(LEX_NAMESPACE): Add lexing and parsing of `@namespace directive'.
1760
(tokentab): Add "namespace" entry.
1761
(yylex): Check if first part of qualified identifier is
1762
a reserved word or function.
1763
* eval.c (optypetab): Add Op_K_namespace.
1765
2017-06-06 Arnold D. Robbins <arnold@skeeve.com>
1767
* awkgram.y (yylex): Allow :: in identifiers (the "NAME" token).
1768
Use validate_qualified_name to check it.
1769
(validate_qualified_name): New function.
1771
2017-05-30 Arnold D. Robbins <arnold@skeeve.com>
1773
* awkgram.y (nextc): Force -e chunks to be syntactic units.
1774
Needed for namespaces to work correctly.
1776
2017-05-30 Arnold D. Robbins <arnold@skeeve.com>
1778
* NEWS: Mention PROCINFO["argv"].
1780
2017-05-24 Andrew J. Schorr <aschorr@telemetry-investments.com>
1782
* field.c (set_FIELDWIDTHS): Add check to protect against blank
1783
characters after a `:' skip separator.
1784
Fix field number in error message, thanks to a bug report
1785
from Michal Jaegermann.
1787
2017-05-23 Andrew J. Schorr <aschorr@telemetry-investments.com>
1789
* field.c (set_FIELDWIDTHS): Simplify the logic and consistentify
1790
use of UINT_MAX. Make sure that negative value after : is caught.
1792
2017-05-23 Arnold D. Robbins <arnold@skeeve.com>
1794
* field.c (fw_parse_field): Stop upon hitting the end of the
1795
record; this enables correct counting of the number of fields.
1796
(set_FIELDWIDTHS): Add `*' at end as meaning ``all the rest
1797
of the data on the line.'' Allow skip:* as well.
1798
* NEWS: Update information about FIELDWIDTHS.
1800
2017-05-20 Arnold D. Robbins <arnold@skeeve.com>
1802
* awkgram.y (add_lint): Make ``no effect'' check smarter about
1803
reporting line numbers.
1805
2017-05-01 Arnold D. Robbins <arnold@skeeve.com>
1807
* awkgram.y (nextc): Fix to change of 2017-04-24 such that
1808
@include works in multibyte locales. Thanks to Hermann
1809
Peifer for the bug report.
1811
2017-04-26 Andrew J. Schorr <aschorr@telemetry-investments.com>
1813
* awkgram.y (make_regnode): Fix bug -- we should not set valref to 1
1814
when creating a node of type Node_regex, since valref is appropriate
1815
only for Node_val nodes. This fixes a bug introduced in commit
1816
687e6594. Also, add an assert to make it clear that this function
1817
supports only Node_regex and Node_dynregex.
1818
* awk.h (NODE): Restore sref to the `val' subportion, since it is not
1819
really needed for Node_regex, now that the bug in make_regnode has
1821
(valref): Restore macro definition.
1823
2017-04-24 Arnold D. Robbins <arnold@skeeve.com>
1825
* awk.h (NODE): Additional cleanups. Removed `aq' and `param_list'
1826
elements from various unions and removed 'nextp' and
1827
`a_opaque' defines. None of these were in use.
1828
Rework the comment for valref, per suggestion from
1831
2017-04-23 Arnold D. Robbins <arnold@skeeve.com>
1833
* awkgram.y (nextc): Adjust so that 3.1.x behavior is restored
1834
whereby --source arguments are concatenated. Thanks to
1835
"Neil R. Ormos" <ormos-gnulists17@ormos.org> for the report.
1837
2017-04-21 Arnold D. Robbins <arnold@skeeve.com>
1839
* awk.h (NODE): Put the `val' subportion back the way it
1840
was and move valref (formerly sref) out of the unions
1841
entirely. This was the real problem. Rework the corresponding
1843
[valref]: Removed the macro definition.
1845
2017-04-20 Arnold D. Robbins <arnold@skeeve.com>
1847
* configure.ac: Make letter case usage in the various
1848
AC_ARG_ENABLE messages consistent with the rest of configure
1850
(--disable-mpfr): Add this option to make it easier
1851
to check compiles without MPFR. Motivated by:
1852
* awk.h (NODE): Rearrange the layout of the 'val' subportion
1853
of the union to fix alignment problems when compiling without
1854
MPFR. The problem only happened on 64-bit compiles, not
1857
2017-04-16 Arnold D. Robbins <arnold@skeeve.com>
1859
Rename intdiv it intdiv0 and require enabling at configure time.
1861
* awkgram.y (tokentab): Bracket intdiv0 in #ifdef SUPPLY_INTDIV.
1863
* builtin.c (do_intdiv): Bracket in #ifdef SUPPLY_INTDIV.
1864
* mpfr.c (do_mpfr_intdiv): Bracket in #ifdef SUPPLY_INTDIV.
1865
* configure.ac: Add --enable-builtin-intdiv0 option. If enabled,
1866
also revise doc/gawktexi.in.
1868
2017-04-16 Arnold D. Robbins <arnold@skeeve.com>
1870
* builtin.c (do_intdiv): Use DEREF on the arguments.
1871
Thanks to Andrew Schorr for finding the problem.
1872
* mpfr.c (do_mpfr_intdiv): Return -1 if numerator or denominator
1873
are not valid numbers. Unref various bits first.
1875
2017-04-13 Arnold D. Robbins <arnold@skeeve.com>
1877
* awk.h (make_number_node): Simplify.
1878
* mpfr.c (mpg_node): Change parameter name to `flags'.
1880
2017-04-12 Arnold D. Robbins <arnold@skeeve.com>
1882
* mpfr.c (mpg_format_val): Set STRCUR flag when we're done.
1883
Fixes a memory leak. Thanks to valgrind for the report.
1885
* builtin.c (do_dcgettext): Move declaration of reslen to
1886
outside the ifdefs. Thanks to Hermann Peifer for the report.
1888
* gawkapi.c (awk_value_to_node): Initialize ext_ret_val to NULL
1889
to avoid compiler warnings.
1891
2017-04-12 Manuel Collado <m-collado@users.sourceforge.net>
1893
Fix the FPAT bug reported by Ed Morton in the gawk-bug mailing list.
1895
* awk.h (Regexp): Remove the non_empty flag.
1896
* field.c (fpat_parse_field): Restructure the code to reduce complexity
1897
and document the new structure.
1899
* field.c (fpat_parse_field): Further restructuring to avoid
1900
invalid reads as reported by valgrind.
1902
2017-04-10 Andrew J. Schorr <aschorr@telemetry-investments.com>
1904
* awk.h (enum opcodeval): For the avoidance of doubt, specify that
1905
Op_illegal must equal zero.
1906
* symbol.c (bcfree): Improve clarity by setting opcode to Op_illegal
1908
(free_bc_mempool): Improve clarity by comparing opcode to Op_illegal
1911
* field.c (set_FIELDWIDTHS): Set use_chars to awk_true, since its
1914
2017-04-10 Arnold D. Robbins <arnold@skeeve.com>
1916
* symbol.c (free_bc_mempool): Change `first' from int to bool.
1918
2017-04-09 Andrew J. Schorr <aschorr@telemetry-investments.com>
1920
* field.c (fw_parse_field): Edit comment about resetting shift state.
1921
* gawkapi.h (awk_fieldwidth_info_t): Make white space more uniform.
1923
2017-04-08 Eli Zaretskii <eliz@gnu.org>
1925
* main.c (usage, copyleft) [__MINGW32__]:
1926
* io.c (non_fatal_flush_std_file, close_io) [__MINGW32__]: Call
1927
w32_maybe_set_errno to correctly set errno to EPIPE when appropriate.
1929
* awk.h (die_via_sigpipe) [__MINGW32__]: MinGW-specific definition.
1931
2017-04-07 Andrew J. Schorr <aschorr@telemetry-investments.com>
1933
* awk.h (INSTRUCTION_POOL): Redefine as an array of structures so we
1934
can track allocated blocks.
1935
* symbol.c (pools): Make it a pointer to avoid copying.
1936
(struct instruction_block): Define structure to hold a block of
1937
allocated instructions.
1938
(bcfree): Update to use new INSTRUCTION_POOL definition.
1939
(bcalloc): Allocate an instruction by searching first on the free
1940
list, second for free space in the current block, or third by
1941
allocating a new block.
1942
(set_context): Update to reflect that pools is now a pointer.
1943
(free_bc_mempool): New helper function to free a pool of a certain size.
1944
(fre_bcpool): Call free_bc_mempool for each pool.
1946
2017-04-04 Arnold D. Robbins <arnold@skeeve.com>
1948
* awk.h (INSTRUCTION): Add pool_size member.
1949
[MAX_INSTRUCTION_ALLOC]: New macro.
1950
(INSTRUCTION_POOL): New type.
1951
(struct context): Use INSTRUCTION_POOL.
1952
* array.c (assoc_list): Reorg the code a bit to make sure
1953
to always free the INSTRUCTIONs allocated for calling a
1954
user-supplied sorting function. Based on code by
1956
* symbol.c (free_bcpool): Rework to use an INSTRUCTION_POOL.
1957
(bcfree, bcalloc): Rework to use separate chains in
1958
the instruction pool.
1959
(set_context): Update appropriately.
1961
2017-03-27 Arnold D. Robbins <arnold@skeeve.com>
1963
* field.c (parse_field_func_t): New typedef. Used as needed.
1964
(fw_parse_field): Edit comment about resetting shift state.
1965
(set_parser): Fix leading comment's style and type of argument.
1966
(set_FIELDWIDTHS): Improve the fatal error message.
1967
* gawkapi.h: Minor edits in some comments.
1969
2017-03-27 Arnold D. Robbins <arnold@skeeve.com>
1971
Cause EPIPE errors to stdout to generate a real SIGPIPE.
1973
* awk.h (die_via_sigpipe): New macro.
1974
* builtin.c (efwrite): Use it.
1975
* io.c (non_fatal_flush_std_file): Ditto.
1976
* main.c (usage): Ditto.
1978
2017-03-25 Arnold D. Robbins <arnold@skeeve.com>
1980
* io.c (flush_io): Use r_fatal and r_warning for messagefunc
1983
2017-03-24 Arnold D. Robbins <arnold@skeeve.com>
1985
* builtin.c (efwrite): Exit successfully upon EPIPE, as SIGPIPE
1986
done. Improve error messages upon failure to write.
1987
(do_fflush): Update ERRNO for non-fatal flush failures.
1988
* io.c (non_fatal_flush_std_file): Update ERRNO when flush is
1990
(flush_io): If a redirect is marked non-fatal, only warning,
1993
2017-03-23 Arnold D. Robbins <arnold@skeeve.com>
1995
* config.sub: Updated again.
1997
2017-03-22 Andrew J. Schorr <aschorr@telemetry-investments.com>
1999
* NEWS: Document new PROCINFO["FS"] value of "API".
2001
2017-03-22 Andrew J. Schorr <aschorr@telemetry-investments.com>
2003
* NEWS: Document new FIELDWIDTHS skip capability and API input parser
2004
field parsing enhancement.
2006
2017-03-22 Andrew J. Schorr <aschorr@telemetry-investments.com>
2008
* gawkapi.h (awk_input_buf_t): Update get_record comment regarding the
2009
new field_width argument.
2011
2017-03-21 Andrew J. Schorr <aschorr@telemetry-investments.com>
2013
* gawkapi.h (awk_fieldwidth_info_t): Define new structure to contain
2014
API field parsing info, replacing the previous awk_input_field_info_t
2016
(awk_fieldwidth_info_size): Define macro to calculate size of the
2017
variable-length awk_fieldwidth_info_t structure.
2018
(awk_input_buf_t): Update get_record prototype to update the type
2019
of the final field_width argument from 'const awk_input_field_info_t **'
2020
to 'const awk_fieldwidth_info_t **'.
2021
* awk.h (set_record): Change 3rd argument from
2022
'const awk_input_field_info_t *' to 'const awk_fieldwidth_info_t *'.
2023
* io.c (inrec, do_getline_redir, do_getline): Change field_width type
2024
from 'const awk_input_field_info_t *' to
2025
'const awk_fieldwidth_info_t *'.
2026
(get_a_record): Change field_width argument type from
2027
'const awk_input_field_info_t **' to 'const awk_fieldwidth_info_t **'.
2028
* field.c (api_parser_override): Define new boolean to track whether
2029
API parsing is currently overriding default parsing behavior.
2030
(api_fw): Change type from 'const awk_input_field_info_t *'
2031
to 'const awk_fieldwidth_info_t *'.
2032
(FIELDWIDTHS): Change type from 'int *' to 'awk_fieldwidth_info_t *'.
2033
(set_record): Use new boolean api_parser_override to track whether
2034
API parsing override is in effect, since we can no longer discern
2035
this from the value of parse_field -- FIELDWIDTHS parsing uses the
2037
(calc_mbslen): New function to calculate the length of a multi-byte
2039
(fw_parse_field): Enhance to support the awk_fieldwidth_info_t
2040
structure instead of simply using an array of integer field widths.
2041
(api_parse_field): Remove function no longer needed since fw_parse_field
2042
now supports both FIELDWIDTHS and API parsing.
2043
(set_parser): Use api_parser_override instead of comparing parse_field
2045
(set_FIELDWIDTHS): Enhance to use new awk_fieldwidth_info_t structure
2046
and parse new skip prefix for each field.
2047
(current_field_sep): Use api_parser_override flag instead of comparing
2049
(current_field_sep_str): Ditto.
2051
2017-03-20 Arnold D. Robbins <arnold@skeeve.com>
2053
Improve handling of EPIPE. Problems reported by
2054
Alexandre Ferrieux <alexandre.ferrieux@orange.com>
2055
and David Kerns <david.t.kerns@gmail.com>.
2057
* awk.h (ignore_sigpipe, set_sigpipe_to_default,
2058
non_fatal_flush_std): Declare new functions.
2059
(ignore_sigpipe, set_sigpipe_to_default,
2060
non_fatal_flush_std): New macros.
2061
* builtin.c (do_fflush): When nonfatal not in force, flush
2062
of stdout/stderr and EPIPE exits, simulating SIGPIPE, as
2063
in nawk/mawk. Flush of other redirections with EPIPE now
2065
(do_system): Use ignore_sipipe and set_sigpipe_to_default
2066
instead of uglier inline ifdefed code.
2067
* main.c (main): Ditto.
2068
* io.c (redirect_string, two_way_open, gawk_popen): Ditto.
2069
(flush_io): Use non_fatal_flush_std for stdout and stderr.
2073
* config.guess, config.rpath, config.sub, install-sh:
2076
2017-03-16 Arnold D. Robbins <arnold@skeeve.com>
2078
* configure.ac: Some cleanups.
2080
2017-03-09 Andrew J. Schorr <aschorr@telemetry-investments.com>
2082
* gawkapi.h (awk_input_field_info_t): Define new structure to contain
2083
API field parsing info.
2084
(awk_input_buf_t): Update get_record prototype to use an array of
2085
awk_input_field_info_t instead of integers.
2086
* awk.h (set_record): Change 3rd argument from 'const int *' to
2087
'const awk_input_field_info_t *'.
2088
* field.c (api_fw): Now points to an array of awk_input_field_info_t
2089
instead of integers.
2090
(set_record): Change 3rd argument to point to an array of
2091
awk_input_field_info_t.
2092
(api_parse_field): Update parsing logic to use awk_input_field_info_t
2093
structures instead of an array of integers.
2094
* io.c (inrec, do_getline_redir, do_getline): Change field_width type
2095
from 'const int *' to 'const awk_input_field_info_t *'.
2096
(get_a_record): Change field_width argument type from 'const int **'
2097
to 'const awk_input_field_info_t **'.
2099
2017-03-09 Arnold D. Robbins <arnold@skeeve.com>
2101
* field.c: Minor style edits.
2103
2017-03-06 Andrew J. Schorr <aschorr@telemetry-investments.com>
2105
* field.c (normal_parse_field): Renamed from save_parse_field to reflect
2106
better its purpose. Added a comment to explain more clearly what's
2108
(set_record, set_parser): Rename save_parse_field to normal_parse_field.
2110
2017-03-06 Andrew J. Schorr <aschorr@telemetry-investments.com>
2112
* gawkapi.h (awk_input_buf_t): Remove field_width array and instead
2113
add it as a 6th argument to the get_record function. This should
2114
not break existing code, since it's fine to ignore the additional
2115
argument. Document the behavior of the field_width argument.
2116
* io.c (inrec): Pass pointer to field_width array to get_a_record,
2117
and then hand it off to set_record.
2118
(do_getline_redir): If not reading into a variable, pass pointer to
2119
field_width array to get_a_record and then hand it off to set_record.
2120
(do_getline): Ditto.
2121
(get_a_record): Add a 4th field_width argument to pass through to
2122
the API get_record method.
2124
2017-03-05 Andrew J. Schorr <aschorr@telemetry-investments.com>
2126
* awk.h (set_record): Add a new argument containing a field-width
2127
array returned by an API parser.
2128
(field_sep_type): Add new enum value Using_API.
2129
(current_field_sep_str): Declare new function.
2130
* field.c (save_parse_field): New static variable to save the
2131
parse_field value in cases where it's overridden by API parsing.
2132
(api_fw): New static variable to hold pointer to API parser fieldwidth
2134
(set_record): Add new field-width array argument. If present, API
2135
parsing will override the default parsing mechanism.
2136
(api_parse_field): New field parser using field widths supplied by the
2137
API. This is very similar to the existing fw_parse_field function.
2138
(get_field): Fix typo in comment.
2139
(set_parser): New function to set default parser and check whether
2140
there's an API parser override in effect. Update PROCINFO["FS"] if
2141
something has changed.
2142
(set_FIELDWIDTHS): Use set_parser and stop updating PROCINFO["FS"].
2145
(current_field_sep): Return Using_API when using the API field parsing
2147
(current_field_sep_str): New function to return the proper string
2148
value for PROCINFO["FS"].
2149
* gawkapi.h (awk_input_buf_t): Add field_width array to enable the
2150
parser get_record function to supply field widths to override the
2151
default gawk field parsing mechanism.
2152
* io.c (inrec): Pass iop->public.field_width to set_record as the
2153
3rd argument to enable API field parsing overrides.
2154
(do_getline_redir, do_getline): Ditto.
2155
* main.c (load_procinfo): Use new current_field_sep_str function
2156
instead of switching on the return value from current_field_sep.
2158
2017-02-23 Arnold D. Robbins <arnold@skeeve.com>
2160
* awk.h (boolval): Return bool instead of int.
2161
* eval.c (eval_condition): Same.
2162
* io.c (pty_vs_pipe): Same
2163
Thanks to Andrew Schorr for pointing these out.
2165
2017-02-21 Andrew J. Schorr <aschorr@telemetry-investments.com>
2167
* NEWS: Document that mktime now takes an optional utc-flag argument.
2168
* awkgram.y (tokentab): Modify mktime entry to indicate that it may
2169
accept two arguments.
2170
* builtin.c (mktime_tz): New function to run mktime in an arbitrary
2171
time zone. Code was copied from the Linux timegm man page.
2172
(do_mktime): Add support for new optional 2nd argument utc-flag by
2173
using the new mktime_tz function.
2174
(do_strftime): Change do_gmt type from int to bool.
2176
2017-02-17 Arnold D. Robbins <arnold@skeeve.com>
2178
* builtin.c (do_typeof): Handle arguments that have
2179
the NULL_FIELD flag set.
2181
2017-02-03 Andrew J. Schorr <aschorr@telemetry-investments.com>
2183
* awkgram.y (set_profile_text): Improve code clarity by using emalloc
2184
to allocate the string instead of abusing estrdup.
2186
2017-02-02 Arnold D. Robbins <arnold@skeeve.com>
2188
* awkgram.y (set_profile_next): Allocate an extra byte at the
2189
end for the NUL in case we add a sign. Thanks to Andrew Schorr
2190
for making me look at this code.
2192
And later in the same day:
2194
* awkgram.y (set_profile_next): Undo previous change, since estrdup
2195
handles it, but updated the comments.
2197
2017-02-01 Arnold D. Robbins <arnold@skeeve.com>
2199
* builtin.c (mbc_char_count): Remove spurious multiplies by
2200
gawk_mb_cur_max. Thanks to Andrew Schorr for making me look
2205
* awkgram.y (make_profile_number): Renamed to ...
2206
(set_profile_next): New function. All calls adjusted. Also improved
2207
use at MPFR number case.
2209
2017-01-28 Andrew J. Schorr <aschorr@telemetry-investments.com>
2211
* io.c (inetfile): Replace strncmp with memcmp in a few places, now
2212
that we are checking string length beforehand.
2214
2017-01-27 Andrew J. Schorr <aschorr@telemetry-investments.com>
2216
* io.c (redirect_string): Check explen positive before accessing *str.
2217
In lintwarn message, use explen string length. Pass length to inetfile.
2218
(devopen): Pass name length to inetfile.
2219
Stop assuming that remoteport is NUL-terminated.
2220
(two_way_open): Pass name length to inetfile.
2221
(inetfile): Stop assuming NUL string termination; add checks to avoid
2224
2017-01-27 Andrew J. Schorr <aschorr@telemetry-investments.com>
2226
* awk.h (str_terminate_f): New helper function for terminating a string
2228
(str_terminate): Macro wrapper to call str_terminate_f.
2229
(str_restore): New macro to restore the string.
2230
* builtin.c (do_strftime): Use str_terminate and str_restore.
2231
(do_dcgettext): Ditto, and remove saved_end flag since equivalent
2232
to testing (t2 != NULL). Fix overrun bug in calculating result
2233
length when !ENABLE_NLS.
2234
(do_dcngettext, do_bindtextdomain): Use str_terminate and str_restore.
2235
* interpret.h (Op_arrayfor_init, Op_indirect_func_call): Ditto.
2236
* str_array.c (env_remove): Ditto.
2238
2017-01-27 Andrew J. Schorr <aschorr@telemetry-investments.com>
2240
* interpret.h [UNFIELD]: Fix condition for assignment from
2241
value with valref == 1. Fixes problems introduced at gawk 4.1.2.
2243
2017-01-27 Arnold D. Robbins <arnold@skeeve.com>
2245
* interpret.h: Update copyright year.
2246
* debug.c (do_run): Rework error message to ease translation.
2247
Thanks to Rafael Fontenelle <rafaelff@gnome.org> and to
2248
Eli Zaretskii <eliz@gnu.org>.
2250
2017-01-26 Andrew J. Schorr <aschorr@telemetry-investments.com>
2252
* builtin.c (do_dcgettext): First argument also needs protection
2253
from string overrun.
2254
(do_dcngettext): Need to terminate string1 and string2 also,
2255
and replace strlen(the_result), which could overrun.
2256
(do_bindtextdomain): Terminate both string args, and eliminate
2257
saved_end boolean which is redundant with (t2 != NULL).
2259
2017-01-26 Andrew J. Schorr <aschorr@telemetry-investments.com>
2261
* interpret.h (Op_arrayfor_init): Protect against string overrun
2263
(Op_indirect_func_call): Terminate function name.
2265
2017-01-26 Andrew J. Schorr <aschorr@telemetry-investments.com>
2267
* str_array.c (env_remove): Terminate string before calling unsetenv.
2269
2017-01-26 Andrew J. Schorr <aschorr@telemetry-investments.com>
2271
* node.c (is_hex): Add a new argument pointing to the end of the string
2272
so we can check for string overrun.
2273
(r_force_number): Pass string end to is_hex.
2275
2017-01-26 Andrew J. Schorr <aschorr@telemetry-investments.com>
2277
* awk.h (get_numbase): Add string length argument so we can operate
2278
on unterminated strings.
2279
* awkgram.y: Call get_numbase with string length, and fix off-by-one
2280
error in length passed to nondec2awknum: should be strlen(tokstart)-1
2281
based on surrounding code.
2282
* builtin.c (do_strtonum): Pass string length to get_numbase.
2283
(nondec2awknum): Check string length before accessing characters.
2284
* mpfr.c (force_mpnum): Pass string length to get_numbase.
2285
* node.c (r_force_number): Pass string length to get_numbase.
2286
(get_numbase): Add string length argument and honor it.
2288
2017-01-26 Andrew J. Schorr <aschorr@telemetry-investments.com>
2290
* builtin.c (do_strftime): If format argument is passed, we need
2291
to terminate it in case it's a field variable.
2293
2017-01-26 Andrew J. Schorr <aschorr@telemetry-investments.com>
2295
* node.c (r_format_val): Before we free s->stptr, make sure that it
2297
(wstr2str): Add comment explaining why it's safe to free n->stptr
2298
without doing any checks.
2299
* mpfr.c (mpg_format_val): Ditto. And no need to reset the STRCUR flag
2300
that we just checked.
2302
2017-01-26 Andrew J. Schorr <aschorr@telemetry-investments.com>
2304
* awk.h (enum block_id): Remove BLOCK_INVALID, since it serves no
2305
useful purpose and seems to slow things down a bit.
2306
* node.c (nextfree): Remove first invalid entry.
2308
2017-01-25 Andrew J. Schorr <aschorr@telemetry-investments.com>
2310
* awk.h (BLOCK): Remove typedef. BLOCK was used for 2 different
2311
purposes: to contain a block allocation list header, and to hold
2312
each individual allocated item. This was confusing, because the "size"
2313
field was set only in the header, but not in each element.
2314
(struct block_header): The block header contains a pointer to the first
2315
element and the element size.
2316
(struct block_item): Represent a single allocated item. This contains
2317
only a pointer to the next element. This reduces the minimum allocated
2318
item size from 2 pointers to 1 (16 bytes to 8 bytes on x86_64).
2319
(nextfree): Change array item type from BLOCK to struct block_header.
2320
(getblock, freeblock): Change cast from 'BLOCK' to 'struct block_item'.
2321
* node.c (nextfree): Now an array of 'struct block_header' instead of
2322
BLOCK. Switch the ordering to put the next pointer before the size.
2323
(more_blocks): Replace 'BLOCK' with 'struct block_item', and add
2324
an assert to ensure that the allocation size is at least as large
2325
as 'struct block_item', i.e. 1 pointer.
2327
2017-01-22 Andrew J. Schorr <aschorr@telemetry-investments.com>
2329
* awk.h (numtype_choose): New backend macro used to implement
2330
various macros whose calculations depend on how a number is
2331
actually represented. This improves readability and should give
2332
a small performance improvement when not using extended precision.
2333
(get_number_ui, get_number_si, get_number_d, get_number_uj, iszero):
2334
Rewrite using new numtype_choose macro.
2336
2017-01-04 Arnold Robbins <arnold@skeeve.com>
2338
Trade space for time for programs that toggle IGNORECASE a lot.
2339
Brings 25% to 39% speedup. NODE does not actually grow in size.
2341
* awk.h (NODE::preg): Now an array of size two.
2342
[CASE]: Flag no longer needed, so removed.
2343
(IGNORECASE): Change type from int to bool.
2344
* awkgram.y (make_regnode): Build two copies of the compiled regexp,
2345
one without ignorecase, and one with.
2346
* io.c (RS_re): Array replacing RS_re_yes_case and RS_re_no_case.
2347
(set_RS): Use RS_re[IGNORECASE] as appropriate. Free and recompute
2349
* main.c (IGNORECASE): Change type from int to bool.
2350
* re.c (re_update): Simplify the code. No need to check CASE flag
2351
any longer. Recompute only if text of regexp changed.
2352
* symbol.c (free_bc_internal): Adjust to free both elements of
2355
2017-01-18 Andrew J. Schorr <aschorr@telemetry-investments.com>
2357
* interpret.h (r_interpret): Increase robustness of the optimization
2358
logic in Op_assign_concat -- check that the node has MALLOC set,
2359
and make sure to wipe all flags other than MALLOC, STRING, STRCUR,
2360
and possibly WSTRCUR. Use STFMT_UNUSED define.
2362
2017-01-15 Andrew J. Schorr <aschorr@telemetry-investments.com>
2364
* interpret.h (r_interpret): Fix bug in Op_assign_concat reported
2365
on Cygwin mailing list. The string concatenation optimization was
2366
not updating the node correctly by setting STRING and STRCUR flags
2369
2017-01-06 Andrew J. Schorr <aschorr@telemetry-investments.com>
2371
Enhance API to support extended-precision arithmetic.
2372
* awk.h (enum block_id): Add new values BLOCK_MPFR and BLOCK_MPZ.
2373
(make_number_node): New inline function to reduce code duplication
2374
for creating numeric nodes.
2375
* gawkapi.h (gawk_api_major_version): Bump to 3.
2376
(awk_number_t): New typedef to represent numbers with varying internal
2378
(awk_value_t): For numbers, replace double with awk_number_t.
2379
(num_value): Redefine.
2380
(num_type, num_ptr): New defines for awk_number_t union members.
2381
(gawk_api_t): Add constants for version checking: gmp_major_version,
2382
gmp_minor_version, mpfr_major_version, and mpfr_minor_version.
2383
Add functions api_get_mpfr and api_get_mpz to allocate memory for
2384
extended-precision numbers to hand to gawk.
2385
(get_mpfr_ptr, get_mpz_ptr): Helper macros to wrap api_get_mpfr and
2387
(make_number): Modify to populate awk_number_t correctly.
2388
(make_number_mpz, make_number_mpfr): New helper functions to create
2389
extended-precision numeric nodes.
2390
(check_mpfr_version): New macro to check GMP/MPFR version compatibility
2391
in extensions that want to support extended-precision math.
2392
* gawkapi.c (getmpfr, freempfr, getmpz, freempz): New macros to
2393
allocate and free memory blocks for extended-precision math.
2394
(awk_value_to_node): For AWK_NUMBER values, support three different
2395
kinds of internal numbers: double, mpz_t, and mpfr_t.
2396
(assign_number): New helper function to convert a numeric node to
2398
(node_to_awk_value): Use assign_number to pass numbers properly.
2399
(api_get_mpfr): Implement new api_get_mpfr hook.
2400
(api_get_mpfz): Implement new api_get_mpz hook.
2401
(api_impl): Add GMP & MPFR versions, api_get_mpfr, and api_get_mpz.
2402
* node.c (r_make_number): Use new make_number_node inline function
2403
to reduce code duplication.
2404
(nextfree): Add block allocators for mpfr_t and mpz_t.
2405
(more_blocks): Add an assert to protect against cases where the block
2406
size is too small to hold our structure.
2407
* mpfr.c (mpg_node): Use new make_number_node inline function
2408
to reduce code duplication.
2410
2017-01-04 Arnold Robbins <arnold@skeeve.com>
2412
* config.guess, config.sub, compile, depcomp: Sync from latest
2415
2016-12-27 Juergen Kahrs <Juergen.Kahrs@googlemail.com>
2417
* CMakeLists.txt: Updated after adding support library.
2419
2016-12-23 Arnold D. Robbins <arnold@skeeve.com>
2421
* configure.ac (GNUPG_CHECK_MPFR): Don't call on PowerPC
2422
Macintosh. C99 and the last version of MPFR that works on
2423
that platform don't get along. Sigh.
2425
2016-12-22 Arnold D. Robbins <arnold@skeeve.com>
2427
* dfa.c: Sync with GNULIB.
2428
* intprops.h: New file.
2429
* Makefile.am (base_sources): Add intprops.h.
2431
Unrelated. Import GNULIB fix for regex: fix integer-overflow
2432
bug in never-used code.
2433
Problem reported by Clément Pit–Claudel in:
2434
http://lists.gnu.org/archive/html/emacs-devel/2016-12/msg00654.html
2435
Fix by Paul Eggert <eggert@cs.ucla.edu>:
2437
* regex_internal.h: Include intprops.h.
2438
* regexec.c (re_search_2_stub): Use it to avoid undefined
2439
behavior on integer overflow.
2441
Unrelated. Set up a support directory for externally obtained
2444
* Makefile.am (base_sources, EXTRA_DIST): Edit lists.
2445
(SUBDIRS): Get ordering right.
2446
(LDADD): Add support/libsupport.a.
2447
(DEFS): Add -I for support directory.
2448
* dfa.c, dfa.h, getopt.c, getopt.h, getopt1.c, getopt_int.h,
2449
intprops.h, localeinfo.c, localeinfo.h, random.c, random.h,
2450
regcomp.c, regex.c, regex.h, regex_internal.c, regex_internal.h,
2451
regexec.c, verify.h, xalloc.h: Moved to support.
2453
Unrelated: Totally break binary compatibility in the API
2454
after merging in API min/max changes and REGEX and STRNUM
2457
* gawkapi.c (valtype2str): New function.
2458
(node_to_awk_value): Minor simplification in a switch.
2459
(api_flatten_array): Removed.
2460
(api_flatten_array_typed): Use valtype2str in error message.
2461
(api_impl): Reorder functions to group related ones together again.
2462
* gawkapi.h (awk_valtype_t): Reorder enum values.
2463
(struct gawk_api): Remove api_flatten_array field. Reorder
2464
functions to group related ones together again.
2466
2016-12-17 Arnold D. Robbins <arnold@skeeve.com>
2468
* gawkapi.h (api_add_ext_func): Add comment about point to
2469
awk_ext_func_t not being const but gawk doesn't use it.
2470
* * interpret.h (Op_ext_builtin): Simplify code, check only
2471
if do_lint and ! f->suppress_lint and num_args > max_expected.
2473
2016-12-16 Arnold D. Robbins <arnold@skeeve.com>
2475
* gawkapi.h (awk_ext_func_t): Put max back before min. Restores
2476
source compatibility, although there will be compile warnings
2477
because of the 3rd argument for the C function being missing.
2478
* interpret.h (Op_ext_builtin): Used size_t instead of int for
2479
the various variables. Add a check that max expected > 0.
2481
2016-12-14 Arnold D. Robbins <arnold@skeeve.com>
2483
MAJOR BREAKING API CHANGE.
2485
* awk.h (INSTRUCTION): Update extension function pointer to
2486
take 3rd argument of pointer to struct awk_ext_func.
2487
* gawkapi.c (api_add_ext_func): Update third arg to not be const.
2488
* gawkapi.h (awk_ext_func_t): Put min before max. Add suppress_lint
2490
[gawk_api_major_version]: Update to 2.
2491
[gawk_api_minor_version]: Reset to 0.
2492
(api_add_ext_func): Update third arg to not be const.
2493
* interpret.h (Op_ext_symbol): Revise lint check.
2495
2016-12-12 Arnold D. Robbins <arnold@skeeve.com>
2497
* awk.h (INSTRUCTION): Replace min_required and max_expected
2498
with a pointer to the extension functions awk_ext_func_t struct.
2499
* ext.c (make_builtin): Store a pointer to the extension function
2500
struct into the INSTRUCTION instead of the min and max.
2501
* gawkapi.h (awk_ext_func): Use size_t instead of unsigned short.
2502
Put min second, which preserves source code compatibility.
2503
* interpret.h (Op_ext_builtin): Use the pointer for the info
2504
directly. If lint and max_expected > 0 and args > max_expected
2505
print a message and set max_expected to zero so we only print once
2506
per function. Remove special case of both min and max being zero.
2507
(Op_ext_func): Adjust creation of the data structures.
2509
2016-12-11 Arnold D. Robbins <arnold@skeeve.com>
2511
* dfa.c: Sync with GNULIB.
2513
2016-12-05 Andrew J. Schorr <aschorr@telemetry-investments.com>
2515
Add API support for strnum values.
2516
* gawkapi.c (awk_value_to_node): Add AWK_STRNUM.
2517
(assign_string): Add a type argument so we can use this for AWK_STRING
2519
(node_to_awk_value): When AWK_NUMBER is requested, a regex value
2520
should return false, as per the header file documentation.
2521
Add support for AWK_STRNUM requests. When AWK_REGEX is requested,
2522
implement the cases properly instead of always returning true.
2523
Fix AWK_SCALAR logic. For AWK_UNDEFINED, rewrite using a switch
2524
and support AWK_STRNUM.
2525
(api_sym_update): Add AWK_STRNUM.
2526
(api_sym_update_scalar): Add optimized support for updating AWK_STRNUM.
2527
(valid_subscript_type): Add AWK_STRNUM.
2528
(api_create_value): Add AWK_STRNUM.
2529
* gawkapi.h (awk_valtype_t): Add AWK_STRNUM.
2530
(strnum_value): New macro.
2531
(Value fetching table): Updated.
2533
2016-12-04 Andrew J. Schorr <aschorr@telemetry-investments.com>
2535
* gawkapi.c (assign_regex): Do not call assign_string, since we
2536
know that a REGEX value is not an unterminated field string.
2537
* gawkapi.h (make_regex): Delete macro.
2538
(make_const_regex, make_malloced_regex): Add new macros to replace
2539
make_regex with necessary memory management support.
2541
2016-12-04 Andrew J. Schorr <aschorr@telemetry-investments.com>
2543
* awk.h (fixtype): Remove conditional checking if the node type
2544
is Node_val. This is already covered by the assert, and if it's not
2545
true, we have serious bugs.
2546
* builtin.c (do_typeof): Do not treat Node_var the same way as
2547
Node_val, since they are different beasts. In reality, the argument
2548
to this function will never have type Node_var.
2550
2016-12-04 Andrew J. Schorr <aschorr@telemetry-investments.com>
2552
* gawkapi.h (awk_element_t): Remove obsolete comment claiming that
2553
the index will always be a string.
2554
(gawk_api_t): Add new api_flatten_array_typed function and indicate
2555
that api_flatten_array has been superseded.
2556
(flatten_array_typed): New macro to call api_flatten_array_typed.
2557
(flatten_array): Redefine using the new flatten_array_typed macro.
2558
* gawkapi.c (api_flatten_array_typed): New function renamed from
2559
api_flatten_array to flatten an array with the types requested by the
2560
caller. Also update the comments and error messages.
2561
(api_flatten_array): Now a wrapper around api_flatten_array_typed.
2562
(api_impl): Add new api_flatten_array_typed hook.
2564
2016-12-06 Arnold D. Robbins <arnold@skeeve.com>
2566
Add minimum required and maximum expected number of arguments
2569
* awk.h (INSTRUCTION): Add new members min_required and max_expected.
2570
* ext.c (make_builtin): Store values from extension function struct
2571
into the INSTRUCTION.
2572
* gawkapi.h (awk_ext_func): Add min_required args. Make both it and
2573
max_expected_args into unsigned short to match type in INSTRUCTION.
2574
* interpret.h (Op_ext_builtin): Store min_required and max_expected
2575
in instructions. Add checking code and lint checks.
2576
(Op_ext_func): Copy min_required and max_expected from function info.
2579
2016-12-04 Andrew J. Schorr <aschorr@telemetry-investments.com>
2581
* gawkapi.h (r_make_string_type): New inline function to create strings
2582
of any type, currently AWK_STRING or AWK_REGEX.
2583
(r_make_string): Now a wrapper around r_make_string_type.
2584
(make_regex): Convert from an inline function to a macro that
2585
calls r_make_string_type.
2587
2016-11-30 Arnold D. Robbins <arnold@skeeve.com>
2589
* dfa.c: Sync with fixes in GNULIB.
2593
* gawkapi.h (make_regex): New function.
2595
2016-11-29 Arnold D. Robbins <arnold@skeeve.com>
2597
Add support for typed regex variables to the API.
2599
* awk.h (make_typed_regex): Declare function.
2600
* awkgram.y (typed_regexp): Call make_typed_regex instead of
2602
* gawkapi.h (AWK_REGEX): New value type.
2603
(regex_value): New macro.
2604
(Value fetching table): Updated.
2605
* gawkapi.c (awk_value_to_node, node_to_awk_value, api_sym_update,
2606
api_sym_update_scalar, valid_subscript_type, api_create_value):
2607
Add support for AWK_REGEX.
2608
(assign_regex): New function.
2609
(api_flatten_array): Adjust comment.
2610
* node.c (make_typed_regex): New function; moved code from grammar.
2612
2016-11-29 Arnold D. Robbins <arnold@skeeve.com>
2614
Remove redundant flag from dfa:
2616
* dfa.c (dfasyntax): Use RE_ICASE instead of DFA_CASE_FOLD.
2617
* dfa.h (DFA_CASE_FOLD): Removed.
2618
* re.c (make_regexp): Use RE_ICASE for regex and dfa. Yay!
2620
Unrelated: Don't have to recompute syntax stuff every time
2621
we compile a regexp.
2623
* dfa.c (dfacopysyntax): New function.
2624
(dfaalloc): Zero out the newly allocated memory.
2625
* dfa.h (dfacopysyntax): Declare it.
2626
* re.c (make_regexp): Declare two static dfaregs, one for
2627
with and without ignorecase. Compute the syntax once for each,
2628
then use dfacopysyntax to copy the settings when compiling
2631
2016-11-28 Arnold D. Robbins <arnold@skeeve.com>
2633
Make gawk compile on HP-UX 11.33.
2635
* debug.c (serialize_list): Renamed from `serialize'.
2636
(unserialize_list): Renamed from `unserialize', for consistency.
2640
* dfa.c: Sync with GNULIB. Twice in one day.
2642
Unrelated: Start improving profiling comments for switch/case.
2644
* awkgram.y (switch_head): New production.
2646
2016-11-21 Arnold D. Robbins <arnold@skeeve.com>
2648
* dfa.c: Sync with GNULIB.
2650
2016-11-17 Arnold D. Robbins <arnold@skeeve.com>
2652
General cleanup for zero termination of strings.
2654
* array.c (do_delete): Use %.*s.
2655
(value_info): Get length and use %.*s.
2656
(asort_actual): Save and restore character after end.
2657
* awkgram.y (split_comment): Use make_string, not make_str_node.
2658
* builtin.c (do_fflush): Use %.*s.
2659
(locale_category_from_argument, do_dcgettext, do_dcngettext,
2660
do_bindtextdomain): Save and restore character after end.
2661
* debug.c (do_info, print_array, print_subscript, do_print_var,
2662
do_set_var, display, do_watch, print_watch_item, serialize_subscript,
2663
do_print_f): Use %.*s.
2664
* eval.c (cmp_nodes, fmt_index): Save and restore character after end.
2665
* interpret.h (r_interpret): Fix computation for concatenation of
2667
* io.c (is_non_fatal_redirect): Add length parameter; save and
2668
restore character after last. Adjust all other declarations and calls.
2669
(do_close): Save and restore character after end.
2670
* mpfr.c (ieee_fmts): Adjust table indentation.
2671
(do_mpfr_strtonum): Clear wide string members of the union.
2672
* msg.c (err): Use %.*s.
2674
2016-11-07 Arnold D. Robbins <arnold@skeeve.com>
2676
* awk.h [USER_INPUT]: Renamed from MAYBE_NUM.
2677
* builtin.c, eval.c, field.c, int_array.c, io.c, main.c,
2678
mpfr.c, node.c: Change all uses.
2680
2016-11-15 Arnold D. Robbins <arnold@skeeve.com>
2682
Finish reworking typed regexes.
2684
* awk.h (typed_re): Replaces tre_reg.
2685
* awkgram.y (typed_regexp production): Node_val points to a regular
2686
Node_regex and also has string value and length.
2687
(make_regnode): Simplified back to its original form.
2688
* builtin.c (call_sub, call_match, call_split_func): For REGEX,
2690
* field.c (do_split, do_patsplit): Ditto, for separator regexp.
2691
* profile.c (pprint): Op_match_rec, handle REGEX correctly.
2692
* re.c (re_update): If REGEX, get t->typed_re->re_reg.
2694
2016-11-15 Arnold D. Robbins <arnold@skeeve.com>
2696
Start reworking typed regexes.
2698
* awk.h (Node_typedregex): Nuked.
2700
(tre_reg): New member in val part of NODE union.
2701
(force_string, force_number, fixtype): Remove use of Node_typedregex.
2702
* awkgram.y (grammar): Use REGEX flag instead of node type.
2704
(make_regnode): Adjust creation based on node type.
2705
* builtin.c (do_length, do_print, call_sub, call_match,
2706
call_split_func, do_typeof): Adjust code.
2707
* debug.c (watchpoint_triggered, initialize_watch_item,
2708
print_memory): Adjust code.
2709
* eval.c (nodetypes): Remove Node_typedregex.
2710
(flags2str): Add REGEX.
2711
(setup_frame): Adjust code after removal of Node_typedregex.
2712
* interpret.h (r_interpret): Adjust code after removal
2714
* profile.c (pp_typed_regex): Renamed from pp_strong_regex.
2715
(pp_string_or_strong_regex): Renamed from pp_string_or_strong_regex.
2716
(pprint): Adjust code after removal of Node_typedregex.
2717
* re.c (re_update): Adjust code after removal of Node_typedregex.
2719
2016-11-04 Eli Zaretskii <eliz@gnu.org>
2721
* builtin.c (efwrite) [__MINGW32__]: Call w32_maybe_set_errno if
2722
errno is not set or set to EINVAL.
2724
* nonposix.h (w32_maybe_set_errno) [__MINGW32__]: Add prototype.
2726
2016-11-01 Arnold D. Robbins <arnold@skeeve.com>
2728
* eval.c (flags2str): Add NO_EXT_SET and NUMCONSTSTR.
2730
2016-10-31 Arnold D. Robbins <arnold@skeeve.com>
2732
Fix valgrind issues.
2734
* io.c (init_awkpath): Need to allocate max_path+3 pointers.
2735
* awkgram.y (make_profile_number): Need to add STRCUR flag and
2736
set n->stfmt to STFMT_UNUSED. See the comment in the code.
2738
2016-10-26 Arnold D. Robbins <arnold@skeeve.com>
2740
* io.c (init_awkpath): Set max path len for leading separator.
2742
2016-10-25 Arnold D. Robbins <arnold@skeeve.com>
2744
* io.c (init_awkpath): Restore documented behavior whereby
2745
null elements represent the current directory. Sheesh.
2746
Bug reported by "Jun T." <takimoto-j@kba.biglobe.ne.jp>.
2748
Disallow negative arguments to the bitwise functions.
2750
* NEWS: Document this.
2751
* builtin.c (do_lshift, do_rshift, do_and, do_or, do_xor, do_compl):
2752
Make negative arguments a fatal error.
2753
* mpfr.c (do_mpfr_compl, get_intval): Ditto.
2755
2016-10-23 Arnold D. Robbins <arnold@skeeve.com>
2757
* General: Remove trailing whitespace from all relevant files.
2758
* mpfr.c: Replace Unicode sequences with ASCII.
2759
* cint_array.c: Ditto.
2761
2016-10-16 Arnold D. Robbins <arnold@skeeve.com>
2763
* awkgram.y: Typo fix in call to add_sign_to_num.
2765
2016-10-16 Arnold D. Robbins <arnold@skeeve.com>
2767
* awk.h (enum opcodeval): Add Op_unary_plus.
2768
* awkgram.y (add_sign_to_num): New routine to put in a sign on
2769
profiling constants. Call it as necessary.
2770
In unary plus production, use new opcode, or set up a
2771
constant as for unary minus.
2772
(negate_num): Call add_sign_to_num instead of doing it directly.
2773
* eval.c (optypetab): Add entry for Op_unary_plus.
2774
* interpret.h (r_interpret): Add case for Op_unary_plus.
2775
* profile.c (pprint, prec_level, is_scalar): Ditto.
2777
2016-10-13 Arnold D. Robbins <arnold@skeeve.com>
2779
* dfa.c: Sync with GNULIB.
2781
2016-10-12 Arnold D. Robbins <arnold@skeeve.com>
2783
* awkgram.y (make_profile_number): Allocate an extra byte for the
2784
string, so there's room for a minus if necessary. Store '\0'
2786
(negate_num): Use memmove to shift the string up and then
2787
insert a minus, instead of doing a fresh alloc + copy + free.
2789
2016-10-11 Arnold D. Robbins <arnold@skeeve.com>
2791
* awk.h (NUMCONSTSTR): New flag value.
2792
* awkgram.y (make_profile_number): New function. Use it
2793
wherever we make a number. This calls make_number and then, if
2794
pretty printing, save the original string value and sets NUMCONSTSTR.
2795
(negate_num): If NUNCONSTSTR set, update the saved string value.
2796
* profile.c (pp_number): Assert NUMCONSSTR set, use that value.
2797
Remove previous code.
2799
2016-09-24 Eli Zaretskii <eliz@gnu.org>
2801
* debug.c (restart) [__MINGW32__]: Cast 2nd argument of execvp to
2802
avoid compiler warnings about prototype mismatch. Reported by
2803
Marc de Bourget <marcdebourget@gmail.com>.
2805
2016-09-09 Norihiro Tanaka <noritnk@kcn.ne.jp>
2807
* awk.h (struct Regexp): Remove member has_anchor. All uses removed.
2808
* re.c (make_regexp, research): Use dfa matcher for regex with anchor.
2810
2016-09-09 Arnold D. Robbins <arnold@skeeve.com>
2812
* dfa.c: Sync with grep.
2814
2016-09-08 Paul Eggert <eggert@cs.ucla.edu>
2816
* dfa.c, dfa.h: Sync with grep.
2817
* re.c (make_regexp): Adjust to DFA API changes.
2819
2016-09-08 Arnold D. Robbins <arnold@skeeve.com>
2821
* command.y: Update license text to version 3. Oops.
2823
2016-09-07 Arnold D. Robbins <arnold@skeeve.com>
2825
* cmd.h, debug.c: Update license text to version citing
2826
GPLv3+ and with correct FSF address. Thanks to
2827
David Kaspar <dkaspar@redhat.com> for pointing out the need.
2829
2016-09-02 Arnold D. Robbins <arnold@skeeve.com>
2831
* dfa.c: Sync with grep.
2833
2016-09-01 Arnold D. Robbins <arnold@skeeve.com>
2835
Merge grep's now thread-safe dfa. Wheee.
2837
* dfa.h, dfa.c: Sync with grep.
2838
* localeinfo.h, localeinfo.c, verify.h: New files.
2839
* Makefile.am (base_sources): Adjust.
2840
* awk.h (using_utf8): Declare new function.
2841
* node.c (str2wstr): Use using_utf8 instead of now-gone dfa function.
2842
* re.c: Include "localeinfo.h".
2843
(localeinfo): New static variable.
2844
(make_regexp): Adjust call to dfa_syntax.
2845
(resetup): Call init_localeinfo on localeinfo. Remove call to
2846
now-gone function dfa_init.
2847
(using_utf8): New function.
2849
2016-08-29 Arnold D. Robbins <arnold@skeeve.com>
2851
* configure.ac (fwrite_unlocked): Check for it.
2852
* awk.h (fwrite): Define to fwrite_unlocked if we have it.
2853
* NEWS: Make note of speed improvement.
2855
2016-08-25 Arnold D. Robbins <arnold@skeeve.com>
2857
POSIX now says use strcmp for == and !=. Thanks to Chet Ramey
2858
for pointing me at the change. Make it so:
2860
* awk.h (cmp_nodes): New 3rd param indicating strcmp, not strcoll.
2861
* debug.c (cmp_val): Update call to cmp_nodes.
2862
* eval.c (cmp_nodes): New 3rd param indicating strcmp, not strcoll.
2863
Adjust code and all callers.
2864
(scalar_cmp_t): New enum type. Used in ...
2865
(cmp_scalars): ... in order to call cmp_nodes correctly.
2866
* interpret.h: Use the enum type in calls to cmp_scalars.
2867
* re.c (re_update): Adjust call to cmp_nodes.
2869
2016-08-25 Norihiro Tanaka <noritnk@kcn.ne.jp>
2871
* awk.h (struct Regexp): Remove dfa. Now dfareg instead of it. All
2873
* re.c (research): Arrange caller of dfaexec and research.
2874
* (avoid_dfa): Removed. All callers changed.
2875
* awk.h (avoid_dfa): Removed.
2877
Other changes by Arnold Robbins:
2879
* awk.h (struct Regexp): Change various boolean members to bool.
2880
(RE_NO_FLAGS): New #define.
2881
* interpret.h: Use RE_NO_FLAGS instead of zero.
2882
* re.c (research): Prettify the logic a little bit.
2884
2016-08-25 Arnold D. Robbins <arnold@skeeve.com>
2886
* dfa.c: Sync with grep.
2888
2016-08-25 Arnold D. Robbins <arnold@skeeve.com>
2890
* 4.1.4: Release tar ball made.
2892
2016-08-23 Arnold D. Robbins <arnold@skeeve.com>
2894
* dfa.h: Sync with grep. API changes.
2895
* dfa.c: Sync with grep.
2896
* re.c (make_regexp): Adjust for API changes, move call to dfasyntax
2897
into stanza that compiles the regex.
2898
(resetup): Call dfa_init.
2899
* node.c (str2wstr): using_utf8 is now called dfa_using_utf8.
2903
* Makefile.am: Quote all uses of $(srcdir) and $(distdir).
2904
(spell): New target.
2906
2016-08-18 Arnold D. Robbins <arnold@skeeve.com>
2908
* dfa.c: Sync with grep.
2910
2016-08-15 Andrew J. Schorr <aschorr@telemetry-investments.com>
2912
* int_array.c (is_integer): Fix merge of stable changes to remove
2913
obsolete string formatting check that has been superseded by
2914
the new standard_integer_string check.
2916
2016-08-14 Arnold D. Robbins <arnold@skeeve.com>
2918
* re.c (make_regexp): Only call dfasyntax if actually using
2919
dfa. Gives a 14% speedup on this test: https://raw.githubusercontent.com/chadbrewbaker/awka/master/benchmark/regexp.awk.
2920
From blathering in comp.lang.awk.
2922
2016-08-12 Arnold D. Robbins <arnold@skeeve.com>
2924
* dfa.c: Sync with GNU grep.
2928
* int_array.c: Minor text and formatting edits.
2930
2016-08-09 Andrew J. Schorr <aschorr@telemetry-investments.com>
2932
* awk.h: Add a comment explaining the NUMINT flag in more detail.
2933
* int_array.c (standard_integer_string): New function to test whether
2934
a string matches what would be produced by sprintf("%ld", <value>).
2935
(is_integer): Fix bug -- if NUMBER was set, then the function was
2936
accepting strnum values with nonstandard string representations. We
2937
now call standard_integer_string to check that the string looks OK.
2938
Also added ifdef'ed code to simplify the function by relying upon
2939
force_number to parse the string, but this is disabled due to possible
2940
negative performance impact.
2942
2016-08-03 Arnold D. Robbins <arnold@skeeve.com>
2944
Remove typed regexes until they can be done properly.
2947
* awk.h (enum nodevals): Remove Node_typedregex.
2948
(force_string, force_number): Remove check for Node_typedregex.
2949
* awkgram.y (TYPED_REGEXP): Remove token.
2950
(grammar): Remove productions related to typed regexps.
2951
(yylex): Don't find a typed regex or return it.
2952
(valinfo): Remove code for Node_typedregex.
2953
* builtin.c (do_length, do_print, call_sub, call_match,
2954
call_split_func, do_typeof): Remove code for Node_typedregex.
2955
* debug.c (watchpoint_triggered, print_memory): Remove code
2956
for Node_typedregex.
2957
* eval.c (nodetypes, setup_frame): Remove code for Node_typedregex.
2958
* interpret.h (r_interpret): Remove code for Node_typedregex.
2959
* profile.c (pprint): Remove code for Node_typedregex.
2960
(pp_strong_regex): Removed.
2961
(pp_string_or_strong_regex): Remove code for Node_typedregex.
2962
* re.c (re_update): Remove code for Node_typedregex.
2964
2016-08-01 Arnold D. Robbins <arnold@skeeve.com>
2966
* README, NEWS: Mark DJGPP port as unsupported.
2968
2016-08-01 Andrew J. Schorr <aschorr@telemetry-investments.com>
2970
* mpfr.c (mpg_tofloat): Always set precision to avoid hysteresis effects
2971
from previous calculations using the same temporary mpfr variables.
2973
2016-08-01 Andrew J. Schorr <aschorr@telemetry-investments.com>
2975
* mpfr.c (default_prec): Add new static variable to show current PREC
2977
(init_mpfr, set_PREC): Save mpfr_set_default_prec argument in
2979
(do_mpfr_func): If the argument's precision exceeds the default
2980
precision, boost the result's precision to match it. This fixes a
2981
bug where we used to copy the argument's precision, regardless of
2982
whether it was higher or lower than the PREC setting.
2984
2016-07-24 Norihiro Tanaka <noritnk@kcn.ne.jp>
2986
* re.c (research): Now that the dfa matcher correctly runs even
2987
in multibyte locales, try it if even if need_start is true.
2988
However, if start > 0, avoid dfa matcher, since it can't handle
2989
the case where the search starts in the middle of a string.
2993
* eval.c (load_casetable): Reset casetable[i] to `i' if i
2994
should not be mapped to upper case. Fixes inconsistencies between
2995
dfa and regex in some single bytes locales; notably el_GR.iso88597.
2997
2016-07-23 Arnold D. Robbins <arnold@skeeve.com>
2999
Make result of close on a pipe match result of system.
3000
Thanks to Mike Brennan for the encouragement.
3002
* awk.h (sanitize_exit_status): Declare routine.
3003
* builtin.c (sanitize_exit_status): New routine.
3004
(do_system): Use it.
3005
* io.c (close_rp): Use it on pclose result.
3006
(gawk_pclose): Use it.
3008
2016-07-23 Andrew J. Schorr <aschorr@telemetry-investments.com>
3010
* builtin.c (do_print): Improve logic for formatting
3013
2016-07-19 Andrew J. Schorr <aschorr@telemetry-investments.com>
3015
* eval.c (set_LINT): Simplify the code considerably.
3017
2016-07-19 Arnold D. Robbins <arnold@skeeve.com>
3019
* awkgram.y (shadow_funcs): Change test at end to be
3020
`lintfunc == r_fatal' instead of `lintfunc != warning'.
3021
Thank to Andrew Schorr for the suggestion.
3023
2016-07-18 Arnold D. Robbins <arnold@skeeve.com>
3025
* main.c (locale_dir): New variable, init to LOCALEDIR (set by
3027
(set_locale_stuff): Move calls to bindtextdomain and
3028
textdomain to here; they must be done after calling setlocale.
3029
Use locale_dir instead of LOCALEDIR.
3030
(main): Move call to set_locale_stuff() to before parsing arguments.
3031
Check for GAWK_LOCALE_DIR env var and use it if there. If doing
3032
locale debugging, call set_locale_stuff again if arg parsing changed
3037
* dfa.c: Sync with GNU grep.
3041
* config.sub: Updated from GNULIB.
3043
2016-07-17 Arnold D. Robbins <arnold@skeeve.com>
3045
* eval.c (set_LINT): Reset lintfunc to `warning' for LINT="invalid".
3046
Thanks to Andy Schorr for the report.
3048
2016-07-08 Andrew J. Schorr <aschorr@telemetry-investments.com>
3050
* awk.h: Restore previous comment about unterminated strings, since
3051
I am removing the string termination patches from field.c
3052
(free_api_string_copies): Declare new gawkapi function.
3053
* builtin.c (do_mktime, do_system): Restore temporary string
3054
termination to protect against unterminated field values.
3055
(nondec2awknum): Remove comment about unnecessary termination.
3056
* eval.c (posix_compare): Restore temporary string termination.
3057
* field.c (databuf): Remove struct, no longer needed.
3058
(set_field): Remove memcpy for string termination, since we will support
3059
unterminated field string values.
3060
(rebuild_record): Ditto. Also no need to allocate space for terminated
3062
(allocate_databuf): Remove function, since memory management can again
3063
be done inside set_record.
3064
(set_record): Restore inline buffer management logic.
3065
(reset_record): Remove calls to allocate_databuf, since we no longer
3066
need space for making terminated copies of field strings.
3067
* gawkapi.c (free_api_string_copies): New function to free strings
3068
that we made to provide terminated copies to API functions.
3069
(assign_string): New function to convert a string to an awk_value,
3070
making sure to copy it if we need to terminate it.
3071
(node_to_awk_value): Use assign_string to return string values with
3072
NUL termination protection.
3073
* int_array.c (is_integer): Restore temporary string termination.
3074
* interpret.h (Op_push_i): Ditto.
3075
(Op_ext_builtin): After external function returns, call
3076
free_api_string_copies to free temporary string copies.
3077
* mpfr.c (force_mpnum): Restore temporary string termination.
3078
* node.c (r_force_number, get_ieee_magic_val): Ditto.
3080
2016-07-08 Arnold D. Robbins <arnold@skeeve.com>
3082
* dfa.c: Sync with GNU grep.
3086
* builtin.c (do_print): Coding style change. (This change obsoleted
3087
by earlier changes in the fixtype branch.)
3089
2016-07-06 Andrew J. Schorr <aschorr@telemetry-investments.com>
3091
* awk.h: Modify comments to indicate that MAYBE_NUM will now be
3092
left enabled to indicate strnum values by the NUMBER|MAYBE_NUM
3093
combination, whereas STRING|MAYBE_NUM indicates a potential strnum.
3094
(fixtype): Modify MAYBE_NUM test to avoid calling force_number if
3095
NUMCUR is already set.
3096
* builtin.c (do_typeof): Call fixtype to resolve argument type.
3097
This forces parsing of numeric strings, so there's a performance
3098
penalty, but we must do this to give a correct result. The meaning
3099
of "strnum" changes from "potential strnum" to "actual strnum".
3100
* eval.c (set_TEXTDOMAIN): Remove some dead code left over from last
3102
* int_array.c (is_integer): When a MAYBE_NUM is converted successfully
3103
to a NUMBER, leave the MAYBE_NUM flag enabled.
3104
* mpfr.c (mpg_force_number): Ditto.
3105
* node.c (r_force_number): Ditto.
3107
2016-07-06 Andrew J. Schorr <aschorr@telemetry-investments.com>
3109
* awk.h: Modify stptr comment to indicate that all strings are now
3111
* builtin.c (do_mktime): Remove unnecessary logic to terminate
3112
the string with '\0' temporarily.
3114
(nondec2awknum): Add a comment about termination.
3115
* eval.c (posix_compare): Remove logic to terminate strings temporarily.
3116
(set_ORS): No need to terminate ORS, since the string node is already
3117
terminated. What gave us the right to modify that node anyway?
3118
(fmt_index): Remove code to terminate string. This seems to have been
3119
invalid anyway, since we don't own that memory.
3120
(set_TEXTDOMAIN): Do not terminate TEXTDOMAIN string, since the node
3121
is already terminated. We didn't have the right to modify that node
3123
* gawkapi.c (node_to_awk_value): Add assert checks to confirm that the
3124
string is NUL-terminated.
3125
* gawkapi.h: Modify awk_string comment to indicate that strings are
3126
always terminated with '\0'.
3127
* int_array.c (isinteger): Remove unnecessary logic to terminate string
3128
with '\0' temporarily.
3129
* interpret.h (Op_push_i): Ditto.
3130
* io.c (nextfile): Remove string termination. We didn't own that memory
3132
* mpfr.c (force_mpnum): Remove unnecessary logic to terminate the
3133
string with '\0' temporarily.
3134
* node.c (r_force_number): Remove NUL termination around strtod call,
3135
since we already know that there is either a white space or '\0'
3136
character there. Either one will stop strtod.
3137
(get_ieee_magic_val): Ditto.
3138
* profile.c (pp_number): No need to terminate string returned by
3141
2016-07-06 Andrew J. Schorr <aschorr@telemetry-investments.com>
3143
* interpret.h (Op_field_spec): Now that all $n field values are
3144
NUL-terminated, there is no reason to call dupnode for $n where n > 0.
3145
This saves malloc and copying overhead, thereby more than offsetting the
3146
performance hit of the additional copying and NUL-termination in the
3147
last patch to field.c. It also eliminates repeated parsing in cases
3148
where $n, for n > 1, was accessed more than once in a numeric context,
3149
so the new approach should be a performance win.
3151
2016-07-06 Andrew J. Schorr <aschorr@telemetry-investments.com>
3153
Make sure that all field values, and therefore all strings inside gawk,
3154
are terminated with a '\0' character!
3156
* field.c (databuf): New static struct to hold info about our buffer to
3157
contain the field string values.
3158
(allocate_databuf): New function to make sure the databuf is large
3159
enough to hold $0 and copies of $1 through $NF.
3160
(set_field): Copy $n into free space previously allocated in databuf
3161
and add a '\0' at the end.
3162
(rebuild_record): Call allocate_databuf to ensure sufficient space
3163
for copying non-malloced field values. When copying field values,
3164
use databuf to create a NUL-terminated copy.
3165
(purge_record): New function extracted from reset_record to initialize
3166
$1 through $NF to null values.
3167
(set_record): Buffer management moved to new allocate_databuf function.
3168
Call purge_record instead of reset_record, since reset_record contains
3169
some extra logic not needed in this case.
3170
(reset_record): Call purge_record to do most of the work, and call
3171
allocate_databuf to make sure we have a big enough buffer to contain
3172
copies of the $1 through $NF.
3174
2016-07-06 Andrew J. Schorr <aschorr@telemetry-investments.com>
3176
* awk.h: Renumber flags to remove gap created when FIELD was removed.
3178
2016-07-05 Andrew J. Schorr <aschorr@telemetry-investments.com>
3180
* field.c (rebuild_record): Need to set MALLOC flag if we allocate
3181
memory for a residual field node with valref > 1.
3183
2016-07-05 Andrew J. Schorr <aschorr@telemetry-investments.com>
3185
* field.c (rebuild_record): Do not bother to create new field nodes
3186
to replace malloc'ed nodes when rebuilding $0.
3188
2016-07-05 Andrew J. Schorr <aschorr@telemetry-investments.com>
3190
* awk.h (FIELD): Remove unnecessary flag.
3191
(MALLOC): Move definition to join the others, and improve the comment.
3192
* array.c (value_info): Replace FIELD test with MALLOC test.
3193
* eval.c (flags2str): Remove FIELD flag.
3194
* field.c (init_fields): Remove FIELD bit from Null_field->flags.
3195
(set_field): Remove FIELD bit from flags.
3196
(rebuild_record): Test against MALLOC instead of FIELD. If a field
3197
node has valref > 1, we should make a copy, although I don't think
3198
it is valid for this to happen.
3199
(set_record): Remove FIELD bit from flags.
3200
* interpret.h (UNFIELD): Add comment, and test MALLOC flag instead of
3201
FIELD. Remove probably buggy code to disable the FIELD flag when
3202
valref is 1; that would have created a node where neither the FIELD
3203
nor MALLOC flag was set, which seems invalid.
3204
* node.c (r_dupnode): Remove code disabling FIELD flag.
3206
2016-07-04 Andrew J. Schorr <aschorr@telemetry-investments.com>
3208
* awk.h (force_string_fmt): New inline function to get the string
3209
representation in a requested format.
3210
(force_string): Reimplement as a macro using force_string_fmt function.
3211
(force_string_ofmt): New macro to get a value's OFMT representation.
3212
* builtin.c (do_print): Use new force_string_ofmt macro instead of
3213
duplicating the logic inline.
3215
2016-07-04 Andrew J. Schorr <aschorr@telemetry-investments.com>
3217
* str_array.c (str_lookup): There is no need to worry about the
3218
MAYBE_NUM flag, since the code has been patched to make sure to
3219
preserve the string value of strnum values, and the integer array
3220
code should no longer mistakenly claim a strnum integer with a
3221
nonstandard string representation.
3223
2016-07-03 Andrew J. Schorr <aschorr@telemetry-investments.com>
3225
* field.c (rebuild_record): Revert warning message regarding flags,
3226
since I'm not yet totally confident that it is invalid to have FIELD
3227
and MALLOC set at the same time.
3229
2016-07-03 Andrew J. Schorr <aschorr@telemetry-investments.com>
3231
* field.c (rebuild_record): Do not turn off the STRING flag when
3232
copying a FIELD node, and issue a warning if MALLOC is enabled.
3234
2016-07-01 Arnold D. Robbins <arnold@skeeve.com>
3236
* array.c (value_info): Print something reasonable when stfmt
3238
* mpfr.c (mpg_format_val): Don't cast index to char.
3239
* node.c (r_format_val): Ditto.
3240
Thanks to Andrew Schorr for pointing these out.
3244
* gawkapi.c (api_warning): Fix the comment header.
3245
(api_lintwarn): Factor out the call to va_end to after the if.
3249
* symbol.c (get_symbols): Add FUNCTAB and SYMTAB to the list
3251
* awkgram.y (dump_vars): Allow "-" to mean print to stdout.
3252
Thanks to Hermann Peifer for the reports.
3254
2016-06-30 Arnold D. Robbins <arnold@skeeve.com>
3256
* node.c (r_force_number): Coding style change.
3258
2016-06-30 Andrew J. Schorr <aschorr@telemetry-investments.com>
3260
* awk.h (STFMT_UNUSED): New define indicating that the string
3261
representation does not depend on CONVFMT or OFMT.
3262
(force_string): Use STFMT_UNUSED to improve code clarity.
3263
* array.c (value_info): Fix stfmt logic.
3264
* builtin.c (do_print): Use STFMT_UNUSED to improve code clarity.
3265
* field.c (set_record): Ditto.
3266
* gawkapi.c (api_sym_update_scalar): Ditto.
3267
* int_array.c (is_integer): Check stfmt equals STFMT_UNUSED before
3268
bothering to inspect the string.
3269
* mpfr.c (mpg_format_val): Use STFMT_UNUSED to improve code clarity.
3270
Remove buggy cast to char in stfmt assignment.
3271
* node.c (r_format_val): Ditto.
3272
* str_array.c (str_lookup): Use STFMT_UNUSED to improve code clarity.
3273
* symbol.c (check_param_names): Ditto.
3275
2016-06-29 Andrew J. Schorr <aschorr@telemetry-investments.com>
3277
* node.c (r_force_number): Optimize by trimming leading and trailing
3278
white space before we inspect the string contents.
3279
(get_ieee_magic_val): Must terminate the string with '\0' before
3282
2016-06-27 Andrew J. Schorr <aschorr@telemetry-investments.com>
3284
* gawkapi.h (awk_string): Add comment about the potential lack of
3287
2016-06-27 Andrew J. Schorr <aschorr@telemetry-investments.com>
3289
* awk.h: Add a comment regarding the potential lack of NUL-termination
3290
for Node_val strings.
3292
2016-06-27 Andrew J. Schorr <aschorr@telemetry-investments.com>
3294
* node.c (r_format_val): Do not free stptr unless STRCUR is set.
3295
This is safer than testing for non-NULL stptr, since, for example,
3296
pp_number copies a node and calls r_format_val, but does not bother
3297
to set stptr to NULL beforehand.
3299
2016-06-26 Andrew J. Schorr <aschorr@telemetry-investments.com>
3301
* node.c (r_force_number): When checking for trailing spaces, protect
3302
against running off the end of the string.
3303
* mpfr.c (force_mpnum): Ditto.
3305
2016-06-26 Andrew J. Schorr <aschorr@telemetry-investments.com>
3307
* builtin.c (do_print): There's actually no reason to test whether a
3308
value is a number, since the STRCUR flag and stfmt value contain all
3309
the necessary info, as in awk.h:force_string.
3311
2016-06-26 Andrew J. Schorr <aschorr@telemetry-investments.com>
3313
* builtin.c (do_print): Do not use OFMT to print strnum values. We
3314
accomplish this by calling format_val for a NUMBER only
3315
if there is no string currently available, or if stfmt equals
3316
neither -1 nor OFMTidx.
3318
2016-06-26 Arnold D. Robbins <arnold@skeeve.com>
3320
* awk.h: Edit some comments. Add others. Minor coding style changes.
3321
* builtin.c (format_tree): Restore a comment.
3322
(do_mktime): Restore saving/restoring of byte after format string.
3323
(do_sub): Coding style. Use %.*s in warning message.
3324
(nondec2awknum): Restore saving/restoring of byte after string value
3326
* eval.c: Minor coding style edits.
3327
* int_array.c (is_integer): Fix order of checks for not
3328
updating string value: check length == 0 before testing values.
3330
* mpfr.c (do_mpfr_strtonum): Coding style edits.
3331
* node.c (r_force_number): Restore saving/restoring of byte after
3332
string value being converted. Edit comments some.
3334
2016-06-26 Arnold D. Robbins <arnold@skeeve.com>
3336
Repair change of 2015-08-25 to handling of MAYBE_NUM.
3337
* mpfr.c (mpg_force_number): Just clear MAYBE_NUM.
3338
* node.c (r_force_number): Clear STRING separately after
3341
Thanks to Andrew Schorr for reporting the problem.
3342
A test case will eventually be merged into master.
3344
Only in stable and master.
3346
2016-06-20 Andrew J. Schorr <aschorr@telemetry-investments.com>
3348
* builtin.c (do_strftime): Call fixtype before checking flags for
3350
(do_print): Call fixtype before checking whether argument is a NUMBER.
3351
* eval.c (set_BINMODE): Call fixtype before checking value type.
3352
No need to call force_number if the flags say it's a number.
3353
(r_get_field): Fix lint check for non-numeric argument.
3354
* io.c (redirect): Call fixtype before checking whether it's a string.
3356
2016-06-18 Andrew J. Schorr <aschorr@telemetry-investments.com>
3358
* node.c (r_force_number): Fix typo in comment.
3360
2016-06-16 Arnold D. Robbins <arnold@skeeve.com>
3362
* awk.h: Add comment headers for several functions.
3363
* builtin.c (nondec2awknum): Actually set a '\0' before
3364
calling to strtod() so that the save and restore do something.
3366
2016-06-15 Arnold D. Robbins <arnold@skeeve.com>
3368
* config.sub: Update from GNULIB.
3370
2016-06-14 Andrew J. Schorr <aschorr@telemetry-investments.com>
3372
* awk.h (boolval): New inline function to standardize testing whether
3373
a node's value is true.
3374
* builtin.c (do_strftime): Use boolval to handle 3rd argument.
3375
* eval.c (set_IGNORECASE, eval_condition): Use new boolval function.
3376
* io.c (pty_vs_pipe): Use new boolval function.
3378
2016-06-14 Andrew J. Schorr <aschorr@telemetry-investments.com>
3380
* builtin.c (do_strftime): Fix handling of 3rd argument to work
3381
as a standard boolean: non-null or non-zero.
3383
2016-06-14 Andrew J. Schorr <aschorr@telemetry-investments.com>
3385
* gawkapi.c (node_to_awk_value): When caller requests AWK_SCALAR
3386
or AWK_UNDEFINED, we need to call fixtype before we check the type.
3388
2016-06-13 Andrew J. Schorr <aschorr@telemetry-investments.com>
3390
* awkgram.y: Eliminate STRCUR tests. Must use STRING to test whether
3391
a scalar is a string.
3393
2016-06-12 Andrew J. Schorr <aschorr@telemetry-investments.com>
3395
* awk.h: Improve comment about STRING and NUMBER type assignment.
3396
(nondec2awknum): Add endptr argument.
3397
(fixtype): New inline function to clarify a scalar's type.
3398
* array.c (sort_up_value_type): Call fixtype before checking the value
3400
* awkgram.y (yylex): Pass NULL endptr argument to nondec2awknum.
3401
(valinfo): Remove dead tests: either STRING or NUMBER or both
3402
must be set, so there's no reason to continue with checks for NUMCUR or
3404
* builtin.c (do_exp, do_int, do_log, do_sqrt, do_sin, do_cos, do_srand):
3405
Fix lint check for non-numeric argument.
3406
(do_string): Fix lint check for 1st and 2nd args being strings.
3407
(do_length): Fix assert to allow for Node_typedregex.
3408
Fix lint check for non-string argument.
3409
(format_tree): Fix type detection for '%c' arguments.
3410
(do_strftime): Fix lint check for non-numeric 2nd argument and
3411
lint check for non-string 1st argument.
3412
(do_mktime): Fix lint check for non-string argument. Eliminate useless
3413
logic to save and restore terminating NUL.
3414
(do_system, do_tolower, do_toupper): Fix lint check for non-string
3416
(do_atan2, do_lshift, do_rshift, do_and, do_or, do_xor, do_compl,
3417
do_intdiv): Fix lint checks for non-numeric args.
3418
(do_sub): Attempt to clean up treatment of 3rd argument to gensub
3419
despite vague documentation of expected behavior.
3420
(do_strnum): Fix bug in number detection logic, and pass new endptr
3421
arg to nondec2awknum.
3422
(nondec2awknum): Add endptr argument so caller can detect how much
3423
of the string was consumed. Eliminate unnecessary logic to save
3424
and restore terminating NUL char.
3425
(do_typeof): Use a switch to specify which cases are supported, and
3426
issue a warning message when a corrupt type is detected.
3427
* debug.c (print_memory): At least one of NUMBER and STRING should
3428
be set, so no need to check for NUMCUR or STRCUR in addition.
3429
* eval.c (cmp_nodes): Use fixtype function to fix arg types.
3430
(set_IGNORECASE): Fix logic for acting on value type. Note that
3431
setting IGNORECASE to a string value of "0" with NUMCUR set now enables
3432
ignorecase, so that's a subtle change in behavior that seems to match
3434
(set_LINT): Try to clean up configuration logic based on type.
3435
* ext.c (get_argument): Remove unused variable pcount.
3436
* gawkapi.c (node_to_awk_value): Remove pointless test for NUMCUR
3437
after calling force_number. Similarly, no need to test for STRCUR
3438
after calling force_string.
3439
* int_array.c (is_integer): Reject cases where a string value is
3440
present that will not be correctly regenerated from the integer;
3441
in particular, this could happen where blank space padding is present,
3442
leading zeroes are present, or for hex or octal values.
3443
Also fix some bugs where a strnum was converted to a NUMBER without
3444
turning off the STRING bit.
3445
* io.c (redirect_string): Make lint warning message more accurate.
3446
(redirect): Change not_string test to use STRING bit, not STRCUR.
3447
(pty_vs_pipe): Use fixtype to correct logic for detecting whether a
3449
* mpfr.c (mpg_force_number): If NUMCUR is set, there's no need to
3450
test is_mpg_number. If it's not, the NODE is corrupt and we've got
3451
bigger problems. Fix flag manipulation logic. Always set NUMCUR and
3453
(set_PREC): Fix logic using fixtype function.
3454
(do_mpfr_atan2, do_mpfr_intdiv): Fix lint check for non-numeric
3456
(do_mpfr_func, do_mpfr_int, do_mpfr_compl, get_intval, do_mpfr_srand):
3457
Fix lint check for non-numeric argument.
3458
(do_mpfr_strtonum): Use fixtype and stop testing for NUMCUR bit.
3459
* node.c (r_force_number): Eliminate pointless save and restore of
3460
terminating NUL char. Always set NUMCUR and clear MAYBE_NUM, and
3461
convert STRING to NUMBER if appropriate, fixing bugs in flag
3462
manipulations. For non-decimal data, need to consider whether there
3463
is trailing non-numeric data in deciding whether a MAYBE_NUM should
3464
be converted to a NUMBER, so take advantage of new endptr arg
3467
2016-06-14 Arnold D. Robbins <arnold@skeeve.com>
3469
* builtin.c (do_sub): Fix sub for long runs of backslashes.
3470
Thanks to Mike Brennan for the report.
3473
* ext.c (get_argument): Remove unused variable pcount.
3475
2016-06-10 Arnold D. Robbins <arnold@skeeve.com>
3477
* config.guess, config.sub: Get latest from Gnulib master.
3478
* main.c (UPDATE_YEAR): Bump to 2016.
3480
2016-06-09 Arnold D. Robbins <arnold@skeeve.com>
3482
* dfa.c: Sync with GNU grep.
3486
* configure.ac: Move AM_CONDITIONAL[ENABLE_EXTENSIONS] outside
3487
the enclosing if. Thanks to Assaf Gordon <assafgordon@gmail.com>
3490
2016-06-08 Arnold D. Robbins <arnold@skeeve.com>
3492
* symbol.c (lookup): If got Node_val, it's a non-variable
3493
in SYMTAB, return NULL. Can affect watchpoints in the debugger,
3494
maybe other places. Thanks to Hermann Peifer for the
3495
test case and report.
3497
2016-06-05 Arnold D. Robbins <arnold@skeeve.com>
3499
* dfa.c: Sync with GNU grep.
3501
2016-06-01 Arnold D. Robbins <arnold@skeeve.com>
3503
* nonposix.h (getpgrp): Wrap declaration in ifdef so it doesn't
3504
mess things up on POSIX systems (like Solaris). Thanks to
3505
Nelson Beebe for the report.
3506
* node.c (is_hex): New function to check for 0x preceded by
3508
(r_force_number): Use it. Thanks to Mike Brennan for the report.
3510
2016-05-30 Andrew J. Schorr <aschorr@telemetry-investments.com>
3512
* gawkapi.h (awk_ext_func_t): Rename num_expected_args to
3513
max_expected_args, and explain in the comment that it doesn't really
3515
* ext.c (make_builtin): Replace num_expected_args with
3517
(get_argument): Do not check whether the argument number exceeds
3518
the maximum expected by the function.
3520
2016-05-30 Arnold D. Robbins <arnold@skeeve.com>
3522
* main.c (arg_assign): Fully bracket ifdefs around call
3523
to force_number. Thanks to Andrew Schorr for pointing out
3524
that force_number was called only if LC_NUMERIC was defined.
3526
Lots of files: Update copyright date.
3528
* field.c (set_FS): Handle FS = "\0" if RS = "". Thanks to
3529
Janis Papanagnou for the report.
3531
* getopt.c, getopt.h, getopt1.c, getopt_int.h: Sync with GLIBC.
3533
2016-05-26 Andrew J. Schorr <aschorr@telemetry-investments.com>
3535
* awk.h (get_actual_argument): Remove unused "optional" argument.
3536
(get_scalar_argument, get_array_argument): Change macro definition to
3537
remove 3rd "optional" argument.
3538
* ext.c (get_actual_argument): Remove unused "optional" argument.
3539
* gawkapi.c (api_get_argument, api_set_argument): Remove unused final
3540
argument to get_array_argument and get_scalar_argument.
3542
2016-05-26 Arnold D. Robbins <arnold@skeeve.com>
3544
* awk.h [fatal]: Make parentheses and use of indirection
3545
consistent with warning and lintwarn. Thanks to Andrew Schorr
3546
for pointing this out.
3547
* str_array.c (str_lookup): Move test for MAYBE_NUM to where
3548
we duplicate the subscript. Removing it across the board is
3549
wrong if there are multiple references to the value. Thanks
3550
to Andrew Schorr for discussion and test case.
3552
2016-05-26 Andrew J. Schorr <aschorr@telemetry-investments.com>
3554
* awk.h (get_actual_argument): Add an initial argument containing
3555
the (NODE *) previously returned by get_argument. This allows us to
3556
eliminate a call to get_argument from inside get_actual_argument.
3557
(get_scalar_argument, get_array_argument): Change macro definition to
3558
add an initial node argument to pass through to get_actual_argument.
3559
* ext.c (get_actual_argument): Add initial (NODE *) argument to contain
3560
the value previously returned by get_argument. This allows us to
3561
avoid repeating the call to get_argument. We can also eliminate the
3562
check for a NULL value, since the caller did that already.
3563
* gawkapi.c (api_get_argument): Pass (NODE *) returned by get_argument
3564
to get_array_argument and get_scalar_argument.
3565
(api_set_argument): Pass (NODE *) returned by get_argument to
3568
2016-05-25 Manuel Collado <mcollado2011@gmail.com>.
3570
* gawkapi.c (api_nonfatal): New function.
3571
(api_impl): Include it.
3572
* gawkapi.h (struct gawk_api): Add api_nonfatal member.
3573
(nonfatal): New macro.
3575
2016-05-12 Arnold Robbins <arnold@skeeve.com>
3577
* str_array.c (str_lookup): Remove MAYBE_NUM from subscript flags.
3578
Bug reported by Andres Legarra <Andres.Legarra@toulouse.inra.fr>.
3580
Unrelated: Fix issues with SIGPIPE. Reported by
3581
Ian Jackson <ijackson@chiark.greenend.org.uk>.
3583
* builtin.c (do_system): Reset/restore SIGPIPE to/from default around
3585
* io.c (redirect, gawk_popen [PIPES_SIMULATED]): Same.
3587
2016-05-12 Eli Zaretskii <eliz@gnu.org>
3589
* nonposix.h: Add prototypes for POSIX functions emulated in pc/*
3592
2016-05-09 Andrew J. Schorr <aschorr@telemetry-investments.com>
3594
* interpret.h (r_interpret): Op_ext_builtin. No need to test whether
3595
op == Op_ext_builtin, since we wouldn't be here otherwise.
3597
2016-05-03 Andrew J. Schorr <aschorr@telemetry-investments.com>
3599
* builtin.c (format_tree): Do not waste a byte at the end of a string.
3601
2016-05-03 Andrew J. Schorr <aschorr@telemetry-investments.com>
3603
* builtin.c (format_tree): After the string has been rendered, use
3604
realloc to shrink the buffer to the needed size. Otherwise, the minimum
3605
buffer size of 512 bytes can result in lots of wasted memory if many
3606
sprintf results are stored in an array.
3608
2016-05-02 Andrew J. Schorr <aschorr@telemetry-investments.com>
3610
* gawkapi.h (gawk_api_major_version, gawk_api_minor_version): Add
3611
CPP #define values to support conditional compilation.
3613
2016-05-02 Arnold D. Robbins <arnold@skeeve.com>
3615
* dfa.h, dfa.c: Sync with grep.
3616
* re.c (research): Adjust type of try_backref.
3618
2016-05-02 Arnold D. Robbins <arnold@skeeve.com>
3620
* awk.h (success_node): Declare.
3621
* array.c (success_node): Define.
3622
* cint_array.c, int_array.c, str_array.c: Use `& success_node'
3623
instead of `(NODE **) ! NULL' to indicate success throughout.
3624
Thanks to Pat Rankin for the cleanup suggestion.
3626
2016-04-27 Arnold D. Robbins <arnold@skeeve.com>
3628
* io.c (set_RS): Use rs1scan if do_traditional, even if length
3629
of RS is > 1. Bug reported by Glauco Ciullini
3630
<glauco.ciullini6245@gmail.com>.
3632
2016-04-24 Arnold D. Robbins <arnold@skeeve.com>
3634
* dfa.c: Sync with GNU grep.
3636
2016-04-11 Arnold D. Robbins <arnold@skeeve.com>
3638
* regex_internal.c: Replace _GL_ATTRIBUTE_PURE with
3641
2016-04-11 Arnold D. Robbins <arnold@skeeve.com>
3643
* regexec.c: Stamp out last remaining use of __attribute.
3644
* regcomp.c: Undo change of 2016-01-24 when parsing single-byte
3645
ranges. Go back to treating them as bytes and not as characters.
3646
The change broke things on Windows in non-UTF-8 character sets.
3647
* mbsupport.h (mbstate_t): Define to int.
3650
2016-04-10 John E. Malmberg <wb8tyw@qsl.net>
3652
* regex_internal.c: Use _GL_ATTRIBUTE_PURE macro
3654
2016-04-07 Arnold D. Robbins <arnold@skeeve.com>
3656
* awk.h (two_way_close_type): Move here from io.c.
3657
(close_rp): Add declaration.
3658
* builtin.c (do_printf): Call close_rp before fatal message when
3659
attempting to write the closed write end of a two way pipe.
3661
(do_print_rec): Ditto.
3662
* io.c (do_getline_redir): Same, for reading closed read end.
3663
(close_rp): Make not static.
3665
2016-04-07 Eli Zaretskii <eliz@gnu.org>
3667
* nonposix.h (WEXITSTATUS, WIFEXITED, WIFSIGNALED, WTERMSIG)
3668
(WIFSTOPPED, WSTOPSIG) [__MINGW32__]: New macros to replace the
3669
missing header sys/wait.h.
3670
(w32_status_to_termsig): Add prototype.
3672
* builtin.c (do_system) [__MINGW32__]: Compute the exit status of
3673
'system' differently under --traditional, as the low 8 bits are
3674
the most interesting.
3676
2016-04-06 Arnold D. Robbins <arnold@skeeve.com>
3678
* builtin.c (do_printf): Allow a write to the closed write-end of
3679
a two-way pipe to be nonfatal if NONFATAL is set for it.
3681
(do_print_rec): Ditto.
3682
* io.c (do_getline_redir): Same thing for reading from a closed
3683
read end of a two-way pipe. Fatal error.
3685
2016-04-04 Arnold D. Robbins <arnold@skeeve.com>
3687
* builtin.c (do_fflush): Add warning for flush to two-way
3688
pipe where write end was closed.
3689
* io.c (flush_io): Add some braces for the for loop.
3691
2016-04-02 Arnold D. Robbins <arnold@skeeve.com>
3693
* builtin.c (do_printf): If the redirection is two way but the
3694
fp is NULL, it means we're writing to the closed write-end of
3695
a two-way pipe. Issue a fatal error message.
3697
(do_print_rec): Ditto.
3698
* io.c (do_getline_redir): Same thing for reading from a closed
3699
read end of a two-way pipe. Fatal error.
3702
2016-03-27 Stephen Davies <sdavies@sdc.com.au>
3704
* awkgram.y (get_comment): Strip CRs from comment. Strip
3705
off trailing newlines.
3707
2016-03-21 Arnold D. Robbins <arnold@skeeve.com>
3709
* profile.c (pprint): Improve handling of comment after
3710
and if statement without an else.
3712
2016-03-19 Arnold D. Robbins <arnold@skeeve.com>
3714
Considerable improvements to handling of comments when pretty
3715
printing, particularly for end-of-line comments.
3717
* awkgram.y (prior_comment, comment_to_save): New variables.
3718
(add_pending_comment): New function.
3719
(grammar): Jump through lots more hoops to capture comments.
3720
Due to shift-reduce parsing, there can be up to two comments
3721
captured and waiting to be saved; be sure to get them both and
3722
at the right times. This is difficult since comments have no
3723
real syntactic existence. Call add_pending_comment on most of
3724
the simple statements.
3725
(get_comment): Save a pre-existing comment in prior_comment.
3726
(split_comment): Use comment_to_save instead of `comment'.
3727
* profile.c (end_line): Change to return the instruction after
3728
the comment that gets printed; adjust return type.
3729
(pprint): Add skip_comment static variable. Adjust logic for
3730
skipping an end-of-line comment; only do it if skip_comment is
3731
true. This is set to true in places where we can't use the
3732
return value from end_line(). Call end_line() in many more places.
3733
(pp_func): Handle end-of-line comments after a function header.
3735
2016-03-17 Arnold D. Robbins <arnold@skeeve.com>
3737
* debug.c (print_instruction): For Op_comment, improve notation as
3738
to whether it's a full comment or an end of line comment.
3740
2016-03-14 Arnold D. Robbins <arnold@skeeve.com>
3742
* io.c (socketopen): For SOCK_DGRAM, set read_len to sizeof
3743
remote_addr. Makes UDP more or less work again.
3744
Thanks to Juergen Kahrs for the fix.
3746
2016-03-11 Arnold D. Robbins <arnold@skeeve.com>
3748
* debug.c (print_instruction): Normalize printing of comment dump.
3750
2016-03-10 Arnold D. Robbins <arnold@skeeve.com>
3752
* builtin.c (do_system): Further improvements. Catch core dump
3755
2016-03-11 Arnold D. Robbins <arnold@skeeve.com>
3757
* builtin.c (do_system): Improve return values of system().
3759
2016-03-08 Arnold D. Robbins <arnold@skeeve.com>
3761
* profile.c (print_instruction): Fix duplicate case not caught
3764
2016-03-07 Arnold D. Robbins <arnold@skeeve.com>
3766
* profile.c (print_instruction): Further improvements in
3767
instruction dump, especially for when pretty-printing.
3768
* builtin.c (do_system): Augment the logic for the return
3769
value so that death-by-signal info is available too.
3771
2016-03-03 Arnold D. Robbins <arnold@skeeve.com>
3773
* profile.c (pp_list): Unconditionally compute delimlen. Avoids
3776
2016-03-02 Arnold D. Robbins <arnold@skeeve.com>
3778
* debug.c (print_instruction): Improvements in instruction dump
3781
2016-03-01 Arnold D. Robbins <arnold@skeeve.com>
3783
* debug.c (print_instruction): For Op_comment, add notation as
3784
to whether it's a full comment or an end of line comment.
3786
2016-02-29 Arnold D. Robbins <arnold@skeeve.com>
3788
* profile.c (pp_list): Handle the case of nargs equal to zero.
3789
Thanks to Hermann Peifer for the report.
3791
2016-02-28 Arnold D. Robbins <arnold@skeeve.com>
3793
* profile.c (pprint): Fix copy-paste error in else handling.
3794
Thanks to Michal Jaegermann for the report.
3796
2016-02-23 Arnold D. Robbins <arnold@skeeve.com>
3798
* config.guess, config.rpath, config.sub: Update to latest
3801
2016-02-23 Arnold D. Robbins <arnold@skeeve.com>
3803
* NEWS: Update full list of infrastructure tools.
3805
2016-02-22 gettextize <bug-gnu-gettext@gnu.org>
3807
* configure.ac (AM_GNU_GETTEXT_VERSION): Bump to 0.19.7.
3809
2016-02-21 Nelson H.F. Beebe <beebe@math.utah.edu>
3811
* random.c [SHUFFLE_BITS, SHUFFLE_MAX, SHUFFLE_MASK]: New macros.
3812
(shuffle_init, shuffle_buffer): New static variables.
3813
(random_old): Renamed from random.
3814
(random): New function wrapping random_old and providing a
3815
shuffle buffer to increase the period. See the literature citations
3816
and other notes in the code.
3818
2016-02-21 Arnold D. Robbins <arnold@skeeve.com>
3820
* regexec.c (prune_impossible_nodes): Remove attribute that
3821
keeps it from compiling with 32 bit GCC. Who the heck knows
3822
why or how. Sigh. Double sigh.
3824
2016-02-20 Arnold D. Robbins <arnold@skeeve.com>
3826
* regcomp.c, regex.c, regex.h, regex_internal.c, regex_internal.h,
3827
regexec.c: Sync with GLIBC, mostly prototype changes.
3829
2016-02-18 Arnold D. Robbins <arnold@skeeve.com>
3831
Fix profile / pretty-printing to chain else-ifs.
3833
* profile.c (pprint): Change third argument into a set of flags
3834
for in the for header or in an else if. Adjust case Op_K_else to
3835
make the right checks and format the code properly. In Op_K_if
3836
clear the flag so that any following else gets indented properly.
3839
2016-02-14 Arnold D. Robbins <arnold@skeeve.com>
3841
* README, NEWS: Updated to reflect use of Texinfo 6.1.
3845
* configure.ac: Switch to AC_PROG_CC_C99 to enable C99
3846
compilation and features.
3847
* dfa.c: Sync with GNU grep, go back to C99 style declarations
3850
2016-02-05 Arnold D. Robbins <arnold@skeeve.com>
3852
Make optimization (constant folding and tail call recursion)
3855
* awkgram.y (common_exp): Only do concatenation of two strings(!)
3856
* main.c (do_optimize): Init to true.
3857
(optab): Add new -s/--no-optimize option.
3858
(usage): Update message to include it.
3859
(parse_args): Parse it. Set do_optimize to false if pretty
3860
printing or profiling.
3863
2016-01-28 Arnold D. Robbins <arnold@skeeve.com>
3865
* Makefile.am (SUBDIRS): Include extras. Otherwise dist does
3868
2016-01-27 Arnold D. Robbins <arnold@skeeve.com>
3870
* configure.ac (GAWK_AC_AIX_TWEAK): Remove call.
3871
* configure: Regenerated.
3872
* io.c (GAWK_AIX): Check _AIX instead.
3873
* custom.h (_AIX): Add define of _XOPEN_SOURCE_EXTENDED.
3877
* configure.ac: Remove old stuff for ISC Unix, no longer needed.
3878
* configure: Regenerated.
3880
2016-01-25 John E. Malmberg <wb8tyw@qsl.net>
3882
* io.c (redirect): Need to call close_one more than once after
3883
running out of file handles.
3885
2016-01-25 Arnold D. Robbins <arnold@skeeve.com>
3887
* NEWS: Document VMS support updated.
3889
2016-01-24 Arnold D. Robbins <arnold@skeeve.com>
3891
Regex: treat [x] as x if x is a unibyte encoding error.
3892
This change removes an ifdef GAWK.
3894
* regcomp.c (parse_byte) [ !_LIBC && RE_ENABLE_I18N]: New function.
3895
(build_range_exp) [ !_LIBC && RE_ENABLE_I18N]: Use it.
3896
From Paul Eggert <eggert@cs.ucla.edu>.
3898
2016-01-22 Arnold D. Robbins <arnold@skeeve.com>
3900
* regexec.c (prune_impossible_nodes): Remove all attributes, on
3901
both declaration and definition. Fixes a Linux Mint 17 compilation
3902
braino reported by Antonio Colombo.
3903
* regex_internal.h (test_malloc): Add cast to silence a warning
3905
(test_realloc): Ditto.
3907
2016-01-20 Arnold D. Robbins <arnold@skeeve.com>
3909
* regex_internal.h [attribute_hidden]: Remove definition.
3910
* regcomp.c [attribute_hidden]: Remove uses. Not needed since
3911
the variables are static. Thanks to Paul Eggert for pointing
3914
2016-01-18 Paul Eggert <eggert@cs.ucla.edu>
3916
Diagnose ERE '()|\1'
3917
Problem reported by Hanno Boeck in: http://bugs.gnu.org/21513
3919
* lib/regcomp.c (parse_reg_exp): While parsing alternatives, keep
3920
track of the set of previously-completed subexpressions available
3921
before the first alternative, and restore this set just before
3922
parsing each subsequent alternative. This lets us diagnose the
3923
invalid back-reference in the ERE '()|\1'.
3925
Unrelated: General minor cleanups (spelling, code) from Gnulib:
3927
* regex.h, regex_internal.c, regex_internal.h, regexec.c: Minor
3930
2016-01-14 Arnold D. Robbins <arnold@skeeve.com>
3932
* eval.c (r_get_lhs): If original array was Node_var_new,
3933
assign value that is dupnode of Nnull_string and not
3934
Nnull_string directly. Fixes core dump reported by
3935
ruyk <Lonely.ruyk@mail.ru>.
3939
* ChangeLog: Cleanup spurious extra whitespace.
3941
2016-01-03 Arnold D. Robbins <arnold@skeeve.com>
3943
* configure.ac (GAWK_AC_LINUX_ALPHA): Remove call.
3944
* configure: Regenerated.
3945
* NEWS: Document removal of support for GNU/Linux on Alpha.
3947
2016-01-02 Arnold D. Robbins <arnold@skeeve.com>
3949
* dfa.c (add_utf8_anychar): Minor change in declaration of
3950
utf8_classes to keep Tiny CC happy. Also syncs with grep.
3951
* dfa.h: Sync with grep (update copyright year).
3953
2015-12-27 Arnold D. Robbins <arnold@skeeve.com>
3955
* awkgram.y (mk_condition): Revise to correctly handle
3956
empty else part for pretty printing. Bug report by
3957
ziyunfei <446240525@qq.com>.
3959
2015-12-20 Arnold D. Robbins <arnold@skeeve.com>
3961
* io.c (nonfatal): New static constant string.
3962
* is_non_fatal, is_non_fatal_redirect: Use it.
3964
2015-12-16 Arnold D. Robbins <arnold@skeeve.com>
3966
* io.c (two_way_open): Remove unneeded close of slave in the
3969
2015-12-16 Arnold D. Robbins <arnold@skeeve.com>
3971
* profile.c (pp_number): Move count into ifdef for MPFR. Avoids
3972
an unused variable warning if not compiling for MPFR.
3976
* io.c (two_way_open): If using a pty instead of pipes, open the
3977
slave in the child. Fixes AIX and doesn't seem to break GNU/Linux.
3979
2015-11-26 Arnold D. Robbins <arnold@skeeve.com>
3981
* command.y (cmdtab): Add "exit" as synonym for "quit".
3982
Suggested by Joep van Delft <joepvandelft@xs4all.nl>.
3983
* NEWS: Document this.
3985
2015-11-24 Arnold D. Robbins <arnold@skeeve.com>
3987
* debug.c (debug_pre_execute): Fix to check watchpoints before
3988
checking breakpoints. Gives more natural behavior for the user.
3989
* NEWS: Document this.
3990
Issue reported by Joep van Delft <joepvandelft@xs4all.nl>.
3992
2015-10-28 Arnold D. Robbins <arnold@skeeve.com>
3994
* awkgram.y (nextc): Don't allow '\0' even if check_for_bad
3995
is false. Fixes a problem reported by Hanno Boeck <hanno@hboeck.de>.
3999
* dfa.c: Sync with GNU grep.
4001
2015-10-25 Arnold D. Robbins <arnold@skeeve.com>
4003
* awkgram.y (yylex): Fix invalid write problems.
4004
Reported by Hanno Boeck <hanno@hboeck.de>.
4005
Only appeared in master. Harumph.
4007
2015-10-16 Arnold D. Robbins <arnold@skeeve.com>
4009
* Makefile.am (SUBDIRS): Fix ordering so that
4010
make check directly after configure works properly.
4011
Thanks to Michal Jaegermann <michal.jnn@gmail.com>
4016
* dfa.c: Sync with GNU grep.
4018
2015-10-11 Arnold D. Robbins <arnold@skeeve.com>
4020
* awkgram.y (yylex): Fix invalid read problems.
4021
Reported by Hanno Boeck <hanno@hboeck.de>.
4023
2015-10-04 Arnold D. Robbins <arnold@skeeve.com>
4025
* configure.ac: Bump version to 4.1.3a.
4027
2015-09-26 Arnold D. Robbins <arnold@skeeve.com>
4029
* awkgram.y (yylex): Diagnose multidimensional arrays for
4030
traditional/posix (fatal) or lint. Thanks to Ed Morton
4033
2015-09-25 Arnold D. Robbins <arnold@skeeve.com>
4035
* config.guess, config.sub, config.rpath: Updated.
4037
2015-09-18 Arnold D. Robbins <arnold@skeeve.com>
4039
* field.c (fpat_parse_field): Always use rp->non_empty instead
4040
of only if in_middle. The latter can be true even if we've
4041
already parsed part of the record. Thanks to Ed Morton
4044
2015-09-11 Daniel Richard G. <skunk@iSKUNK.ORG>
4046
* regcomp.c: Include strings.h, wrapped in ifdef. Revise
4048
* regex_internal.h: Remove ZOS_USS bracketing ifdefs.
4050
2015-09-04 Arnold D. Robbins <arnold@skeeve.com>
4052
* profile.c (pp_num): Use format_val to print integral values
4053
as integers. Thanks to Hermann Peifer for the report.
4055
2015-08-28 Daniel Richard G. <skunk@iSKUNK.ORG>
4057
* Makefile.am, configure.ac: Use an Automake conditional to
4058
enable/disable the "extensions" subdirectory instead of
4059
producing a stub Makefile therein from the configure script.
4060
* awk.h, custom.h, regex_internal.h: Removed z/OS-specific code
4061
that is no longer needed due to improvements in Gawk's general
4063
* awk.h: Allow <strings.h> to be #included together with
4064
<string.h> as this is required on some systems (z/OS).
4065
* io.c, configure.ac: <sys/select.h> is needed for select()
4066
and related bits on z/OS.
4067
* awk.h: Handle the redefinition of EXIT_FAILURE on z/OS in a
4068
more elegant/general way.
4069
* awkgram.y, command.y, configure.ac, eval.c,
4070
helpers/testdfa.c: Define and use the USE_EBCDIC cpp symbol
4071
instead of checking the value of 'a' whenever we want to know
4072
if we're on an EBCDIC system. Also, don't assume that z/OS
4073
necessarily means EBCDIC, as the compiler does have an ASCII
4075
* awkgram.y, command.y, configure.ac: On EBCDIC systems,
4076
convert singleton EBCDIC characters in the input stream to
4077
ASCII on the fly so that the generated awkgram.c/command.c in
4078
the distributed sources can be used, i.e. we don't have to
4079
require the user to build Bison and re-generate those files
4080
themselves. This implementation uses a z/OS-specific function
4081
(__etoa_l()) to do the conversion, but support for other
4082
systems can be added in the future as necessary.
4083
* io.c: No need to protect this block of "#if
4084
defined(HAVE_TERMIOS_H)" code from z/OS; it works just fine
4086
* configure.ac: Check for the "struct passwd.pw_passwd" and
4087
"struct group.gr_passwd" fields and conditionalize their use,
4088
as they don't exist on z/OS. Needed for doc/gawktexi.in.
4090
2015-08-25 Arnold D. Robbins <arnold@skeeve.com>
4092
* node.c (str2wstr): Upon finding an invalid character, if
4093
using UTF-8, use the replacement character instead of skipping
4094
it. Helps match() and other functions work better in the face
4095
of unexpected data. Make the lint warning an unconditional
4100
* awk.h: Add explanatory comment on the flags related to
4102
* mpfr.c (mpg_force_number): If setting NUMBER, clear STRING also
4103
when clearing MAYBE_NUM.
4104
(set_PREC): Check STRCUR instead of STRING.
4105
* node.c (r_force_number): If setting NUMBER, clear STRING also
4106
when clearing MAYBE_NUM.
4108
2015-08-15 Arnold D. Robbins <arnold@skeeve.com>
4110
* dfa.c (dfamust): Restore c90 compat by moving some
4111
variable declarations to the top of the routine.
4113
2015-08-12 Arnold D. Robbins <arnold@skeeve.com>
4115
* dfa.c: Sync with GNU grep. Yet again, again.
4117
2015-08-02 Arnold D. Robbins <arnold@skeeve.com>
4119
* dfa.c: Sync with GNU grep. Yet again.
4121
2015-07-21 Arnold D. Robbins <arnold@skeeve.com>
4123
* dfa.c: Sync with GNU grep.
4125
2015-07-18 Arnold D. Robbins <arnold@skeeve.com>
4127
* dfa.c: Sync with GNU grep.
4129
2015-07-08 Arnold D. Robbins <arnold@skeeve.com>
4131
* dfa.h, dfa.c: Sync with GNU grep.
4133
2015-06-29 Arnold D. Robbins <arnold@skeeve.com>
4135
* awkgram.y (yylex): If gawk extension function is found as
4136
a function in a user-defined function body, treat it normally.
4137
Makes eval "print and(a, 1)" work in the debugger again.
4138
Thanks, yet again, to Hermann Peifer.
4139
* interpret.h (r_interpret): Op_subscript. UPREF if the
4140
element value is a typed regexp. Thanks to Hermann Peifer.
4142
2015-06-28 Arnold D. Robbins <arnold@skeeve.com>
4144
Improve memory tracking of typed regexps.
4146
* awkgram.y (make_regnode): Set valref to 1.
4147
* interpret.h (r_interpret): Have Op_push_re upref typed regexp.
4148
* builtin.c (do_typeof): OK to deref typed regex.
4149
* awk.h (force_string): Do dupnode on the regexp text.
4151
2015-06-26 Arnold D. Robbins <arnold@skeeve.com>
4153
Remove support for old-style extensions.
4155
* awk.h (Node_old_ext_func, Op_old_ext_func): Removed.
4156
Remove all uses throughout the code.
4157
(load_old_ext, make_old_builtin): Remove declarations.
4158
* ext.c (load_old_ext, make_old_builtin): Removed.
4159
* awkgram.y (tokentab): Remove "extension" entry.
4160
* eval.c (Node_old_ext_funci, Op_old_ext_func): Remove from tables.
4161
* interpret.h (interpret): Remove stuff for old extensions.
4165
* builtin.c (do_typeof): Add support for strnum, distinguish
4166
untyped from unassigned, use "string" and "number". Thanks to
4167
Hermann Peifer for suggesting inclusion of strnum.
4169
2015-06-25 Arnold D. Robbins <arnold@skeeve.com>
4171
Further work straightening out memory management for typeof.
4173
* awk.h (DEREF): Add an assert.
4174
* builtin.c (do_typeof): Add comments, cases where not to deref.
4175
* debug.c (print_instruction): Add Op_push_arg_untyped.
4176
* interpret.h (r_interpret): Additional comments / tweaks for
4177
Op_push_arg_untyped.
4179
Unrelated. Make `x = @/foo/ ; print x' print something.
4181
* builtin.c (do_print): Check for Node_typedregex and handle it.
4182
Needed for adding test code.
4184
Unrelated. Typo fix.
4186
* debug.c (initialize_watch_item): Dupnode the right thing.
4188
2015-06-22 Arnold D. Robbins <arnold@skeeve.com>
4190
* awkgram.y (snode): Make isarray not scalarize untyped parameters
4192
* profile.c (pprint): Add Op_push_arg_untyped.
4194
Improve debugger support for typed regexps.
4195
Thanks to Hermann Peifer for the bug report.
4197
* awkgram.y (valinfo): Add support for Node_typedregex.
4198
* debug.c (watchpoint_triggered): Handle Node_typedregex.
4199
(initialize_watch_item): Ditto.
4200
(print_memory): Ditto.
4202
Fix typeof to work on subarrays. Thanks, yet again, to
4203
Hermann Peifer for the bug report.
4205
* builtin.c (do_typeof): Don't deref Node_var_array.
4207
2015-06-21 Arnold D. Robbins <arnold@skeeve.com>
4209
Fixes for typeof - Don't let typeof change an untyped variable
4212
* awk.h (opcodeval): Add Op_push_arg_untyped.
4213
* awkgram.y (snode): Separate out case for do_typeof, use
4214
Op_push_arg_untyped.
4215
* builtin.c (do_typeof): Arg will be equal to Nnull_string
4217
* eval.c (optypes): Add Op_push_arg_untyped.
4218
* interpret.h (r_interpret): Add Op_push_arg_untyped handling.
4220
2015-06-19 Arnold D. Robbins <arnold@skeeve.com>
4222
* builtin.c (do_isarray): Minor edit to lint warning.
4225
2015-06-14 Arnold D. Robbins <arnold@skeeve.com>
4227
* regcomp.c, regex_internal.h, regexec.c: Sync with GLIBC.
4231
* regex_internal.c, regexec.c: __attribute --> __attribute__.
4235
* regex_internal.h: Clean up defines for non-GCC for attribute;
4236
essentially sync it with GLIBC.
4238
2015-06-12 Arnold D. Robbins <arnold@skeeve.com>
4240
* awkgram.y: Finish converting "hard" regex to "typed" regex.
4242
2015-05-31 Arnold D. Robbins <arnold@skeeve.com>
4244
* field.c (posix_def_parse_field): Removed. It's no longer
4245
needed after updates to the POSIX standard. Thanks to
4246
Michael Klement <michael.klement@usa.net> for pointing this out.
4248
2015-05-26 Paul Eggert <eggert@Penguin.CS.UCLA.EDU>
4250
* floatcomp.c (count_trailing_zeros): New function.
4251
This compiles to a single TZCNT instruction on the x86-64.
4252
(adjust_uint): Use it to keep more high-order bits when
4253
some of the lowest-order bits are zero. This implements
4254
the documented behavior: "If the result cannot be represented
4255
exactly as a C 'double', leading nonzero bits are removed one by
4256
one until it can be represented exactly."
4258
2015-05-26 Arnold D. Robbins <arnold@skeeve.com>
4260
* regcomp.c: Fix offsets so error messages come out correct
4263
2015-05-19 Arnold D. Robbins <arnold@skeeve.com>
4265
* 4.1.3: Release tar ball made.
4267
2015-05-15 Andrew J. Schorr <aschorr@telemetry-investments.com>
4269
* symbol.c (load_symbols): Plug minor memory leak by calling unref(tmp)
4270
on "identifiers" string after assoc_lookup is done with it.
4272
2015-05-15 Andrew J. Schorr <aschorr@telemetry-investments.com>
4274
* main.c (load_procinfo_argv): New function to save argv array values
4275
in PROCINFO["argv"][0..argc-1].
4276
(load_procinfo): Call load_procinfo_argv.
4278
2015-05-11 Arnold D. Robbins <arnold@skeeve.com>
4280
* awk.h, awkgram.y, builtin.c, eval.c profile.c, re.c:
4281
Change Node_hardregex to Node_typedregex everywhere.
4283
2015-05-05 Arnold D. Robbins <arnold@skeeve.com>
4285
* awkgram.y (yylex): Yet Another Fix for parsing bracket
4286
expressions. Thanks yet again to Andrew Schorr. Maybe it's
4287
even finally nailed down now.
4291
* config.guess, config.sub: Get latest versions.
4293
Make profiling for hard regexes work.
4295
* profile.c (pp_string_or_hard_regex): Renamed from pp_string.
4296
Add bool param for hard regex and add @ if so.
4297
(pp_string): New function, calls pp_string_or_hard_regex.
4298
(pp_hard_regex): New function, calls pp_string_or_hard_regex.
4299
(pprint): Adjust to print a hard regex correctly.
4301
2015-05-01 Arnold D. Robbins <arnold@skeeve.com>
4303
* awkgram.y: Make sure values are not null in param list.
4304
Avoids core dump for `function f(func, a) {}'. Thanks to
4305
Tibor Palinkas <libmawk@igor2.repo.hu>.
4307
2015-04-30 Arnold D. Robbins <arnold@skeeve.com>
4309
* Makefile.am: Take --program-prefix into account when
4310
installing/uninstalling the symlinks, especially 'awk'.
4311
Thanks to Steffen Nurpmeso <sdaoden@yandex.com> for
4316
* awkgram.y (yylex): Yet Another Fix for parsing bracket
4317
expressions. Thanks again to Andrew Schorr.
4319
2015-04-29 Arnold D. Robbins <arnold@skeeve.com>
4321
* 4.1.2: Release tar ball made.
4323
2015-04-28 Arnold D. Robbins <arnold@skeeve.com>
4325
* builtin.c (isarray): Add lint warning that isarray()
4328
2015-04-28 Arnold D. Robbins <arnold@skeeve.com>
4330
* awkgram.y (yylex): Rework the bracket handling from zero.
4331
Thanks to Michal Jaegermann for yet another test case.
4335
* eval.c (setup_frame): Restore call-by-value for $0. This was
4336
necessitated by the changes on 2014-11-11 for conserving
4337
memory use. Thanks to Andrew Schorr for the report and isolating
4338
the cause of the problem.
4340
2015-04-27 Arnold D. Robbins <arnold@skeeve.com>
4342
* awkgram.y (yylex): Make change of Jan 7 for parsing regexps
4343
work better. Thanks to Nelson Beebe.
4345
2015-04-26 Arnold D. Robbins <arnold@skeeve.com>
4347
* dfa.c: Sync with grep.
4349
2015-04-16 Arnold D. Robbins <arnold@skeeve.com>
4351
* builtin.c (do_strftime): For bad time_t values, return "".
4353
2015-04-16 Andrew J. Schorr <aschorr@telemetry-investments.com>
4355
* node.c (r_force_number): If strtod sets errno, then force the
4356
numeric value in node->numbr to zero. For subnormal values, strtod
4357
sets errno but does not return zero, and we don't want to retain
4358
those subnormal values.
4360
2015-04-16 Arnold D. Robbins <arnold@skeeve.com>
4362
Let parameter names shadow the names of gawk additional built-ins.
4363
Make it actually work.
4365
* awkgram.y (want_param_names): Now an enum, there are three states.
4366
(grammar): Set states properly.
4367
(yylex): Improve checking logic.
4369
2015-04-16 Arnold D. Robbins <arnold@skeeve.com>
4371
* configure.ac: Updated by autoupdate.
4372
* configure, aclocal.m4: Regenerated.
4373
* io.c, main.c, profile.c: Removed use of RETSIGTYPE.
4375
2015-04-16 Arnold D. Robbins <arnold@skeeve.com>
4377
* builtin.c (do_strftime): Use a double for the timestamp and
4378
check that the value is within range for a time_t.
4382
* regex_internal.h (test_malloc, test_realloc): Use %lu in printf
4383
format for error messages. Thanks to Michal Jaegermann for
4390
2015-04-15 Arnold D. Robbins <arnold@skeeve.com>
4392
Let parameter names shadow the names of gawk additional built-ins.
4394
* awkgram.y (want_param_names): New variable.
4395
(yylex): Check it before returning a built-in token.
4396
(grammar): Set and clear it in the right places.
4398
2015-04-14 Arnold D. Robbins <arnold@skeeve.com>
4400
* builtin.c (do_strftime): Restore checking for negative result and
4401
add check that time_t is > 0 --- means we're assigning a negative value
4402
to an unsigned time_t. Thanks again to Glaudiston Gomes da Silva
4403
<glaudistong@gmail.com>.
4405
If localtime() or gmtime() return NULL, return a null string.
4406
Thanks to Andrew Schorr.
4409
* builtin.c (call_sub): Fix for indirect gensub, 3 args now works.
4413
* builtin.c (do_sub): Improve some variable names for readability
4414
and add / expand some comments.
4418
* builtin.c (call_sub, call_match, call_split_func): Allow for
4419
regex to be Node_hardregex.
4421
2015-04-14 Andrew J. Schorr <aschorr@telemetry-investments.com>
4422
Arnold D. Robbins <arnold@skeeve.com>
4424
* builtin.c (do_sub): Make computations smarter; initial len
4425
to malloc, test for final amount after all matches done and
4426
need to copy in the final part of the original string.
4428
2015-04-13 Arnold D. Robbins <arnold@skeeve.com>
4430
* regcomp.c (analyze): Prevent malloc(0).
4431
* regex_internal.h (test_malloc, test_realloc): New functions
4432
that check for zero count.
4433
(re_malloc, re_realloc): Adjust to call the new functions for gawk.
4434
* regexec.c (build_trtable, match_ctx_clean): Replace malloc/free
4435
with re_malloc/re_free.
4439
* builtin.c (do_strftime): Disable checking timestamp value for less
4440
than zero. Allows times before the epoch to work with strftime.
4441
Thanks to Glaudiston Gomes da Silva <glaudistong@gmail.com>
4442
for raising the issue.
4444
2015-04-12 Arnold D. Robbins <arnold@skeeve.com>
4446
* Makefile.am (efence): Make this link again.
4447
Thanks to Michal Jaegermann for pointing out the problem.
4449
2015-04-09 Andrew J. Schorr <aschorr@telemetry-investments.com>
4451
* awkgram.y (yyerror): Rationalize buffer size computations. Remove
4452
old valgrind workarounds.
4453
* debug.c (gprintf): Rationalize buffer size computations.
4454
(serialize_subscript): Ditto.
4455
* io.c (iop_finish): Rationalize buffer size computations.
4456
* profile.c (pp_string): Correct space allocation computation.
4458
2015-04-08 John E. Malmberg <wb8tyw@qsl.net>
4460
* custom.h: VMS shares some code paths with ZOS_USS in
4461
building gawkfts extension.
4463
2015-04-08 Arnold D. Robbins <arnold@skeeve.com>
4465
Factor out opening of /dev/XXX files from /inet.
4466
Enable interpretation of special filenames for profiling output.
4468
* awk.h (devopen_simple): Add declaration.
4469
* io.c (devopen_simple): New routine.
4470
(devopen): Call devopen_simple as appropriate.
4471
* profile.c (set_prof_file): Call devopen_simple as appropriate,
4472
some additional logic to handle fd to fp conversion.
4476
* main.c (usage): Add a comment for translators.
4478
2015-04-08 Eli Zaretskii <eliz@gnu.org>
4480
* profile.c (set_prof_file): Interpret a file name of "-" to mean
4483
2015-04-06 Arnold D. Robbins <arnold@skeeve.com>
4485
* awk.h (force_number): Add `!= 0' check to bitwise operation.
4486
* awkgram.y: Same, many places.
4487
(check_special): Simplify code for checking extension flags.
4489
2015-04-05 Arnold D. Robbins <arnold@skeeve.com>
4491
* awkgram.y (install_builtins): If do_traditional is true, do not
4492
install gawk extensions flagged with GAWKX. Similarly, if do_posix
4493
is true, do not install functions flagged with NOT_POSIX.
4494
This fixes a problem with spurious lint complaints about shadowing
4495
a global variable that is not valid in traditional or posix mode.
4496
Thanks to Andrew Schorr for finding the problem and supplying
4497
initial code; I did it slightly differently.
4499
2015-04-03 Arnold D. Robbins <arnold@skeeve.com>
4501
* awk.h (force_string): If hard_regex, return string text of the regex.
4502
(force_string, force_number): If hard_regex, return Nnull_string.
4503
* awkgram.y: Fix ~ and !~ with @/.../.
4504
* eval.c (setup_frame): Handle a hard regex.
4505
* re.c (avoid_dfa): Ditto.
4507
2015-04-02 Andrew J. Schorr <aschorr@telemetry-investments.com>
4509
* NEWS: Rename div to intdiv.
4511
2015-04-02 Arnold D. Robbins <arnold@skeeve.com>
4513
Rename div() to intdiv().
4515
* builtin.c (do_intdiv): Renamed from do_div.
4516
* mfpr.c (do_mpfr_intdiv): Renamed from do_mpfr_div.
4517
* awk.h: Update declarations.
4518
* awkgram.y (tokentab, snode): Revise accordingly.
4520
2015-03-31 Arnold D. Robbins <arnold@skeeve.com>
4522
* awk.h (call_sub): Renamed from call_sub_func.
4523
(call_match, call_split_func): Declare.
4524
* builtin.c (call_sub): Renamed from call_sub_func.
4525
(call_match, call_split_func): New functions.
4526
* interpret.h (r_interpret): Call new functions as appropriate.
4527
* node.c (r_unref): Revert change to handle Node_regex, not needed.
4529
2015-03-31 Arnold D. Robbins <arnold@skeeve.com>
4531
* awk.h (r_get_field): Declare.
4532
* builtin.c (call_sub_func): Rearrange the stack to be what
4533
the buitin function expects.
4534
* eval.c (r_get_field): Make extern.
4536
2015-03-27 Arnold D. Robbins <arnold@skeeve.com>
4538
* io.c (redirect): Change not_string from int to bool.
4539
* gawkapi.c (api_get_file): Minor stylistic improvements.
4540
* NEWS: Updated for retryable I/O and new API function.
4542
2015-03-24 Arnold D. Robbins <arnold@skeeve.com>
4544
* awkgram.y (make_regnode): Make extern.
4545
* awk.h (make_regnode): Declare.
4546
* builtin.c (call_sub_func): Start on reworking the stack to
4547
be what do_sub() expects. Still needs work.
4548
* interpret.h (r_interpret): Add a cast in comparison with do_sub().
4549
* node.c (r_unref): Handle Node_regex nodes.
4551
2015-03-24 Andrew J. Schorr <aschorr@telemetry-investments.com>
4553
* interpret.h (r_interpret): When Op_K_exit has an argument of
4554
Nnull_string, do not update exit_val, since no value was supplied.
4556
2015-03-24 Arnold D. Robbins <arnold@skeeve.com>
4558
* awk.h, gawkapi.c, io.c: Minor code reformatting.
4560
2015-03-20 Arnold D. Robbins <arnold@skeeve.com>
4562
Start on fixing indirect calls of builtins.
4564
* awk.h (call_sub_func): Add declaration.
4565
* awkgram.y (lookup_builtin): Handle length, sub functions.
4566
(install_builtin): Handle length function.
4567
* builtin.c (call_sub_func): New function.
4568
* interpret.h (r_interpret): If calling do_sub, do it through
4571
2015-03-19 Arnold D. Robbins <arnold@skeeve.com>
4573
* re.c (re_update): Handle hard regex - for sub/gsub/gensub.
4574
* awkgram.y (grammar): Add support for hard_regex with ~ and !~;
4575
allowed only on the right hand side.
4576
(mk_rexp): Handle a hard regex.
4578
2015-03-18 Arnold D. Robbins <arnold@skeeve.com>
4580
* builtin.c (do_typeof): Be smarter about checking for uninitialized
4581
values; can now detect and return "untyped" for such values.
4582
* awkgram.y (yylex): Collect @/.../ entirely in the lexer and return
4583
a new terminal (HARD_REGEX).
4584
(regexp): Reverted to just a regular awk regexp constant.
4585
(hard_regexp): New nonterminal, can be used only in direct
4586
assignment and as an argument in function call. New set of nonterminals
4587
for function call expression lists. More work still to do.
4589
2015-03-18 Arnold D. Robbins <arnold@skeeve.com>
4591
* config.guess, config.sub: Updated, from libtool 2.4.6.
4593
2015-03-17 Arnold D. Robbins <arnold@skeeve.com>
4595
* profile.c (pp_number): Allocate enough room to print the number
4596
in all cases. Was a problem mixing -M with profiling with a really
4597
big number. Thanks to Hermann Peifer for the bug report.
4599
2015-03-08 Arnold D. Robbins <arnold@skeeve.com>
4601
* re.c (regexflags2str): Removed. It was redundant.
4603
* io.c (devopen): Change the logic such that if nonfatal is true
4604
for the socket, don't do retries. Also clean up the formatting
4605
some. At strictopen, check if errno is ENOENT and if so, propagate
4606
the error from getaddrinfo() up to the caller. Add explanatory
4609
2015-02-28 Andrew J. Schorr <aschorr@telemetry-investments.com>
4611
* io.c (pty_vs_pipe): Remove check for NULL PROCINFO_node, since
4612
this is now checked inside in_PROCINFO.
4614
2015-02-27 Andrew J. Schorr <aschorr@telemetry-investments.com>
4616
* io.c (socketopen): New parameter hard_error; set it if
4617
getaddrinfo() fails. Change fatals to warnings.
4618
(devopen): Pass in address of boolean hard_error variable
4619
and stop trying to open the file if hard_error is true.
4620
Save and restore errno around call to socketopen() and
4621
use restored errno if open() fails at strictopen.
4623
2015-02-27 Arnold D. Robbins <arnold@skeeve.com>
4625
* symbol.c (check_param_names): Fix argument order in memset() call.
4626
* configure.ac: Use AC_SEARCH_LIBS instead of AC_CHECK_LIB. This fixes
4627
a long-standing problem where `-lm' was used twice in the final
4630
2015-02-27 Arnold D. Robbins <arnold@skeeve.com>
4632
Start on making regexp a real type.
4634
* awk.h (Node_hardregex): New node type.
4635
(do_typeof): Add declaration.
4636
* awkgram.y: Make @/.../ a hard regex.
4637
(tokentab): New entry for typeof() function.
4638
(snode): Try to handle typeof().
4639
(make_regnode): Handle Node_hardregex.
4640
* builtin.c (do_typeof): New function.
4641
* eval.c (nodetypes): Add Node_hardregex.
4642
* re.c (re_update): Check for hardregex too in assert.
4644
2015-02-24 Arnold D. Robbins <arnold@skeeve.com>
4646
* POSIX.STD: Update copyright year.
4647
* awkgram.y (yylex): Allow \r after \\ line continuation everywhere.
4648
Thanks to Scott Rush <scott.rush@honeywell.com> for the report.
4650
2015-02-13 Arnold D. Robbins <arnold@skeeve.com>
4652
* awkgram.y (yylex): Be more careful about passing true to
4653
nextc() when collecting a regexp. Some systems' iscntrl()
4654
are not as forgiving as GLIBC's. E.g., Solaris.
4655
Thanks to Dagobert Michelsen <dam@baltic-online.de> for
4656
the bug report and access to systems to check the fix.
4658
2015-02-12 Arnold D. Robbins <arnold@skeeve.com>
4660
* POSIX.STD: Update with info about function parameters.
4661
* configure.ac: Remove test for / use of dbug library.
4663
2015-02-11 Arnold D. Robbins <arnold@skeeve.com>
4665
* gawkapi.h: Fix spelling error in comment.
4667
2015-02-10 Arnold D. Robbins <arnold@skeeve.com>
4669
* profile.c (pprint): Restore printing of count for rules.
4670
Bug report by Hermann Peifer.
4672
2015-02-08 Arnold D. Robbins <arnold@skeeve.com>
4674
* io.c: Make it "NONFATAL" everywhere.
4676
2015-02-08 Andrew J. Schorr <aschorr@telemetry-investments.com>
4678
* awk.h (RED_NON_FATAL): Removed.
4679
(redirect): Add new failure_fatal parameter.
4680
(is_non_fatal_redirect): Add declaration.
4681
* builtin.c (efwrite): Rework check for non-fatal.
4682
(do_printf): Adjust calls to redirect.
4683
(do_print_rec): Ditto. Move check for redirection error up.
4684
* io.c (redflags2str): Remove RED_NON_FATAL.
4685
(redirect): Add new failure_fatal parameter. Simplify the code.
4686
(is_non_fatal_redirect): New function.
4687
(do_getline_redir): Adjust calls to redirect.
4689
2014-12-27 Arnold D. Robbins <arnold@skeeve.com>
4691
* awk.h (is_non_fatal_std): Declare new function.
4692
* io.c (is_non_fatal_std): New function.
4693
* builtin.c (efwrite): Call it.
4695
2015-02-07 Arnold D. Robbins <arnold@skeeve.com>
4697
* regcomp.c, regex.c, regex.h, regex_internal.c, regex_internal.h,
4698
regexec.c: Sync with GLIBC. Mostly copyright date updates.
4700
2015-02-05 Andrew J. Schorr <aschorr@telemetry-investments.com>
4702
* eval.c (set_IGNORECASE): If IGNORECASE has a numeric value, try
4703
using that before treating it as a string. This fixes a problem
4704
where setting -v IGNORECASE=0 on the command line was not working
4707
2015-02-01 Arnold D. Robbins <arnold@skeeve.com>
4709
Move POSIX requirement for disallowing parameter names with the
4710
same name as a function into --posix.
4712
* NEWS: Document it.
4713
* awkgram.y (parse_program): Check do_posix before calling
4714
check_param_names().
4715
* symbol.c (check_param_names): Set up a fake node and call
4716
in_array() for function parameter names instead of linear
4717
searching the function list a second time. Thanks to Andrew
4718
Schorr for the motivation.
4720
2015-01-30 Arnold D. Robbins <arnold@skeeve.com>
4722
Don't allow function parameter names to be the same as function
4723
names - required by POSIX. Bug first reported in comp.lang.awk.
4725
In addition, don't allow use of a parameter as a function name
4726
in a call (but it's ok in indirect calls).
4729
* awk.h (check_param_names): Add declaration.
4730
* awkgram.y (at_seen): New variable. Communicates between
4731
yylex() and the parser.
4732
(FUNC_CALL production): Check at_seen and check that the identifier
4734
(parse_program): Call check_param_names() and set errcount.
4735
(yylex): Set at_seen after seeing an at-sign.
4736
* symbol.c (check_param_names): New function.
4738
2015-01-24 Arnold D. Robbins <arnold@skeeve.com>
4740
Infrastructure updates.
4742
Bison 3.0.4. Automake 1.15. Gettext 0.19.4.
4744
2015-01-20 Arnold D. Robbins <arnold@skeeve.com>
4746
* gawkapi.c (api_set_array_element): Remove useless call to
4748
* symbol.c (load_symbols): Ditto.
4749
Thanks to Andrew Schorr for pointing out the problem.
4751
2015-01-19 Arnold D. Robbins <arnold@skeeve.com>
4753
* awkgram.c: Update to bison 3.0.3.
4757
2015-01-16 Stephen Davies <sdavies@sdc.com.au>
4759
* awkgram.y (rule): Set first_rule to false. Catches more cases
4760
for gathering comments. Thanks to Hermann Peifer for the test case.
4762
2015-01-15 Arnold D. Robbins <arnold@skeeve.com>
4764
* dfa.h, dfa.c: Sync with grep. Mainly copyright updates.
4765
* getopt.c, getopt.h, getopt1.c getopt_int.h: Sync with GLIBC.
4766
Mainly copyright updates, one minor code fix.
4768
2015-01-14 Arnold D. Robbins <arnold@skeeve.com>
4770
Remove deferred variables.
4772
* awk.h (register_deferred_variable): Remove declaration.
4773
* awkgram.y (is_deferred_variable, process_deferred,
4774
symtab_used, extensions_used, deferred_variables,
4775
process_deferred): Remove declarations, bodies, and uses.
4776
* builtin.c (do_length): Update comment.
4777
* main.c (init_vars): Just call load_procinfo() and `load_environ()'.
4779
2015-01-08 Andrew J. Schorr <aschorr@telemetry-investments.com>
4781
Revert changes to API deferred variable creation -- these variables
4782
should be created when lookup is called, not when update is called.
4783
* awk.h (variable_create): Remove function declaration.
4784
* awkgram.y (variable_create): Remove function.
4785
(variable): Restore variable_create functionality inline.
4786
* gawkapi.c (api_sym_update): Revert to using install_symbol, since the
4787
deferred variable check should be done when lookup is called, not here.
4789
2015-01-07 Andrew J. Schorr <aschorr@telemetry-investments.com>
4791
* gawkapi.c (api_set_array_element): Remove stray call to
4792
make_aname. I cannot see what purpose this served. Maybe I am
4795
2015-01-07 Arnold D. Robbins <arnold@skeeve.com>
4797
* configure.ac: Update debug flags if developing.
4798
* awkgram.y (yylex): Regex parsing bug fix for bracket expressions.
4799
Thanks to Mike Brennan for the report.
4800
* builtin.c (format_tree): Catch non-use of count$ for dynamic
4801
field width or precision.
4805
Load deferred variables if extensions are used; they might
4806
want to access PROCINFO and/or ENVIRON. Thanks to Andrew Schorr
4807
for pointing out the issue.
4809
* awkgram.y (extensions_used): New variable. Set it on @load.
4810
(do_add_scrfile): Set it on -l.
4811
(process_deferred): Check it also.
4813
2015-01-06 Andrew J. Schorr <aschorr@telemetry-investments.com>
4815
* gawkapi.c (api_sym_update): If copying a subarray, must update
4816
the parent_array pointer. Also, call the astore hook if non-NULL.
4817
(api_set_array_element): Call the astore hook if non-NULL.
4819
2015-01-06 Andrew J. Schorr <aschorr@telemetry-investments.com>
4821
* awk.h (variable_create): Now takes a 3rd argument to tell caller
4822
whether this is a deferred variable.
4823
* awkgram.y (variable_create): Return indicator of whether this is
4824
a deferred variable in a newly added 3rd arg.
4825
(variable): Pass 3rd arg to variable_create.
4826
* gawkapi.c (api_sym_update): If we triggered the creation of a deferred
4827
variable, we must merge the extension's array elements into the deferred
4828
array, not the other way around. The ENVIRON array has special funcs
4829
to call setenv and unsetenv.
4831
2015-01-06 Andrew J. Schorr <aschorr@telemetry-investments.com>
4833
* awk.h (variable_create): Declare new function.
4834
* awkgram.y (variable_create): New function to create a variable
4835
taking the deferred variable list into consideration.
4836
(variable): Call new function variable_create if the variable is
4838
* gawkapi.c (api_sym_update): If an array is being created, then
4839
call new function variable_create instead of install_symbol. If this
4840
is the first reference to a deferred variable, than the new array
4841
may contain elements that must be merged into the array provided by
4844
2015-01-05 Andrew J. Schorr <aschorr@telemetry-investments.com>
4846
* io.c (wait_any): If the `interesting' argument is non-zero, then we
4847
must not return until that child process has exited, since the caller
4848
gawk_pclose depends on our returning its exit status. So in that case,
4849
do not pass WNOHANG to waitpid.
4851
2015-01-04 Andrew J. Schorr <aschorr@telemetry-investments.com>
4853
* gawkapi.h: Fix another comment typo.
4855
2015-01-04 Andrew J. Schorr <aschorr@telemetry-investments.com>
4857
* gawkapi.h: Fix typo in comment.
4859
2015-01-02 Andrew J. Schorr <aschorr@telemetry-investments.com>
4861
* gawkapi.h (gawk_api): Modify api_get_file to remove the typelen
4863
(get_file): Remove typelen argument from the macro.
4864
* gawkapi.c (api_get_file): Remove typelen argument.
4866
2014-12-24 Arnold D. Robbins <arnold@skeeve.com>
4868
* profile.c (pprint): Be sure to set ip2 in all paths
4869
through the code. Thanks to GCC 4.9 for the warning.
4871
2014-12-18 Arnold D. Robbins <arnold@skeeve.com>
4873
* builtin.c (do_sub): Do not waste a byte at the end of a string.
4875
2014-12-14 Arnold D. Robbins <arnold@skeeve.com>
4877
* awkgram.y (yyerror): Do not waste a byte at the end of a string.
4878
* builtin.c (do_match): Ditto.
4879
* command.y (append_statement): Ditto.
4880
* debug.c (gprintf, serialize): Ditto.
4881
* field.c (set_FIELDWIDTHS): Ditto.
4882
* io.c.c (grow_iop_buffer): Ditto.
4883
* profile.c (pp_string, pp_group3): Ditto.
4885
2014-12-14 Andrew J. Schorr <aschorr@telemetry-investments.com>
4887
* array.c (concat_exp): Do not waste a byte at the end of a string.
4888
* awkgram.y (common_exp): Ditto.
4889
* builtin.c (do_substr): Ditto.
4890
* eval.c (set_OFS): Ditto.
4891
* field.c (rebuild_record): Ditto.
4892
* gawkapi.h (r_make_string): Ditto.
4893
* interpret.h (r_interpret): Ditto for Op_assign_concat.
4894
* node.c (r_format_val, r_dupnode, make_str_node, str2wstr, wstr2str):
4896
* re.c (make_regexp): Ditto.
4898
2014-12-20 Arnold D. Robbins <arnold@skeeve.com>
4900
Enable non-fatal output on per-file or global basis,
4903
* awk.h (RED_NON_FATAL): New redirection flag.
4904
* builtin.c (efwrite): If RED_NON_FATAL set, just set ERRNO and return.
4905
(do_printf): Check errflg and if set, set ERRNO and return.
4907
(do_print_rec): Ditto.
4908
* io.c (redflags2str): Update table.
4909
(redirect): Check for global PROCINFO["nonfatal"] or for
4910
PROCINFO[file, "nonfatal"] and don't fail on open if set.
4911
Add RED_NON_FATAL to flags.
4912
(in_PROCINFO): Make smarter and more general.
4914
2014-12-12 Stephen Davies <sdavies@sdc.com.au>
4916
Improve comment handling in pretty printing.
4918
* awk.h (comment_type): New field in the node.
4919
(EOL_COMMENT, FULL_COMMENT): New defines.
4920
* awkgram.y (block_comment): New variable.
4921
(check_comment): New function.
4922
(grammar): Add code to handle comments as needed.
4923
(get_comment): Now takes a flag indicating kind of comment.
4924
(yylex): Collect comments appropriately.
4925
(append_rule): Ditto.
4926
* profile.c (pprint): Smarten up comment handling.
4927
Have printing \n take comments into account.
4928
(end_line): New function.
4929
(pp_func): Better handling of function comments.
4931
2014-12-10 Arnold D. Robbins <arnold@skeeve.com>
4933
* dfa.c: Sync with GNU grep.
4935
2014-11-26 Arnold D. Robbins <arnold@skeeve.com>
4937
* builtin.c (do_sub): Improve wording of gensub warnings.
4939
2014-11-25 Arnold D. Robbins <arnold@skeeve.com>
4941
* builtin.c (do_sub): For gensub, add more warnings for invalid
4944
2014-11-23 Arnold D. Robbins <arnold@skeeve.com>
4946
* awk.h: Move all inline functions to the bottom of the file.
4947
Keeps modern GCC happier.
4949
2014-11-22 Arnold D. Robbins <arnold@skeeve.com>
4951
* awk.h (emalloc, realloc): Redefine in terms of ...
4952
(emalloc_real, erealloc_real): New static inline functions.
4953
(fatal): Move definition up.
4954
* gawkmisc.c (xmalloc): If count is zero, make it one for older
4955
mallocs that require size > 0 (such as z/OS).
4957
2014-11-21 Arnold D. Robbins <arnold@skeeve.com>
4959
* main.c: Remove a debugging // comment.
4964
Revert changes of 2014-11-20 from Paul Eggert. Causes failures
4967
Unrelated: Avoid unnecessary copying of $0.
4969
* interpret.h (UNFIELD): New macro.
4970
(r_interpret): Use it where *lhs is assigned to.
4972
2014-11-20 Paul Eggert <eggert@cs.ucla.edu>
4974
Port to systems where malloc (0) and/or realloc(P, 0) returns NULL.
4975
* gawkmisc.c (xmalloc):
4976
* xalloc.h (realloc):
4977
Do not fail if malloc(0) or realloc(P, 0) returns NULL.
4978
Fail only when the allocator returns null when attempting to
4979
allocate a nonzero number of bytes.
4981
2014-11-19 Arnold D. Robbins <arnold@skeeve.com>
4983
Infrastructure upgrades:
4985
* Automake 1.14.1, Gettext 0.19.3, Libtool 2.4.3.
4986
* compile, extension/build-aux/compile: New files.
4988
2014-11-19 gettextize <bug-gnu-gettext@gnu.org>
4990
* configure.ac (AM_GNU_GETTEXT_VERSION): Bump to 0.19.3.
4992
2014-11-16 Arnold D. Robbins <arnold@skeeve.com>
4994
* interpret.h: Revert change of 2014-11-11 since it breaks
4999
* dfa.c: Sync with GNU grep.
5001
2014-11-15 Arnold D. Robbins <arnold@skeeve.com>
5003
* array.c, awk.h, awkgram.y, builtin.c, dfa.c, eval.c, field.c,
5004
interpret.h, io.c, main.c, mpfr.c, node.c, re.c, regex_internal.h,
5005
replace.c: Remove all uses of MBS_SUPPORT.
5006
* regex_internal.h: Disable wide characters on DJGPP.
5007
* mbsupport.h: Rework to be needed only for DJGPP.
5009
2014-11-11 Arnold D. Robbins <arnold@skeeve.com>
5011
Don't let memory used increase linearly in the size of
5012
the input. Problem reported by dragan legic
5013
<dragan.legic@yandex.ru>.
5015
* field.c (set_record): NUL-terminate the buffer.
5016
* interpret.h (r_interpret): Op_field_spec: if it's $0, increment
5017
the valref. Op_store_var: if we got $0, handle it appropriately.
5019
2014-11-10 Arnold D. Robbins <arnold@skeeve.com>
5021
Reorder main.c activities so that we can set a locale on the
5022
command line with the new, for now undocumented, -Z option.
5024
* main.c (parse_args, set_locale_stuff): New functions.
5025
(stopped_early): Made file level static.
5026
(optlist, optab): Add new argument.
5027
(main): Adjust ordering and move inline code into new functions.
5029
2014-11-09 Andrew J. Schorr <aschorr@telemetry-investments.com>
5031
* gawkapi.c (node_to_awk_value): When the type wanted is AWK_UNDEFINED
5032
and a it's a Node_val set to Nnull_string, return AWK_UNDEFINED instead
5035
2014-11-06 Andrew J. Schorr <aschorr@telemetry-investments.com>
5037
* awk.h (redirect_string): First argument should be const. Add a new
5038
extfd argument to enable extensions to create files with pre-opened
5040
(after_beginfile): Declare function used in both eval.c and gawkapi.c.
5041
* eval.c (after_beginfile): Remove extern declaration now in awk.h.
5042
* gawkapi.c (api_get_file): Implement API changes to return
5043
awk_input_buf_t and/or awk_output_buf_t info, as well as accept an
5044
fd for inserting an opened file into the table.
5045
* gawkapi.h (gawk_api): Modify the api_get_file declaration to
5046
return awk_bool_t and add 3 new arguments -- a file descriptor
5047
for inserting an already opened file, and awk_input_buf_t and
5048
awk_output_buf_t to return info about both input and output.
5049
(get_file): Add new arguments to the macro.
5050
* io.c (redirect_string): First arg should be const, and add a new
5051
extfd arg so extensions can pass in a file that has already been
5052
opened by the extension. Use the passed-in fd when appropriate,
5053
and pass it into two_way_open.
5054
(redirect): Pass new fd -1 arg to redirect_string.
5055
(two_way_open): Accept new extension fd parameter and open it
5058
2014-11-05 Andrew J. Schorr <aschorr@telemetry-investments.com>
5060
* io.c (retryable): New function to indicate whether I/O can be
5061
retried for this file instead of throwing a hard error.
5062
(get_a_record) Check whether this file is configured for retryable
5063
I/O before returning nonstandard -2.
5065
2014-11-03 Norihiro Tanaka <noritnk@kcn.ne.jp>
5067
* re.c (research): Use dfa superset to improve matching speed.
5069
2014-11-02 Arnold D. Robbins <arnold@skeeve.com>
5071
* profile.c (div_on_left_mul_on_right): New function.
5072
(parenthesize): Call it.
5074
2014-10-30 Arnold D. Robbins <arnold@skeeve.com>
5076
* configure: Regenerated after fix to m4/readline.m4.
5078
Unrelated; fixes to profiling. Thanks to Hermann Peifer and
5079
Manuel Collado for pointing out problems:
5081
* profile.c (pprint): For Op_unary_minus, parenthesize -(-x)
5083
(prec_level): Get the levels right (checked the grammar).
5084
(is_unary_minus): New function.
5085
(pp_concat): Add checks for unary minus; needs to be parenthesized.
5087
2014-10-30 Andrew J. Schorr <aschorr@telemetry-investments.com>
5089
* NEWS: Mention installation of /etc/profile.d/gawk.{csh,sh}.
5091
2014-10-29 Andrew J. Schorr <aschorr@telemetry-investments.com>
5093
* configure.ac (AC_CONFIG_FILES): Add extras/Makefile.
5094
* Makefile.am (SUBDIRS): Add extras.
5095
* extras: Add new subdirectory.
5097
2014-10-29 Arnold D. Robbins <arnold@skeeve.com>
5099
* dfa.c: Sync with GNU grep. Again, again.
5101
2014-10-28 Arnold D. Robbins <arnold@skeeve.com>
5103
* dfa.c: Sync with GNU grep. Again.
5105
2014-10-25 Arnold D. Robbins <arnold@skeeve.com>
5107
* dfa.c: Sync with GNU grep.
5109
2014-10-17 John E. Malmberg <wb8tyw@qsl.net>
5111
* ext.c (close_extensions): Test for null pointer since
5112
since this can be called by signal handler before the
5113
pointers are initialized.
5115
2014-10-15 Arnold D. Robbins <arnold@skeeve.com>
5117
Make sane the handling of AWKPATH and AWKLIBPATH:
5119
1. Don't explicitly search "."; it must be in the path either
5120
physically or as null element a la the shell's $PATH
5121
2. If environment's value was empty, use built-in default value.
5122
3. Set ENVIRON["AWK*PATH"] to the path used.
5124
* io.c (path_info): Remove try_cwd member.
5125
(get_cwd): Removed, not needed anymore.
5126
(do_find_source): Don't do explicit check in current directory.
5127
It must come from the AWKPATH or AWKLIBPATH variable.
5128
* main.c (path_environ): If value from environment was empty,
5129
set it to the default. This is how gawk has behaved since 2.10.
5131
2014-10-13 Arnold D. Robbins <arnold@skeeve.com>
5133
* regcomp.c (__re_error_msgid): Make error message for REG_EBRACK
5134
more helpful - also used for unmatched [:, [., [=.
5135
Thanks to Davide Brini for raising the issue.
5137
2014-10-12 KO Myung-Hun <komh78@gmail.com>
5141
* Makefile.am (install-exec-hook, uninstall-links): Use $(EXEEXT).
5142
* getopt.h: Redefinitions if using KLIBC.
5143
* io.c (_S_IFDIR, _S_IRWXU): Define if the more standard versions
5146
2014-10-12 Arnold D. Robbins <arnold@skeeve.com>
5148
* README: Remove Pat Rankin from VMS duties, per his request.
5150
2014-10-08 Arnold D. Robbins <arnold@skeeve.com>
5152
* dfa.c: Sync with GNU grep.
5154
2014-10-05 Arnold D. Robbins <arnold@skeeve.com>
5156
* profile.c (pprint): Fix typo in header. Sheesh.
5160
* awkgram.y (mk_program): Add a comment that we don't need to
5161
clear the comment* variables.
5163
2014-10-04 Arnold D. Robbins <arnold@skeeve.com>
5165
* profile.c (pp_string_fp): Fix breaklines case to actually
5166
output the current letter. This broke at gawk 4.0.0. Sigh.
5167
Thanks to Bert Bos (bert@w3.org) for the report.
5169
2014-10-03 Stephen Davies <sdavies@sdc.com.au>
5171
* awkgram.y (program_comment): Renamed from comment0.
5172
(function_comment): Renamed from commentf.
5174
2014-10-02 Arnold D. Robbins <arnold@skeeve.com>
5176
* awkgram.y, profile.c: Minor white space cleanups.
5178
2014-10-01 Arnold D. Robbins <arnold@skeeve.com>
5180
Fix a few compile warnings:
5182
* awkgram.y (split_comment): Make static.
5183
General: Remove some unused variables, clean up some whitepace nits.
5185
* profile.c (indent): Add some braces to turn off compiler warnings.
5187
2014-09-29 Andrew J. Schorr <aschorr@telemetry-investments.com>
5189
* main.c (main): In optlist, it should say "h", not "h:", since there
5190
is no argument for the help option. Thanks to Joep van Delft for
5193
2014-09-29 Arnold D. Robbins <arnold@skeeve.com>
5195
* gawkapi.h: Minor edits to sync with documentation. Does not
5196
influence the behavior of the API.
5198
2014-09-28 Arnold D. Robbins <arnold@skeeve.com>
5200
* command.y (cmdtab): Add "where" as an alias for "backtrace".
5205
* dfa.c: Sync with GNU grep.
5207
2014-09-27 Arnold D. Robbins <arnold@skeeve.com>
5209
* awkgram.y (check_for_bad): Bitwise-and the bad character with 0xFF
5210
to avoid sign extension into a large integer.
5214
* configure.ac: Add an option to enable locale letters in identifiers.
5215
Undocumented and subject to being rescinded at any time in the future.
5216
* awkgram.y (is_alpha): Actual code is here.
5217
* NEWS: Mention to look at configure --help.
5221
* profile.c (pprint): Use "rule(s)" instead of "block(s)" in the
5224
2014-09-23 Arnold D. Robbins <arnold@skeeve.com>
5226
* awkgram.y (yylex): Don't check for junk characters inside
5227
quoted strings. Caused issues on DJGPP and Solaris.
5231
* io.c (devopen): Straighten things out with respect to
5232
compatibility with BWK awk.
5234
2014-09-19 Arnold D. Robbins <arnold@skeeve.com>
5236
* awkgram.y: Further commentary as to the treacherousness
5237
of isalnum and isalpha.
5239
2014-09-15 Arnold D. Robbins <arnold@skeeve.com>
5241
Finish removing use of isalpha and isalnum.
5243
* awk.h (is_alpha, is_alnum, is_identchar): Add declarations.
5244
* awkgram.y (yylex): Use is_alpha.
5245
(is_alpha, is_alnum): New functions.
5246
(is_identchar): Use is_alnum.
5247
* builtin.c (r_format_tree): Use is_alpha, is_alnum.
5248
* command.y (yylex): Use is_alpha, is_identchar.
5249
* ext.c (is_letter): Use is_alpha.
5250
(is_identifier_char): Removed; replaced uses with is_identchar.
5251
* main.c (arg_assign): Use is_alpha, is_alnum.
5252
* node.c (r_force_number): Use is_alpha.
5254
2014-09-14 Arnold D. Robbins <arnold@skeeve.com>
5256
* awkgram.y (is_identchar): Change from simple macro to function
5257
since use of isalnum() let non-ASCII letters slip through into
5260
2014-09-13 Stephen Davies <sdavies@sdc.com.au>
5262
When doing pretty-printing (but not profiling), include the original
5263
comments in the output.
5268
- Do NOT indent by a tab
5269
- Do NOT print the header comments ("# BEGIN rules", etc.)
5270
- DO print the comments that are in the program
5273
- DO indent by a tab
5274
- DO print the header comments
5275
- Do NOT print the program's original comments
5277
* awkgram.y (comment0, commentf): New variables that are pointers to
5278
program and function comments.
5279
(get_comment): New function that retrieves consecutive comment lines
5280
and empty lines as a unit).
5281
(split_comment): New function: iff first block in the program is a
5282
function and it is preceded by comments, take the last non-blank
5283
line as function comment and any preceding lines as program comment.)
5285
Following token rules were changed to handle comments:
5287
* awkgram.y (pattern, LEX_BEGIN, LEX_END, LEX_BEGINFILE, LEX_ENDFILE,
5288
action, function_prologue, statements): Update to handle comments.
5290
Following functions were changed to handle comments:
5292
* awkgram.y (mk_program, mk_function, allow_newline and yylex): Update
5293
to handle comments. (Also fixed typo in case '\\'.)
5295
* profile.c (print_comment): New function to format comment printing.
5296
(indent, pprint, dump_prog, pp_func): Changed to handle comments and
5297
the revised indentation rules.
5299
2014-09-07 Arnold D. Robbins <arnold@skeeve.com>
5301
* awk.h: Move libsigsegv stuff to ...
5302
* main.c: here. Thanks to Yehezkel Bernat for motivating
5304
* symbol.c (make_symbol, install, install_symbol): Add const to
5305
first parameter. Adjust decls and fix up uses.
5307
2014-09-05 Arnold D. Robbins <arnold@skeeve.com>
5309
Add builtin functions to FUNCTAB for consistency.
5311
* awk.h (Node_builtin_func): New node type.
5312
(install_builtins): Declare new function.
5313
* awkgram.y [DEBUG_USE]: New flag value for debug functions; they
5314
don't go into FUNCTAB.
5315
(install_builtins): New function.
5316
* eval.c (nodetypes): Add Node_builtin_func.
5317
* interpret.h (r_interpret): Rework indirect calls of built-ins
5318
since they're now in the symbol table.
5319
* main.c (main): Call `install_builtins'.
5320
* symbol.c (install): Adjust for Node_builtin_func.
5321
(load_symbols): Ditto.
5323
2014-09-04 Arnold D. Robbins <arnold@skeeve.com>
5325
* profile.c (pprint): Case Op_K_for: Improve printing of
5326
empty for loop header.
5328
Unrelated: Make indirect function calls work for built-in and
5329
extension functions.
5331
* awkgram.y (lookup_builtin): New function.
5332
* awk.h (builtin_func_t): New typedef.
5333
(lookup_builtin): Declare it.
5334
* interpret.h (r_interpret): For indirect calls, add code to
5335
find and call builtin functions, and call extension functions.
5337
2014-09-01 Arnold D. Robbins <arnold@skeeve.com>
5339
* builtin.c (do_substr): Return "" instead of null string in case
5340
result is passed to length() with --lint. Based on discussions in
5345
* interpret.h (r_interpret): For indirect function call, separate
5346
error message if lookup returned NULL. Otherwise got a core dump.
5347
Thanks to "Kenny McKormack" for the report in comp.lang.awk.
5349
2014-08-27 Arnold D. Robbins <arnold@skeeve.com>
5351
* configure.ac: Add test for strcasecmp.
5352
* regcomp.c: Remove special case code around use of strcasecmp().
5353
* replace.c: Include missing/strncasecmp.c if either strcasecmp()
5354
or strncasecmp() aren't available.
5356
2014-08-26 Arnold D. Robbins <arnold@skeeve.com>
5358
* regcomp.c, regex_internal.c: Sync with GBLIC. Why not.
5362
Remove support for MirBSD. It uglified the code too much
5363
for no discernible gain.
5365
* configure.ac: Remove check for MirBSD and define of
5367
* dfa.c: Remove code depending on LIBC_IS_BORKED.
5372
2014-08-24 Arnold D. Robbins <arnold@skeeve.com>
5374
* regex.h: Remove underscores in names of parameters in function
5375
declarations. Tweak names as needed.
5377
2014-08-20 Arnold D. Robbins <arnold@skeeve.com>
5379
* node.c (parse_escape): Max of 2 digits after \x.
5381
2014-08-18 Arnold D. Robbins <arnold@skeeve.com>
5383
* symbol.c: General formatting cleanup.
5385
2014-08-15 Arnold D. Robbins <arnold@skeeve.com>
5387
* main.c (usage): Adjust whitespace for -L and add "invalid"
5388
as a possible value for it. Report from Robert P. J. Day
5389
<rpjday@crashcourse.ca>.
5391
2014-08-14 Arnold D. Robbins <arnold@skeeve.com>
5393
* Makefile.am (SUBDIRS): Put awklib after doc so that examples
5394
get extracted when the doc changes.
5396
2014-08-13 Arnold D. Robbins <arnold@skeeve.com>
5398
* builtin.c (do_sub): Move initial allocation of the replacement
5399
string down towards code to do the replacement, with a (we hope)
5400
better guesstimate of how much to initially allocate. The idea
5401
is to avoid unnecessary realloc() calls by making a better guess
5402
at how much to allocate. This came up in an email discussion
5403
with Tom Dickey about mawk's gsub().
5405
2014-08-12 Juergen Kahrs <jkahrs@users.sourceforge.net>
5407
* cmake/configure.cmake:
5408
* cmake/package.cmake: Copyright update.
5410
* README_d/README.cmake: Moved file.
5412
2014-08-12 Arnold D. Robbins <arnold@skeeve.com>
5414
OFS being set should rebuild $0 using previous OFS if $0
5415
needs to be rebuilt. Thanks to Mike Brennan for pointing this out.
5417
* awk.h (rebuild_record): Declare.
5418
* eval.c (set_OFS): If not being called from var_init(), check
5419
if $0 needs rebuilding. If so, parse the record fully and rebuild it.
5420
Make OFS point to a separate copy of the new OFS for next time, since
5421
OFS_node->var_value->stptr was already updated at this point.
5422
* field.c (rebuild_record): Is now extern instead of static.
5423
Use OFS and OFSlen instead of the value of OFS_node.
5427
* Makefile.am (RM): Define for makes that don't have it,
5428
such as on OpenBSD. Thanks to Jeremie Courreges-Anglas
5429
<jca@wxcvbn.org> for the report.
5431
2014-08-05 Arnold D. Robbins <arnold@skeeve.com>
5433
Bug fix: For MPFR sqrt(), need to set precision of result to be
5434
the same as that of the argument. Doesn't hurt other functions.
5435
See test/mpfrsqrt.awk. Thank to Katie Wasserman <katie@wass.net>
5438
* mpfr.c (do_mpfr_func): New function. Runs code for MPFR functions
5439
while still enabling debugging. Add call here to mpfr_set_prec().
5440
Original code from SPEC_MATH macro.
5441
(SPEC_MATH): Change macro to call do_mpfr_func().
5443
Next MPFR bug fix: The % operator gave strange results for negative
5444
numerator. Thanks again to Katie Wasserman for the bug report.
5446
* mpfr.c (mpg_mod): Use mpz_tdiv_qr() instead of mpz_mod(). From
5447
the GMP doc, mpz_mod() should have worked; it's not clear why
5450
2014-08-03 Arnold D. Robbins <arnold@skeeve.com>
5452
* builtin.c (format_tree): Don't need to check return value of
5453
wctombr for -2. Thanks to Eli Zaretskii for pointing this out.
5457
* gawkapi.h: Fix doc for API get_record - errcode needs to
5458
be greater than zero.
5459
* interpret.h (r_interpret): Move setting of ERRNO to here, from ...
5460
* io.c (inrec): ... here. Makes the code cleaner.
5462
2014-08-03 Andrew J. Schorr <aschorr@telemetry-investments.com>
5464
* awkgram.y (getfname): Match on either ptr or ptr2 so --profile
5465
will work in -M (MPFR bignum) mode.
5467
2014-07-31 Arnold D. Robbins <arnold@skeeve.com>
5469
* builtin.c (format_tree): Make %c handling more sane on Windows.
5470
Rework the lint messages.
5474
* dfa.c: Sync with GNU grep. Mainly white space differences.
5478
* mpfr.c (cleanup_mpfr): New function to deallocate _mpf_t1
5479
and _mpf_t2; removes some valgrind warnings.
5480
* awk.h (cleanup_mpfr): Add declaration.
5481
* main.c (main): Add call to `cleanup_mpfr'.
5485
* mpfr.c (do_mpfr_div): Add unref to denominator and numerator
5486
to not leak memory. Thanks to Katie Wasserman <katie@wass.net>
5487
for isolating the problem to that routine.
5489
2014-07-25 Arnold D. Robbins <arnold@skeeve.com>
5491
* main.c (main): Add a warning message if -M is used and gawk was
5492
compiled without MPFR/GMP.
5494
2014-07-24 Arnold D. Robbins <arnold@skeeve.com>
5496
* main.c (usage): Put text for `-n' *after* text for `-m'.
5497
Report from Robert P. J. Day <rpjday@crashcourse.ca>.
5499
Fix problems with I/O errors reported by Assaf Gordon
5500
<assafgordon@gmail.com>:
5502
* io.c (inrec): Change type to bool to make calling easier. Add
5503
check in non-EOF case for error, and if so, return false.
5504
Update ERRNO in case there is an ENDFILE block.
5505
* awk.h (inrec): Change type in declaration.
5506
* interpret.h (r_interpret): Change call of inrec() to boolean
5509
2014-07-10 Arnold D. Robbins <arnold@skeeve.com>
5511
New `div()' function to do integer division and remainder;
5512
mainly useful for use with GMP integers. Thanks to
5513
Katie Wasserman <katie@wass.net> for the suggestion.
5515
* awk.h (do_div, do_mpfr_div): Declare new functions.
5516
* builtin.c (do_div): New function.
5517
* mpfr.c (do_mpfr_div): New function.
5518
* awkgram.y (tokentab): New entry.
5519
(snode): Add check for do_div/do_mpfr_div to make 3rd arg
5524
2014-07-10 Arnold D. Robbins <arnold@skeeve.com>
5526
* awkgram.y (check_for_bad): New routine to do the fatal message,
5527
with smarter checking.
5528
(nextc): Call it as appropriate.
5530
* builtin.c (format_tree): Add check for bad returns from mbrlen
5531
to avoid trying to malloc (size_t) -1 bytes. Thanks to
5532
mail.green.fox@gmail.com for the bug report.
5534
2014-07-03 Arnold D. Robbins <arnold@skeeve.com>
5536
* awkgram.y (nextc): Add bool check_for_bad parameter to check
5537
for bad characters in the source program.
5538
(yylex): Adjust calls.
5540
2014-06-24 Arnold D. Robbins <arnold@skeeve.com>
5542
* main.c (main): The --pretty-print option no longer runs the
5543
program. This removes the need for the GAWK_NO_PP_RUN environment var.
5547
2014-06-22 Paul Eggert <eggert@penguin.cs.ucla.edu>
5549
Bring in from GNULIB:
5551
regex: fix memory leak in compiler
5552
Fix by Andreas Schwab in:
5553
https://sourceware.org/ml/libc-alpha/2014-06/msg00462.html
5554
* lib/regcomp.c (parse_expression): Deallocate partially
5555
constructed tree before returning error.
5557
2014-06-19 Arnold D. Robbins <arnold@skeeve.com>
5559
* builtin.c (do_sub): Add more info to leading comment.
5560
Add some whitespace in the code.
5562
2014-06-08 Arnold D. Robbins <arnold@skeeve.com>
5564
* dfa.c: Sync with GNU grep.
5566
2014-06-03 Arnold D. Robbins <arnold@skeeve.com>
5568
* dfa.c (mbs_to_wchar): Define a macro if not MBS.
5570
2014-05-29 Arnold D. Robbins <arnold@skeeve.com>
5572
* dfa.c: Sync with GNU grep.
5574
2014-05-26 Arnold D. Robbins <arnold@skeeve.com>
5576
* io.c (inetfile): Change return type to bool. Wrap code
5577
with ifdef HAVE_SOCKETS so that it'll compile on DJGPP.
5579
2014-05-22 Andrew J. Schorr <aschorr@telemetry-investments.com>
5581
Allow any redirected getline inside BEGINFILE/ENDFILE.
5583
* awkgram.y (LEX_GETLINE): Only require a redirection and not also
5584
a variable if getline is in a BEGINFILE or ENDFILE rule.
5585
* interpret.h (Op_K_getline_redir): Remove check and fatal error.
5587
2014-05-20 Arnold D. Robbins <arnold@skeeve.com>
5589
* dfa.c (dfaexec): Minor sync with GNU grep.
5591
2014-05-14 Arnold D. Robbins <arnold@skeeve.com>
5593
* custom.h (_GL_PURE): Move definition to here. Sigh.
5594
* dfa.h, dfa.c: Sync with GNU grep. Sigh.
5598
* custom.h: Remove stuff for Ultrix 4.3. No one has such
5599
systems anymore; this just got missed earlier.
5601
2014-05-11 Arnold D. Robbins <arnold@skeeve.com>
5603
* debug.c (do_eval): Repair fix of 2014-05-09 and use
5604
assoc_remove to take @eval out of the function table.
5605
* symbol.c: Fix a comment. This file needs some work.
5607
2014-05-10 Arnold D. Robbins <arnold@skeeve.com>
5609
* io.c (get_a_record): Finish TERMNEAREND handling in case
5610
we don't have a regular file but aren't going to get more data.
5611
Added some additional comments.
5613
2014-05-09 Arnold D. Robbins <arnold@skeeve.com>
5615
* debug.c (do_eval): Don't free `f' which points into the context
5616
that was previously freed. Bug reported by Jan Chaloupka
5617
<jchaloup@redhat.com>. Apparently introduced with move to
5618
SYMTAB and FUNCTAB, but only showed up on Fedora 20 and Ubuntu 14.04,
5619
which have a newer glibc.
5620
(do_eval): Fix a memory leak seen by valgrind on Fedora 20 and
5621
Ubuntu 14.04: the new SRCFILE that is added wasn't released.
5625
* io.c (get_a_record): Handle return of TERMNEAREND when the
5626
entire file has been read into the buffer and we're using a
5627
regex for RS. Bug report by Grail Dane <grail69@hotmail.com>.
5629
2014-05-04 Arnold D. Robbins <arnold@skeeve.com>
5631
* debug.c (debug_prog): Change check for GAWK_RESTART so that it
5632
actually works. Bug fix: run command in debugger would start
5633
over again but not actually start running the program.
5635
2014-04-25 Andrew J. Schorr <aschorr@telemetry-investments.com>
5637
* io.c (two_way_open): In forked child, reset SIGPIPE to SIG_DFL.
5638
Fixes problems with "broken pipe" errors from child processes,
5639
restoring 4.1.0 and earlier behavior. Thanks to Daryl F
5640
<wyatt@prairieturtle.ca> for the report.
5641
(gawk_popen): Ditto.
5643
2014-04-25 Arnold D. Robbins <arnold@skeeve.com>
5645
* dfa.h, dfa.c: Merge with GNU grep; lots of forward motion.
5647
2014-04-24 Arnold D. Robbins <arnold@skeeve.com>
5649
Update xalloc.h for pending merge with dfa.
5651
* xalloc.h (xstrdup): Implement this.
5652
(x2nrealloc): Incorporate changed logic from GNULIB.
5654
2014-04-20 Andrew J. Schorr <aschorr@telemetry-investments.com>
5656
* io.c (struct inet_socket_info): Define new structure
5657
for use in parsing special socket filenames.
5658
(inetfile): Parse all components of the special socket filename
5659
into the struct inet_socket_info. Returns true only if it is a
5660
valid socket fliename, unlike the previous version which checked
5661
for the '/inet[46]?/' prefix only.
5662
(redirect): Patch to use updated inetfile() function.
5663
(devopen): Remove logic to parse socket filenames, since this has
5664
been moved into the inetfile() function.
5665
(two_way_open): Update args to inetfile().
5667
2014-04-20 Arnold D. Robbins <arnold@skeeve.com>
5669
* builtin.c (do_rand): Make calls to random() in predictable
5670
order to avoid order of evaluation differences amongst compilers.
5671
Thanks to Anders Magnusson <ragge@ludd.ltu.se> (of the PCC team)
5674
2014-04-18 Arnold D. Robbins <arnold@skeeve.com>
5676
* configure.ac: Change adding of -export-dynamic for GCC to be
5677
-Wl,-export-dynamic, which then works for PCC also.
5679
2014-04-11 Arnold D. Robbins <arnold@skeeve.com>
5681
* io.c (closemaybesocket): Define if not defined, e.g. building
5682
without socket code. Thanks to dave.gma@googlemail.com (Dave Sines)
5685
2014-04-08 Arnold D. Robbins <arnold@skeeve.com>
5687
* 4.1.1: Release tar ball made.
5689
2014-04-08 Arnold D. Robbins <arnold@skeeve.com>
5692
* configure.ac: Bump version.
5694
2014-04-03 Arnold D. Robbins <arnold@skeeve.com>
5696
* regcomp.c (parse_bracket_exp): Move a call to `re_free' inside
5697
an ifdef. Makes the code marginally cleaner.
5699
2014-03-30 Arnold D. Robbins <arnold@skeeve.com>
5701
* dfa.c: Sync with GNU grep.
5703
2014-03-28 Arnold D. Robbins <arnold@skeeve.com>
5705
* configure.ac: Remove duplicate AC_HEADER_TIME and rearrange
5706
order of macros some. May help on older systems.
5708
2014-03-23 Arnold D. Robbins <arnold@skeeve.com>
5710
* dfa.c: Move include of dfa.h around for correct building
5711
on Irix. Thanks to Nelson H.F. Beebe for the report.
5715
* .gitignore: Simplify .dSYM pattern for Mac OS X.
5717
2014-03-21 Arnold D. Robbins <arnold@skeeve.com>
5719
* dfa.c (using_simple_locale): Add ifdefs in case there is no
5720
locale support at all. Thanks to Scott Deifik for the report.
5724
* main.c (UPDATE_YEAR): Set to 2014.
5726
2014-03-17 Arnold D. Robbins <arnold@skeeve.com>
5728
* .gitignore: Add .dSYM directories for Mac OS X.
5729
Thanks to Hermann Peifer for the suggestion.
5731
2014-03-10 Arnold D. Robbins <arnold@skeeve.com>
5733
* dfa.h, dfa.c: Sync with grep. Yet again.
5734
* regex_internal.c (built_wcs_upper_buffer, build_upper_buffer):
5735
Fixes from GNULIB for mixed case matching on Mac OS X.
5739
* builtin.c (format_tree): Smarten handling of %' flag. Always
5740
pass it in for floating point formats. Then only add the
5741
thousands_sep if there is one. Also, allow for thousands_sep
5742
to be a string, not just one character. Thanks to Michal Jaegermann
5745
2014-03-08 Andrew J. Schorr <aschorr@telemetry-investments.com>
5747
* gawkapi.c (api_impl): Add memory allocation function pointers.
5748
* gawkapi.h (GAWK_API_MINOR_VERSION): Bump.
5749
(gawk_api_t): Add memory allocation function pointers api_malloc,
5750
api_calloc, api_realloc, and api_free.
5751
(gawk_malloc, gawk_calloc, gawk_realloc, gawk_free): New macros.
5752
(emalloc): Replace malloc with gawk_malloc.
5753
(erealloc): Replace erealloc with gawk_erealloc.
5755
2014-03-05 Arnold D. Robbins <arnold@skeeve.com>
5757
Straighten out enumerated types some more.
5759
* awk.h (add_srcfile): Fix type of first parameter.
5760
* awkgram.y (add_srcfile, do_add_srcfile): Ditto.
5761
* cmd.h (A_NONE): New enum nametypeval.
5762
* command.y (argtab): Use it in final value.
5763
* ext.c (make_builtin): Use awk_false, awk_true.
5764
* io.c (init_output_wrapper): Use awk_false.
5768
* debug.c (do_commands): Initialize num to silence warnings.
5769
Thanks to Michal Jaegermann.
5773
* builtin.c (do_mktime): Change lint warning for minutes to
5774
check against 59, not 60. Thanks to Hermann Peifer for the report.
5776
2014-03-03 Arnold D. Robbins <arnold@skeeve.com>
5778
* dfa.c: Sync with grep. Yet again.
5780
2014-02-28 Arnold D. Robbins <arnold@skeeve.com>
5782
* dfa.c: Sync with grep. Looks like good improvement with
5783
respect to bracket expressions.
5785
2014-02-27 Arnold D. Robbins <arnold@skeeve.com>
5787
Fixes for enum/int mismatches as warned by some compilers.
5789
* awk.h (ANONE): New enum for array sorting.
5790
* array.c (assoc_list): Use it.
5791
* builtin.c (format_tree): New MP_NONE value.
5792
* gawkapi.c: Use awk_false and awk_true everywhere instead of
5795
2014-02-26 Arnold D. Robbins <arnold@skeeve.com>
5797
* configure.ac: Set up do-nothing extension/Makefile on
5800
2014-02-21 Arnold D. Robbins <arnold@skeeve.com>
5802
* dfa.h, dfa.c (parse_bracket_exp): Sync with grep.
5804
2014-02-20 Arnold D. Robbins <arnold@skeeve.com>
5806
* regex.h, regex.c, regex_internal.c, regex_internal.h: Sync
5807
with GLIBC. Mainly copyright updates.
5808
* getopt.c, getopt.h, getopt1.c, getopt_int.h: Ditto.
5809
* dfa.c (parse_bracket_exp): Sync with grep, where they restored
5810
the buggy code. Sigh.
5815
* interpret.h (r_interpret): Init a variable for BEGINFILE to avoid
5816
compiler warnings. Thanks to Michal Jaegermann.
5818
2014-02-15 Arnold D. Robbins <arnold@skeeve.com>
5820
* awkgram.c, command.c: Regenerated - Bison 3.0.2.
5822
2014-02-04 Arnold D. Robbins <arnold@skeeve.com>
5824
* dfa.c (to_uchar): Make use of this. Syncs with GNU grep.
5826
2014-02-03 Arnold D. Robbins <arnold@skeeve.com>
5828
* awkgram.y (negate_num): Bracket `tval' in #ifdef MPFR since it's
5829
only used in that code.
5831
2014-01-31 Arnold D. Robbins <arnold@skeeve.com>
5833
* Makefile.am (dist-hook): Improve creation of pc/config.h. We
5834
have to jump through a lot of hoops for 'make distcheck' to
5837
2014-01-30 Arnold D. Robbins <arnold@skeeve.com>
5839
* Makefile.am (dist-hook): Improve creation of pc/config.h to copy
5840
the new file into the distribution directory being created.
5841
Also, put the temporary files into /tmp.
5843
2014-01-28 Arnold D. Robbins <arnold@skeeve.com>
5845
* awkgram.y (negate_num): If just a double, return. Fixes a bug
5846
that showed up on 32-bit systems with MPFR. Thanks to Eli Zaretskii
5847
and Corinna Vinschen for the report. Also, free the MPZ integer.
5848
Thanks to valgrind for the report.
5852
* dfa.c: Sync with GNU grep - removed some special cased code
5855
2014-01-24 Arnold D. Robbins <arnold@skeeve.com>
5857
* configure.ac, field.c: Update copyright year.
5859
2014-01-19 Arnold D. Robbins <arnold@skeeve.com>
5861
* awkgram.y (negate_num): Handle the case of -0 for MPFR; the sign
5862
was getting lost. Thanks to Hermann Peifer for the report.
5864
2014-01-18 Arnold D. Robbins <arnold@skeeve.com>
5866
* dfa.c (parse_bracket_exp): Sync with GNU grep, which now uses
5867
gawk's code for RRI in single-byte locales! Hurray.
5869
2014-01-16 Arnold D. Robbins <arnold@skeeve.com>
5871
* configure.ac: For z/OS, restore creation of do-nothing
5872
Makefile in extension directory.
5874
2014-01-14 Arnold D. Robbins <arnold@skeeve.com>
5876
* field.c (do_split): Make sure split() gets FS value if no
5877
third arg even after FPAT was set. Thanks to Janis Papanagnou
5880
2014-01-13 Arnold D. Robbins <arnold@skeeve.com>
5882
* README: Fix John Malmberg's email address.
5884
2014-01-12 Arnold D. Robbins <arnold@skeeve.com>
5886
* awkgram.y: Update copyright year.
5887
(func_use): Simplify code.
5888
* command.y: Update copyright year.
5889
* ext.c: Update copyright year.
5890
(make_builtin): Small simplification.
5891
(make_old_builtin): Make code consistent with make_builtin(), add
5892
call to track_ext_func().
5893
* bootstrap.sh: Update copyright year. Remove touch of version.c
5894
since that file is no longer autogenerated.
5896
2014-01-07 Arnold D. Robbins <arnold@skeeve.com>
5898
* command.y (next_word): Move into ifdef for HAVE_LIBREADLINE,
5899
since it's only used by that code.
5900
* ext.c (load_old_ext): Minor improvements.
5902
2014-01-03 Arnold D. Robbins <arnold@skeeve.com>
5904
* config.guess, config.rpath, config.sub, depcomp,
5905
install-sh: Updated.
5906
* dfa.h, dfa.c: Sync with GNU grep; comment fix and copyright year.
5907
* NEWS: Updated some, including copyright year.
5909
2013-12-26 Arnold D. Robbins <arnold@skeeve.com>
5911
* README: Add John Malmberg for VMS.
5913
2013-12-24 Arnold D. Robbins <arnold@skeeve.com>
5915
* getopt.h: Add `defined(__sun)' to list of system that do get to
5916
include stdlib.h. Needed for Illumos. Thanks to
5917
Richard Palo <richard.palo@free.fr> for the report.
5919
2013-12-21 Mike Frysinger <vapier@gentoo.org>
5921
* configure.ac: Add --disable-extensions flag to control
5922
compiling extensions. Better for cross-compiling.
5923
(AC_CANONICAL_HOST): Added. Changed case statements appropriately.
5924
* Makefile.am (check-for-shared-lib-support): Removed.
5925
(check-recursive, all-recursive): Removed.
5927
2013-12-21 Arnold D. Robbins <arnold@skeeve.com>
5929
* config.guess: Updated.
5930
* configure, aclocal.m4: Updated based on automake 1.13.4.
5932
2013-12-19 Arnold D. Robbins <arnold@skeeve.com>
5934
* regexec.c (re_search_internal): Make sure `dfa' pointer is
5935
not NULL before trying to dereference it.
5937
2013-12-16 Arnold D. Robbins <arnold@skeeve.com>
5939
* configure.ac (AC_FUNC_VPRINTF): Remove. Not needed on current
5941
* awk.h (HAVE_VPRINTF): Remove check.
5943
2013-12-12 John E. Malmberg <wb8tyw@qsl.net>
5945
* io.c (redirect): Add additional VMS error codes.
5946
(nextfile): Retry open after closing some files.
5948
2013-12-10 Scott Deifik <scottd.mail@sbcglobal.net>
5950
* io.c (closemaybesocket): Add definition for DJGPP.
5952
2013-12-10 Arnold D. Robbins <arnold@skeeve.com>
5954
* awk.h (Floor, Ceil): Remove declarations and VMS redefinitions.
5955
* floatcomp.c (Floor, Ceil): Removed, not needed. Move bracketing
5956
ifdef to the top of the file.
5957
* builtin.c (double_to_int): Use floor() and ceil().
5959
2013-12-07 Arnold D. Robbins <arnold@skeeve.com>
5961
* regex_internal.h (__attribute__): Define to empty if not GCC.
5962
* custom.h (__attribute__): Remove the definition from here; the
5963
right place was regex_internal.h.
5965
2013-12-06 Arnold D. Robbins <arnold@skeeve.com>
5967
No need to generate version.c from version.in.
5968
Thanks to John E. Malmberg <wb8tyw@qsl.net> for the suggestion.
5970
* version.in: Removed.
5971
* version.c: Use PACKAGE_STRING directly.
5972
* Makefile.am (EXTRA_DIST): Remove version.in.
5973
(distcleancheck_listfiles): Remove this rule.
5974
(MAINTAINERCLEANFILES): Remove this definition.
5975
(version.c): Remove the rule to create it.
5977
2013-12-05 Arnold D. Robbins <arnold@skeeve.com>
5981
* custom.h (__attribute__): Define to empty.
5982
* dfa.c (parse_bracket_exp): Add a cast to quiet a warning.
5983
* regex.c: Correctly bracket include of <sys/param.h>.
5987
* debug.c (find_rule): Add a FIXME comment.
5989
2013-12-03 John E. Malmberg <wb8tyw@qsl.net>
5991
* io.c (redirect): Add additional VMS error code to check.
5992
(do_find_source): Append "/" if not a VMS filename.
5994
2013-12-01 Andrew J. Schorr <aschorr@telemetry-investments.com>
5996
* main.c (optab): Sort by long option name.
5998
2013-11-27 Andrew J. Schorr <aschorr@telemetry-investments.com>
6000
* main.c (optab): Add entry for --include.
6002
2013-11-23 Arnold D. Robbins <arnold@skeeve.com>
6004
* dfa.c: Merge from grep; minor fixes in how bit twiddling
6007
2013-11-01 Arnold D. Robbins <arnold@skeeve.com>
6009
* dfa.c (lex): Reset laststart so that stuff like \s* works.
6012
2013-10-31 Arnold D. Robbins <arnold@skeeve.com>
6014
* builtin.c (efwrite): If write error to stdout is EPIPE,
6015
die silently. Thanks to Hermann Peifer for helping find this.
6017
2013-10-22 Arnold D. Robbins <arnold@skeeve.com>
6019
Revise error messages when writing to standard output or standard
6020
error to ignore EPIPE. Add the ability based on an environment
6021
variable to get the source file and line number.
6023
* awk.h (r_warning): Renamed from warning.
6024
(warning): New macro to set location and call warning.
6025
* io.c (flush_io): Print errors only if not EPIPE.
6027
* main.c (lintfunc): Init to r_warning.
6028
(main): Enhance explanatory comment.
6029
(usage): Print errors only if not EPIPE.
6031
* msg.c (err): Make printing srcfile and srcline depend upon
6032
GAWK_MSG_SRC environment variable.
6033
(r_warning): Renamed from warning.
6035
2013-10-17 Arnold D. Robbins <arnold@skeeve.com>
6037
* main.c (main): Ignore SIGPIPE. See the comment in the code.
6038
Thanks to Alan Broder for reporting the issue.
6042
* rand.c (do_rand): Fix computation and loop checking against
6043
1.0 to use do..while.
6045
2013-10-16 Arnold D. Robbins <arnold@skeeve.com>
6047
Make -O work again. Turns out that C99 bool variables
6048
are clamped to zero or one.
6050
* main.c (do_optimize): Init to false.
6051
(main): Set do_optimize to true on -O.
6052
* eval.c (setup_frame): Change all uses of do_optimize to be
6053
a boolean check instead of a test > 1.
6055
(optimize_assignment): Remove check against do_optimize since
6056
it was inited to true anyway.
6060
* re.c (resetup): Add a comment about the joy of syntax bits.
6064
* builtin.c (do_rand): If result is exactly 1.0, keep trying.
6065
Thanks to Nelson Beebe.
6067
2013-10-10 Arnold D. Robbins <arnold@skeeve.com>
6069
* dfa.c (lex): Sync with GNU grep. Handle multibyte \s and \S.
6073
* awk.h [ARRAY_MAXED]: Fix value of this and subsequent flags
6074
after addition of NULL_FIELD.
6075
* eval.c (flags2str): Add NULL_FIELD. Duh.
6077
2013-10-09 Arnold D. Robbins <arnold@skeeve.com>
6079
* awkgram.y (mk_assignment): Rework switch to handle Op_assign,
6080
and to provide a better error message upon unknown opcode.
6082
2013-09-28 Arnold D. Robbins <arnold@skeeve.com>
6084
* dfa.c: Sync with GNU grep.
6086
2013-09-25 Arnold D. Robbins <arnold@skeeve.com>
6088
* builtin.c (do_rand): Make the result more random by calling
6089
random() twice. See the comment in the code. Thanks to
6090
Bob Jewett <jewett@bill.scs.agilent.com> for the report and
6093
2013-09-24 Arnold D. Robbins <arnold@skeeve.com>
6095
* debug.c (find_rule): Handle case where lineno is zero. Can happen
6096
if break is given without a line number on a current line. Thanks
6097
to Ray Song <i@maskray.me> for the report.
6099
2013-09-19 Arnold D. Robbins <arnold@skeeve.com>
6101
* dfa.c (parse_bracket_exp): Use code from grep to keep things within
6102
range (updates change of 2013-09-08). Fix whitespace in one of the
6103
gawk-only additions.
6105
2013-09-13 Arnold D. Robbins <arnold@skeeve.com>
6107
Fix use of NF after it's extended, e.g. see test/nfloop.awk.
6109
* awk.h (NULL_FIELD): New flag
6110
* builtin.c (do_print_rec): Check f0->flags instead of if
6111
equal to Nnull_string.
6112
* eval.c (r_get_field): Check (*lhs)->flags instead of if
6113
equal to Nnull_string or Null_field.
6114
* field.c (init_fields): Init field zero and Null_field with
6116
(set_NF): Set parse_high_water = NF in case NF extended past the
6117
end. This is the actual bug fix.
6119
2013-09-08 Arnold D. Robbins <arnold@skeeve.com>
6121
Fixes based on reports from a static code checker. Thanks to
6122
Anders Wallin for sending in the list.
6124
* array.c (asort_actual): Free list if it's not NULL.
6125
* builtin.c (do_sub): Set buf to NULL and assert on it before using
6127
* cint_array.c (cint_array_init): Clamp any value of NHAT from the
6128
environment such that it won't overflow power_two_table when used as
6130
* dfa.c (parse_bracket_exp): Check that len is in range before using it
6132
* getopt.c (_getopt_internal_r): Change call to alloca to use malloc.
6133
* io.c (socket_open): Init read_len to zero.
6134
(two_way_open): Upon failure to fork, close the slave fd also.
6135
* re.c (research): Init try_backref to false.
6136
* regcomp.c (build_range_exp): Free any items that were allocated in
6137
the case where not all items were.
6138
(build_charclass_op): Same. Init br_token to zero with memset.
6139
(create_tree): Init token t to zero with memset.
6140
* regex_internal.c (re_dfa_add_node): Free any items that were
6141
allocated in the case where not all items were.
6142
* symbol.c (destroy_symbol): On default, break, to fall into releasing
6145
2013-08-29 Arnold D. Robbins <arnold@skeeve.com>
6147
* debug.c (HAVE_HISTORY_LIST): Move checks and defines to the top.
6148
(do_save, serialize): Adjust #if checks to depend on having both
6149
readline and the history functions. Needed for Mac OS X whose
6150
native readline is a very old version. Sigh.
6151
* configh.in, configure: Regenerated due to change in m4/readline.m4.
6152
Issue reported by Hermann Peifer and Larry Baker.
6156
* getopt.c: Sync with GLIBC, changes are minor.
6160
* dfa.c: Sync with version in grep. Primarily whitespace / comment
6163
2013-08-26 Arnold D. Robbins <arnold@skeeve.com>
6165
* regcomp.c (parse_dup_op): Remove RE_TOKEN_INIT_BUG code (change of
6166
Feb 19 2005) since it's no longer needed.
6168
* regcomp.c (re_fastmap_iter): Undo addition of volatile from
6169
Jan 18 2007; no longer needed and is one less change to have to
6170
maintain against the upstream.
6172
* regcomp.c, regex.h, regex_internal.h: Sync with GLIBC.
6174
2013-08-22 Arnold D. Robbins <arnold@skeeve.com>
6176
* str_array.c (env_store): If the new value being stored is NULL,
6177
pass in "" instead. Avoids core dump on Mac OS X.
6178
Thanks to Hermann Peifer for the bug report.
6180
2013-08-20 Arnold D. Robbins <arnold@skeeve.com>
6182
* nonposix.h: New file. Contains FAKE_FD_VALUE.
6183
* awk.h: Include it if MinGW or EMX.
6184
* Makefile.am (base_sources): Add nonposix.h.
6186
2013-08-18 Arnold D. Robbins <arnold@skeeve.com>
6188
Reflect updates to ENVIRON into the real environment.
6190
* awk.h (init_env_array): Add declaration.
6191
* main.c (load_environ): Call init_env_array.
6192
* str_array.c (env_remove, env_store, env_clear, init_env_array):
6194
(env_array_func): New array vtable.
6196
2013-08-18 Arnold D. Robbins <arnold@skeeve.com>
6198
* array.c (force_array): Set symbol->xarray to NULL before
6199
initing the array if it was Node_var_new.
6200
(null_array): Restore assert, undoing change of 2013-05-27.
6202
2013-08-15 Arnold D. Robbins <arnold@skeeve.com>
6204
* debug.c (print_memory): Fix whitespace / indentation.
6206
2013-08-02 Arnold D. Robbins <arnold@skeeve.com>
6208
* awkgram.y (append_rule): Add attempt to insert any comment
6209
before a rule. Commented out at the moment.
6211
2013-07-30 Arnold D. Robbins <arnold@skeeve.com>
6213
* awk.h (enum opcodeval): Add Op_comment.
6214
* awkgram.y (comment): New variable to hold comment text.
6215
(statement): Add saved comments to lists being built.
6216
(allow_newline): Save comment text if necessary. Append if have
6219
* debug.c (print_instruction): Handle Op_comment.
6220
* eval.c (optypes): Add entry for Op_comment.
6221
* interpret.h (r_interpret): Ditto.
6222
* profile.c (pprint): For Op_comment, print the comment text.
6224
2013-07-24 Arnold D. Robbins <arnold@skeeve.com>
6226
* io.c (FAKE_FD_VALUE): Move definition from here ...
6227
* awk.h (FAKE_FD_VALUE): ... to here. Fixes compilation on MinGW.
6229
2013-07-08 Arnold D. Robbins <arnold@skeeve.com>
6231
* io.c (get_a_record): Change `min' to `MIN' for consistency with
6232
other files and general practice.
6234
2013-07-07 Andrew J. Schorr <aschorr@telemetry-investments.com>
6236
* configure.ac (AC_CHECK_FUNCS): Check for sigprocmask.
6237
* io.c (wait_any): If sigprocmask is available, block signals instead
6238
of ignoring them temporarily.
6240
2013-07-05 Andrew J. Schorr <aschorr@telemetry-investments.com>
6242
* gawkapi.h (gawk_api): Document that the api_get_file function will not
6243
access the file type and length arguments if the file name is empty.
6245
2013-07-04 Andrew J. Schorr <aschorr@telemetry-investments.com>
6247
* configure.ac (AC_CHECK_FUNCS): Add a check for waitpid.
6248
* io.c (wait_any): Enhance comment to explain why we loop reaping all
6249
exited children when the argument is zero. When available, use waitpid
6250
with WNOHANG to avoid blocking. Remove my previous incorrect patch to
6251
exit after reaping the first child. The function is intended to
6252
wait for all children, since we are not careful about reaping children
6253
as soon as they die.
6255
2013-07-02 Andrew J. Schorr <aschorr@telemetry-investments.com>
6257
* gawkapi.h (gawk_api): Remove unused api_lookup_file hook.
6258
(lookup_file): Remove associated macro.
6259
* gawkapi.c (api_lookup_file): Remove unused function.
6260
(api_impl): Remove unused api_lookup_file hook.
6262
2013-07-02 Andrew J. Schorr <aschorr@telemetry-investments.com>
6264
* awkgram.y (main_beginfile): Declare new global INSTRUCTION *.
6265
(parse_program): Set main_beginfile to point to the BEGINFILE
6267
* gawkapi.c (api_get_file): After nextfile starts a new file,
6268
we need to run the BEGINFILE actions. We retrieve the
6269
instruction pointer from main_beginfile and execute it until
6270
we reach the Op_after_beginfile opcode. We then run after_beginfile
6271
manually and restore the value of currule and source.
6273
2013-07-04 Andrew J. Schorr <aschorr@telemetry-investments.com>
6275
* gawkapi.h (awk_element_t): Add comment indicating that the array
6276
element index will always be a string!
6277
* gawkapi.c (api_flatten_array): When converting the index to an awk
6278
value, request a string conversion, since we want the indices to
6279
appear as strings to the extensions. This makes the call to
6280
force_string redundant, since node_to_awk_value does that internally
6281
when we request a string.
6283
2013-07-02 Andrew J. Schorr <aschorr@telemetry-investments.com>
6285
* eval.c (update_ERRNO_string): Set PROCINFO["errno"] to 0.
6286
* io.c (inrec): Since get_a_record may now return -2, be sure
6287
to throw an error in that case as well.
6288
(wait_any): Fix what appears to be a bug. The old logic repeatedly
6289
called wait until it failed. When a process has multiple children,
6290
this causes it to stall until all of them have exited. Instead,
6291
we now exit the function after the first successful wait call.
6292
(do_getline_redir, do_getline): Handle case where get_a_record
6294
(errno_io_retry): New function to decide whether an I/O operation should
6296
(get_a_record): When read returns an error, call errno_io_retry to
6297
decide whether the operation should be retried. If so, return -2
6298
instead of setting the IOP_AT_EOF flag.
6300
2013-07-01 Andrew J. Schorr <aschorr@telemetry-investments.com>
6302
* eval.c (update_ERRNO_int, unset_ERRNO): Update PROCINFO["errno"].
6304
2013-06-30 Andrew J. Schorr <aschorr@telemetry-investments.com>
6306
* awk.h (redirect_string): Declare new function that provides API access
6307
to the redirection mechanism.
6308
* gawkapi.h (GAWK_API_MINOR_VERSION): Bump from 0 to 1 since 2 new
6309
hooks were added to the api.
6310
(gawk_api_t): Add 2 new functions api_lookup_file and api_get_file.
6311
(lookup_file, get_file): New macros to wrap the new API functions.
6312
* gawkapi.c (curfile): Declare this extern, since it is needed
6313
by lookup_file and get_flie.
6314
(api_lookup_file): Find an open file using curfile or getredirect().
6315
(api_get_file): Find or open a file using curfile or redirect_string().
6316
(api_impl): Add api_lookup_file and api_get_file.
6317
* io.c (redirect_string): Renamed from redirect and changed arguments
6318
to take a string instead of a 'NODE *'. This allows it to be called
6319
through the API's new get_file hook.
6320
(redirect): Now implemented by calling redirect_string backend function.
6322
2013-07-04 Arnold D. Robbins <arnold@skeeve.com>
6324
* builtin.c (format_tree): Fixes for %c with multibyte characters
6325
and field width > 1. Bugs reported by Nethox <nethox@gmail.com>.
6327
2013-07-02 Arnold D. Robbins <arnold@skeeve.com>
6329
* profile.c (pp_string): Add a call to chksize and fix another.
6330
Avoids valgrind errors on profile5 test. Thanks to Andrew
6331
Schorr for the report.
6333
2013-06-27 Arnold D. Robbins <arnold@skeeve.com>
6335
* awkgram.y: Minor whitespace cleanup, remove redundant ifdef.
6337
2013-06-24 Arnold D. Robbins <arnold@skeeve.com>
6339
* dfa.c (copytoks): Rewrite to call addtok_mb() directly. Avoids
6340
problems with multibyte characters inside character sets.
6341
Thanks to Steven Daniels <stevendaniels88@gmail.com> for reporting
6342
the problem. Much thanks to Mike Haertel <mike@ducky.net> for the
6345
2013-06-24 Eli Zaretskii <eliz@gnu.org>
6347
* io.c: Move #include "popen.h" out of the HAVE_SOCKETS condition,
6348
as this is needed for non-sockets builds as well. See
6349
http://lists.gnu.org/archive/html/bug-gawk/2013-06/msg00014.html
6350
for the details of the problem this caused.
6352
2013-06-15 Arnold D. Robbins <arnold@skeeve.com>
6354
* io.c: Add ifdefs for VMS so that it will compile again.
6355
Thanks to Anders Wallin.
6357
2013-06-11 Arnold D. Robbins <arnold@skeeve.com>
6359
* debug.c (print_lines): Move setting of binary mode to after all
6360
the messing with the fd. Simplifies code some.
6361
* io.c (srcopen): Rearrange so that can add call to setbinmode
6362
here too. This fixes the debugger and makes reading source
6363
files a little faster. Thanks again to Corinna Vinschen.
6365
2013-06-10 Arnold D. Robbins <arnold@skeeve.com>
6367
* debug.c (print_lines): Set binary mode so that calculation of the
6368
byte offsets will be right. Thanks to Corinna Vinschen for the
6371
2013-06-10 Arnold D. Robbins <arnold@skeeve.com>
6373
* re.c (check_bracket_exp): Remove warning about ranges being
6374
locale dependent, since they aren't anymore.
6376
2013-06-09 Arnold D. Robbins <arnold@skeeve.com>
6378
* io.c (iop_finish): Change fstat call to fcntl/F_GETFL per
6379
Eli Z., for Windows.
6381
2013-06-03 Arnold D. Robbins <arnold@skeeve.com>
6383
* eval.c (unwind_stack): If exiting, don't worry about strange stuff
6388
* awk.h (init_sockets): Declare.
6389
* io.c (init_io): Remove ifdef around call.
6391
2013-06-01 Eli Zaretskii <eliz@gnu.org>
6393
* io.c (SHUT_RD) [SD_RECEIVE]: Define to SD_RECEIVE.
6394
(SHUT_WR) [SD_SEND]: Define to SD_SEND.
6395
(SHUT_RDWR) [SD_BOTH]: Define to SD_BOTH.
6396
(FD_TO_SOCKET, closemaybesocket) [!FD_TO_SOCKET]: New macros.
6397
(SOCKET_TO_FD, SOCKET) [!SOCKET_TO_FD]: New macros.
6398
(PIPES_SIMULATED): Define only for DJGPP.
6399
(pipe) [__MINGW32__]: Define to call _pipe, unless PIPES_SIMULATED
6401
(init_io) [HAVE_SOCKETS]: Call init_sockets.
6402
(iop_close, socketopen): Call closemaybesocket instead of close.
6403
(redirect) [__MINGW32__]: Call wait_any with a non-zero argument.
6404
(devopen) [__EMX__ || __MINGW32__]: Don't call stat on network
6406
(two_way_open) [HAVE_SOCKETS]: Switch input and output to binary
6407
mode if appropriate.
6408
(two_way_open) [!PIPES_SIMULATED]: Use the __EMX__ code for MinGW
6410
[__MINGW32__] Call spawnl to invoke $ComSpec and pass it a
6411
suitably quoted command line.
6412
(two_way_open) [__MINGW32__]: Wait only for a specified process
6413
ID. If successful, update the exit status of the exited process.
6414
Don't use signals that are undefined on MinGW.
6415
(two_way_open) [!PIPES_SIMULATED]: Use the __EMX__ code for MinGW
6417
(min): Define only if not already defined.
6418
(read_with_timeout) [__MINGW32__]: Allow reading from sockets with
6420
(gawk_fclose) [__MINGW32__]: Close the underlying socket as well.
6422
* getopt.c: Include stdlib.h for MinGW as well.
6424
2013-05-30 Arnold D. Robbins <arnold@skeeve.com>
6426
More profiling fixes:
6428
* profile.c (pprint): For Op_in_array, parenthesize subscript if
6429
the precedence is lower. E.g.: (c = tolower(foo)) in ARRAY.
6430
(prec_level): Merge cases for precedence of 5.
6431
(parenthesize): Simplify, as in 3.1.8. Avoids stuff like
6432
`(x == 1 && (z ==2 && (q == 4 && w == 7)))'.
6436
* io.c (iop_finish): fstat the fd before closing it to avoid
6437
errors on some operating systems. Thanks to Eli Zaretskii
6440
2013-05-29 Arnold D. Robbins <arnold@skeeve.com>
6442
* profile.c (pp_group3): Renamed from pp_concat. Change all calls.
6443
(is_binary): Change return type to bool.
6444
(is_scalar): New function.
6445
(pp_concat): New function to handle concatenation operator better.
6446
(pprint): Call it at case Op_concat. Fix Op_K_delete if multiple
6447
indexes to separate with "][".
6448
General: Add leading comments as needed.
6450
2013-05-28 Arnold D. Robbins <arnold@skeeve.com>
6452
* main.c (main): Add minor hack to not run code if pretty printing
6453
and undocumented env var GAWK_NO_PP_RUN exists.
6454
* profile.c (pp_string): Explicitly print NUL chars as \000.
6456
2013-05-27 Arnold D. Robbins <arnold@skeeve.com>
6458
* configure.ac (AM_INIT_AUTOMAKE): Add dist-lzip to quiet
6459
outside maintainer warnings.
6463
* configure.ac (AC_STRUCT_ST_BLKSIZE): Replaced with call to
6468
* array.c (null_array): Remove the assert and just clear
6471
2013-05-26 Arnold D. Robbins <arnold@skeeve.com>
6473
* getopt.c: For Mac OS X, also include <stdlib.h> to avoid
6474
some compiler warnings.
6476
2013-05-20 Arnold D. Robbins <arnold@skeeve.com>
6478
* gawkapi.h [FAKE_FD_VALUE]: Moved from here to ...
6479
* io.c [FAKE_FD_VALUE]: here.
6481
2013-05-14 Eli Zaretskii <eliz@gnu.org>
6483
* io.c (devopen) [__EMX__ || __MINGW32__]: Produce EISDIR on MinGW
6484
when an attempt to open() a directory fails.
6485
(two_way_open) [__EMX__ || __MINGW32__]: When trying to open() a
6486
directory fails with EISDIR, assign FAKE_FD_VALUE to the file
6487
descriptor and attributes of a directory to its mode bits. This
6488
is needed to support the readdir extension.
6490
* gawkapi.h (FAKE_FD_VALUE): New macro, used in io.h and in
6491
extension/gawkdirfd.h.
6493
2013-05-09 Arnold D. Robbins <arnold@skeeve.com>
6495
* 4.1.0: Release tar ball made.
6497
2013-05-09 Arnold D. Robbins <arnold@skeeve.com>
6499
* awkgram.y (snode): Make it a fatal error to use a regexp constant
6500
as the second argument of index(). Thanks to Christopher Durant
6501
<christopher.durant@marquesa.net> and Brian Kernighan for the report
6504
2013-04-28 Eli Zaretskii <eliz@gnu.org>
6506
* io.c (redirect): Remove the HACK that called close_one when
6507
errno was zero in the MinGW build. This prevents failure in
6508
several tests in the test suite, e.g., closebad.
6510
2013-04-28 Arnold D. Robbins <arnold@skeeve.com>
6512
* bootstrap.sh: Fix a comment.
6514
2013-04-24 Arnold D. Robbins <arnold@skeeve.com>
6516
* io.c (do_getline_redir): Fix the leading comment.
6518
2013-04-23 Arnold D. Robbins <arnold@skeeve.com>
6520
* main.c (load_procinfo): Add PROCINFO entries for API major
6523
2013-04-21 Arnold D. Robbins <arnold@skeeve.com>
6525
* missing: Update from Automake 1.13.1.
6527
2013-04-18 Arnold D. Robbins <arnold@skeeve.com>
6529
* configure.ac: Fix a typo.
6531
2013-04-17 Corinna Vinschen <vinschen@redhat.com>
6533
* configure.ac: Remove special casing for cygwin for libiconv
6536
2013-04-16 Arnold D. Robbins <arnold@skeeve.com>
6538
* bootstrap.sh: Touch gawk.texi too. Update copyright.
6540
2013-04-16 Arnold D. Robbins <arnold@skeeve.com>
6542
* awkgram.c: Regenerated from bison 2.7.1.
6544
* dfa.h, dfa.c: Minor edits to sync with GNU grep.
6545
* gettext.h: Sync with gettext 0.18.2.1.
6546
* random.h: Remove obsolete __P macro and use. Update copyright year.
6547
* Makefile.am, array.c, builtin.c, cint_array.c, cmd.h, debug.c,
6548
eval.c, ext.c, field.c, gawkapi.c, gawkapi.h, gettext.h, int_array.c,
6549
interpret.h, msg.c, node.c, profile.c, re.c, replace.c, str_array.c,
6550
symbol.c: Update copyright year.
6552
Update to automake 1.13.1:
6554
* configure.ac (AM_INIT_AUTOMAKE): Update version.
6555
* configure, Makefile.in, aclocal.m4, awklib/Makefile.in,
6556
doc/Makefile.in, test/Makefile.in: Regenerated.
6558
* getopt.c, getopt.h, getopt1.c, getopt_int.h: Sync with GLIBC.
6560
2013-04-14 Arnold D. Robbins <arnold@skeeve.com>
6562
* awkgram.y (check_funcs): Fix logic of test for called but
6563
not defined warning. Thanks to Scott Deifik for the bug report.
6565
2013-04-02 Arnold D. Robbins <arnold@skeeve.com>
6567
* profile.c (print_lib_list): Send final newline to prof_fp
6568
instead of stdout. Thanks to Hermann Peifer for the bug report.
6570
2013-03-27 Arnold D. Robbins <arnold@skeeve.com>
6572
* Makefile.am (SUBDIRS): Move extension back into the middle of
6573
the list so that `make check' without a prior `make' works.
6577
* main.c (main): Move env_lc into ifdef for LIBC_IS_BORKED.
6579
2013-03-20 Arnold D. Robbins <arnold@skeeve.com>
6581
For systems where libc is borked (MirBSD, maybe others).
6583
* dfa.c: Force use of gawk_mb_cur_max instead of MB_CUR_MAX and make
6584
mbrtowc a macro that always fails.
6585
(using_utf8): Force utf8 to be 0 if libc borked and gawk_mb_cur_max
6587
* main.c (main): If libc is borked and LC_ALL or LANG exist in the
6588
environment and are set to "C" or "c", force gawk_mb_cur_max to one.
6590
2013-03-11 Arnold D. Robbins <arnold@skeeve.com>
6592
* re.c (check_bracket_exp): Make handling of embedded ] in
6593
regexp smarter. Thanks to Ed Morton <mortoneccc@comcast.net>
6594
for reporting the bug.
6596
2013-03-01 Arnold D. Robbins <arnold@skeeve.com>
6598
Don't build extensions if API isn't supported:
6600
* Makefile.am (SUBDIRS): Move extension directory to last in case
6601
building the extensions is not supported.
6602
* configure.ac: Add check for MirBSD and don't even try to run the
6603
checks for DYNAMIC if so.
6605
Check for systems (MirBSD) where libc doesn't understand not
6606
to use UTF-8 for LC_ALL=C.
6608
* configure.ac (LIBC_IS_BORKED): AC_DEFINE if needed.
6609
* regcomp.c (init_dfa): Change logic as needed if LIBC_IS_BORKED.
6611
2013-02-28 Arnold D. Robbins <arnold@skeeve.com>
6613
Cause profiling / pretty printing to include a list of
6614
loaded extensions. Thanks to Hermann Peifer for the bug report.
6616
* awk.h (srcfiles): Add declaration.
6617
* profile.c (print_lib_list): New function.
6618
(dump_prog): Call it.
6620
2013-02-26 Arnold D. Robbins <arnold@skeeve.com>
6622
* awkgram.y (expression_list): In case of error return the list
6623
instead of NULL so that snode gets something it can count.
6625
2013-02-12 Arnold D. Robbins <arnold@skeeve.com>
6627
* bisonfix.awk: Comment out code for fixing continued #if
6628
statements. It is likely not needed anymore. Leave it there in
6631
2013-02-06 Arnold D. Robbins <arnold@skeeve.com>
6633
* builtin.c (printf_common): Move nargs > 0 check into assert.
6634
(do_sprintf): Add nargs check and fatal message to here.
6636
2013-02-04 Arnold D. Robbins <arnold@skeeve.com>
6638
* main.c (main): Remove undocumented -m option which was for
6639
compatibility with BWK awk. His awk dropped it back in 2007.
6641
2013-02-03 Arnold D. Robbins <arnold@skeeve.com>
6643
* configure.ac: Add Automake test for cross compiling.
6645
2013-01-31 Arnold D. Robbins <arnold@skeeve.com>
6647
* regcomp.c, regex.c, regex_internal.c, regexec.c: Update
6648
copyright years to sync with GLIBC.
6650
From: http://www.sourceware.org/ml/libc-alpha/2013-01/msg00967.html,
6651
by Andreas Schwab <schwab@suse.de>:
6653
* regexec.c (extend_buffers): Add parameter min_len.
6654
(check_matching): Pass minimum needed length.
6655
(clean_state_log_if_needed): Likewise.
6656
(get_subexp): Likewise.`
6658
2013-01-31 Arnold D. Robbins <arnold@skeeve.com>
6660
* dfa.c: Include "dfa.h" which includes regex.h after limits.h
6661
so that RE_DUP_MAX gets the correct value. Especially needed on
6662
OpenVMS. Thanks to Anders Wallin.
6664
* main.c (version): Print out API version numbers if DYNAMIC.
6665
Helpful also for knowing if to run the shlib tests.
6667
* configure: Regenerated after change in m4/readline.m4.
6669
2013-01-31 Arnold D. Robbins <arnold@skeeve.com>
6671
* PROBLEMS: Removed. It is no longer needed.
6672
* Makefile.am (EXTRA_DIST): Remove PROBLEMS from list.
6674
2013-01-31 Andrew J. Schorr <aschorr@telemetry-investments.com>
6676
* configure.ac: Remove TEST_MPFR conditional added in last patch.
6677
We will instead test for MPFR capability by looking at the output
6678
from gawk --version.
6680
2013-01-27 Andrew J. Schorr <aschorr@telemetry-investments.com>
6682
* configure.ac: Add MPFR test for use in test/Makefile.am.
6684
2013-01-25 Arnold D. Robbins <arnold@skeeve.com>
6686
* awkgram.y (parms_shadow): Change int param to bool.
6687
* cmd.h (output_is_tty): Sync type with rest of code (is bool).
6688
* dfa.c (MALLOC): Undef first, for Irix.
6689
* Makefile.am (LDADD): Use LIBREADLINE and LIBMPFR instead of
6690
automake substitutions.
6691
* configure.ac (AC_INIT): Version bump.
6692
(GAWK_CHECK_READLINE): Renamed from GNUPG_CHECK_READLINE.
6694
2013-01-23 Arnold D. Robbins <arnold@skeeve.com>
6696
* awk.h (list_functions): Change parameter to bool.
6697
* symbol.c (list_functions): Ditto.
6698
(get_symbols): Change sort parameter to bool. Additional
6701
2013-01-22 Arnold D. Robbins <arnold@skeeve.com>
6703
* symbol.c (get_symbols): Reset count after each loop to only
6704
sort the actual items retrieved. Thanks to Hermann Peifer (by
6705
way of Andrew Schorr) for reporting the bug. Also add some
6706
commentary and fix function name in emalloc calls.
6708
2013-01-20 Arnold D. Robbins <arnold@skeeve.com>
6710
* re.c (regexflags2str): New routine.
6711
(resetup): If do_intervals, also turn on RE_NO_BK_BRACES.
6712
Thanks to Yan Lei <yanl.fnst@cn.fujitsu.com> for the
6715
2013-01-18 Arnold D. Robbins <arnold@skeeve.com>
6717
Fix a problem with include ordering to get ptrdiff_t definition,
6718
showed up on Debian Lenny. Reported by Manuel Collado.
6719
Fix brought over from grep.
6721
* dfa.h: Include regex.h and stddef.h directly.
6722
* dfa.c: Adjust includes.
6724
2013-01-11 John Haque <j.eh@mchsi.com>
6726
* awk.h (do_mpfr_rshift): Renamed from do_mpfr_rhift.
6727
* awkgram.y (do_mpfr_rshift): Renamed from do_mpfr_rhift.
6728
* mpfr.c (_tz1, _tz2, _mpz1, _mpz2, mpz1, mpz2, get_bit_ops,
6729
free_bit_ops): Removed.
6730
(init_mpfr): Remove calls to mpz_init.
6731
(get_intval, free_intval): New functions.
6732
(do_mpfr_rshift, do_mpfr_lshift): Rework code.
6733
(do_mpfr_and, do_mpfr_or, do_mpfr_xor): Accept two or more arguments
6734
to match regular functions.
6736
2013-01-11 Arnold D. Robbins <arnold@skeeve.com>
6738
* bisonfix.awk: Adjust ARGV / ARGC to force reading of standard
6739
input; apparently needed for Mac OS X. Thanks to Akim Demaille
6742
2013-01-06 Arnold D. Robbins <arnold@skeeve.com>
6744
* io.c (redirect, two_way_open): Set the name field in the
6745
awk_input_buf_t and awk_output_buf_t structures, as needed.
6746
Thanks to Manuel Collado for the report.
6748
2013-01-05 Arnold D. Robbins <arnold@skeeve.com>
6750
* regex_internal.h (struct re_dfa_t): Restore ifdefs around
6751
__libc_lock_define, they really were needed. Bleah.
6753
2013-01-01 Arnold D. Robbins <arnold@skeeve.com>
6755
Sync with GLIBC regex files.
6757
* regex_internal.h (struct re_dfa_t): Remove ifdefs around
6758
__libc_lock_define since it's already defined to empty in non-LIBC
6760
* regexec.c (check_node_accept_bytes): Restore decl with use from
6761
GLIBC code since this is LIBC case.
6763
2012-12-27 Arnold D. Robbins <arnold@skeeve.com>
6765
* builtin.c (do_print, do_printf): Use output_fp as default
6766
output for print/printf only if running under the debugger.
6767
Otherwise use stdout as Brian, Peter, and Al intended.
6769
2012-12-25 Arnold D. Robbins <arnold@skeeve.com>
6771
Remove sym-constant from API after discussions with John
6772
Haque and Andrew Schorr.
6774
* gawkapi.h (api_sym_constant): Removed field in API struct.
6775
(sym_constant): Remove macro.
6776
* gawkapi.c (set_constant, api_sym_update, api_sym_constant): Removed.
6777
(sym_update_real): Renamed to api_sym_update(). is_const parameter
6778
removed and code adjusted.
6780
2012-12-24 Arnold D. Robbins <arnold@skeeve.com>
6782
* 4.0.2: Release tar ball made.
6784
2012-12-23 John Haque <j.eh@mchsi.com>
6786
* eval.c (r_get_lhs): Node_array_ref. If original is Node_var,
6787
don't assign null-string as value.
6788
* ext.c (get_argument): Node_array_ref. Check if already a scalar.
6790
2011-12-23 John Haque <j.eh@mchsi.com>
6792
* awkgram.y (is_deferred_variable): New function.
6793
(func_install): Call it.
6794
* eval.c (r_interpret): Op_push_arg. Check for uninitialized scalar.
6796
2012-12-23 Arnold D. Robbins <arnold@skeeve.com>
6798
* awkgram.y (tokentab): Whitespace fix for "include".
6799
* builtin.c (printf_common): Do a fatal error if no args to printf()
6802
2012-12-19 Arnold D. Robbins <arnold@skeeve.com>
6804
* bootstrap.sh: Touch extension/aclocal.m4 also.
6806
Unrelated: Extend input parser API:
6808
* awk.h (IOBUF): Remove read_func pointer.
6809
* gawkapi.h (awk_input_buf_t): Move it to here.
6810
* io.c (iop_alloc, get_a_record, get_read_timeout): Adjust code.
6812
Unrelated: Make sure that variables like NF, NR, FNR are
6813
accessable correctly both through SYMTAB and through API.
6815
* gawkapi.c (api_sym_lookup): Call update_global_values().
6816
(api_sym_lookup_scalar): Ditto.
6817
* interpret.h (Op_subscript, Op_subscript_lhs): Ditto.
6818
* main.c (update_global_values): Adjust comment.
6820
Unrelated: Fix --disable-lint so that everything compiles.
6822
* main.c (main): Move case label inside ifdef.
6823
* awkgram.y (isnoeffect): Add ifdefs around declaration, use,
6826
Unrelated: Restore building with tcc.
6828
* awk.h (AFUNC): Move to array.c which is the only place its used.
6829
(ainit_ind, atypeof_ind, etc.): New macros for use in array.c
6830
* array.c (AFUNC): Change to use F##_ind. Works with tcc and other
6832
* configure.ac: Only add -export-dynamic flag if compiling with gcc.
6834
2012-12-18 Andrew J. Schorr <aschorr@telemetry-investments.com>
6836
* gawkapi.c (sym_update_real): If setting a scalar variable that exists
6837
already in an undefined state with type set to Node_var_new, we must
6838
update the type to Node_var if the new value is not undefined.
6840
2012-12-18 Arnold D. Robbins <arnold@skeeve.com>
6842
* awkgram.y (tokentab): "extension" needs to be inside ifdef DYNAMIC.
6843
Thanks to Anders Wallin for finding this.
6845
2012-12-16 Arnold D. Robbins <arnold@skeeve.com>
6847
* debug.c (do_set_var): Fix last remaining `*assoc_lookup() = x'.
6849
2012-12-15 Arnold D. Robbins <arnold@skeeve.com>
6851
Infrastructure Updates:
6853
* awkgram.c, command.c: Regenerated with bison 2.7.
6854
* config.guess, config.sub, depcomp: Updated from automake 1.12.6.
6856
2012-12-09 Arnold D. Robbins <arnold@skeeve.com>
6858
Clean up BINMODE to use symbolic values.
6860
* awk.h (enum binmode_values): New enum.
6861
* eval.c (set_BINMODE): Use them.
6862
* io.c (binmode, close_rp, gawk_popen): Ditto.
6863
* main.c (main): Ditto.
6864
* builtin.c (do_system): Ditto.
6868
* configure.ac: Look for posix_openpt
6869
* io.c (two_way_open): Use posix_openpt if it's available.
6870
Thanks to Christian Weisgerber <naddy@mips.inka.de> for
6875
* regex.c: Don't include <sys/param.h> on VMS. Thanks to
6880
* ext.c (is_letter, is_identifier_char): New functions. Don't use
6881
<ctype.h> functions since those could rely on the locale.
6882
(make_builtin): Adjust test for valid name to call the new
6883
functions and return false instead of throwing a fatal error.
6884
(make_old_builtin): Adjust test for valid name to call the new
6886
* awk.h (is_identchar): Move from here, ...
6887
* awkgram.y (is_identchar): ... to here. This is safe, since
6888
the locale is C during parsing the program.
6890
Also unrelated: Make all checks for bitflags being set consistent
6891
in case we should wish to switch them to macro calls:
6893
* awkgram.y, builtin.c, cint_array.c, debug.c, eval.c, gawkapi.c,
6894
int_array.c, io.c, mpfr.c, node.c, profile.c, str_array.c: Fix
6897
2012-12-07 Arnold D. Robbins <arnold@skeeve.com>
6899
* awkgram.y (tokentab): `fflush()' is now in POSIX, remove the
6900
RESX flag. This was the last use, so delete the flag.
6901
(yylex): Don't check RESX.
6903
Thanks to Nathan Weeks <weeks@iastate.edu> for helping make this
6906
2012-12-01 Arnold D. Robbins <arnold@skeeve.com>
6908
* interpret.h: For op_assign_concat, if both strings
6909
have WSTRCUR, then do the realloc() and append for the
6910
wide string too. Thanks to Janis Papanagnou
6911
<janis_papanagnou@hotmail.com> for the discussion in
6914
2012-11-30 Arnold D. Robbins <arnold@skeeve.com>
6916
* regcomp.c, regex.c, regex_internal.h, regexec.c: Sync
6917
with GLIBC. Why not.
6919
* gawkapi.c (awk_bool_t): Change into an enum with awk_false and
6922
2012-01-30 Andrew J. Schorr <aschorr@telemetry-investments.com>
6924
Further cleanups of macros in awk.h
6926
* awk.h (_r, _t): Remove declarations.
6927
(unref, m_force_string): Remove macros.
6928
(r_unref): Move declaration.
6929
(r_force_string): Remove declaration.
6930
(DEREF, force_string, force_number, unref): Now inline functions.
6931
(POP_STRING, TOP_STRING): Back to macros.
6932
* eval.c (_t): Remove definition.
6933
* main.c (_r): Remove definition.
6934
* node.c (r_force_string): Remove.
6936
2012-11-27 Arnold D. Robbins <arnold@skeeve.com>
6938
* builtin.c (do_fflush): Make fflush() and fflush("") both
6939
flush everything. See the comment in the code.
6941
2012-11-26 Arnold D. Robbins <arnold@skeeve.com>
6943
* awk.h (Node_old_ext_func, Op_old_ext_func): New enum values.
6944
* configure.ac: Use -export-dynamic if supported for old extension
6946
* eval.c (nodeytpes): Add Node_old_ext_func.
6947
(optypetab): Add Op_old_ext_func.
6948
* ext.c (make_old_ext_builtin): "New" function.
6949
* interpret.h: Special case Op_old_ext_builtin. Add checks for
6951
* msg.c: Adjust placement of a comment.
6953
2012-05-02 John Haque <j.eh@mchsi.com>
6955
* str_array.c (str_copy): Initialize next pointer in the linked list
6956
to avoid memory corruption.
6957
* int_array.c (int_copy): Ditto.
6959
2012-04-21 John Haque <j.eh@mchsi.com>
6961
Shutdown routine for a dynamic extension.
6963
* awk.h (SRCFILE): New field fini_func.
6964
* ext.c (load_ext): Takes an additional argument to look up and
6965
save the clean up routine in SRCFILE struct.
6966
(INIT_FUNC, FINI_FUNC): Defines for default init and fini routine
6968
(do_ext): Use default for the name of the init or fini routine if
6969
one is not supplied. Adjust call to load_ext().
6970
(close_extensions): Execute fini routines.
6971
* interpret.h (Op_at_exit): Call close_extensions().
6972
* msg.c (gawk_exit): Ditto.
6973
* debug.c (close_all): Ditto.
6974
* main.c (main): Adjust call to load_ext().
6975
* awkgram.y (tokentab): Specify 2nd and 3rd optional arguments
6976
for the extension() built-in.
6980
* interpret.h (Op_arrayfor_init): Use assoc_length for array size.
6982
2012-04-19 John Haque <j.eh@mchsi.com>
6984
Enhanced array interface to support transparent implementation
6985
using external storage and ...
6987
* awk.h (astore): Optional post-assignment store routine for
6989
(Op_subscript_assign): New opcode to support the store routine.
6990
(alength): New array interface routine for array length.
6991
(assoc_length): New macro.
6992
(assoc_empty): Renamed from array_empty.
6993
* awkgram.y (snode): Append Op_subscript_assign opcode if
6994
(g)sub variable is an array element.
6995
(mk_getline): Same for getline variable.
6996
(mk_assignment): Same if assigning to an array element.
6997
* field.c (set_element): Call store routine if needed.
6998
* builtin.c (do_match): Ditto.
6999
(do_length): Use length routine for array size.
7000
* symbol.c (print_vars): Ditto.
7001
* array.c (null_length): Default function for array length interface.
7002
(asort_actual): Call store routine if defined.
7003
(asort_actual, assoc_list): Use length routine for array size.
7004
(null_array_func): Add length and store routine entries.
7005
* str_array.c (str_array_func): Same.
7006
* cint_array.c (cint_array_func): Same.
7007
* int_array.c (int_array_func): Same.
7008
* eval.c (optypetab): Add Op_subscript_assign.
7009
* profile.c (pprint): Add case Op_subscript_assign.
7010
* interpret.h (set_array, set_idx): New variables to keep track
7011
of an array element with store routine.
7012
(Op_sub_array, Op_subscript_lhs, Op_store_sub, Op_subscript_assign):
7013
Add code to handle array store routine.
7014
* debug.c (print_symbol, print_array, cmp_val, watchpoint_triggered,
7015
initialize_watch_item): Use length routine for array size.
7017
* awk.h (assoc_kind_t): New typedef for enum assoc_list_flags.
7018
(sort_context_t): Renamed from SORT_CONTEXT.
7019
* array.c (asort_actual, assoc_sort): Adjust.
7020
* cint_array.c (cint_list, tree_list, leaf_list): Adjust.
7021
* int_array.c (int_list): Adjust.
7022
* str_array.c (str_list): Adjust.
7024
2012-04-18 John Haque <j.eh@mchsi.com>
7026
* awk.h (atypeof, AFUNC): New macros.
7027
(afunc_t): Renamed typedef from array_ptr.
7028
* array.c (register_array_func, null_lookup): Use AFUNC macro
7029
instead of hard-coded index for array functions.
7030
(asort_actual): Unref null array elements before overwriting.
7031
(force_array): Renamed from get_array.
7032
(null_array): Renamed from init_array. Also initialize flags to 0.
7033
(array_types): Renamed from atypes.
7034
(num_array_types): Renamed from num_atypes.
7035
* interpret.h (r_interpret): In case Op_sub_array, unref null array element.
7036
* str_array.c (str_array_init): Reworked for (re)initialization of array.
7037
* int_array.c (int_array_init): Ditto.
7038
* cint_array.c (cint_array_init): Ditto.
7040
2012-11-24 Arnold D. Robbins <arnold@skeeve.com>
7044
* TODO.xgawk, FUTURES: Merged into TODO.
7045
* TODO: More stuff added.
7046
* Makefile.am (EXTRA_DIST): Updated.
7048
2012-11-22 Arnold D. Robbins <arnold@skeeve.com>
7052
* array.c (r_in_array): Removed.
7053
* awk.h (MALLOC_ARG_T): Replaced with size_t everywhere.
7054
(S_ISREG, setsid): Moved to io.c.
7055
(__extension__): Removed.
7056
(INT32_BIT): Moved to cint_array.c.
7057
(_t): Always declare.
7058
(DO_LINT_INVALID, et al): Moved into an enum.
7059
(POP_ARRAY, POP_PARAM, POP_SCALAR, TOP_SCALAR, dupnode, in_array):
7060
Moved into inline functions.
7061
(force_number, force_string): Simplified.
7062
(ZOS_USS): Remove undef of DYNAMIC, it's handled in configure.ac.
7063
* io.c (S_ISREG, setsid): Moved to here.
7064
* cint_array.c (INT32_BIT): Moved to here.
7065
* eval.c (_t): Always define.
7066
* protos.h: Use size_t directly instead of MALLOC_ARG_T.
7070
* gawkapi.h: Add `awk_' prefix to structure tags where they
7071
were missing. Document the full list of include files needed.
7073
2012-11-14 Arnold D. Robbins <arnold@skeeve.com>
7075
* io.c (do_find_source): On VMS, don't add the `/' separator.
7076
Thanks to Anders Wallin.
7080
* awk.h (mpfr_unset): Declare new function.
7081
* mpfr.c (mpfr_unset): New function.
7082
* node.c (r_unref): Call it instead of inline code.
7083
* gawk_api.c (api_sym_update_scalar): Call it instead of inline code.
7085
2012-11-13 Arnold D. Robbins <arnold@skeeve.com>
7087
* symbol.c (get_symbols): Check type, not vname. Keeps
7088
valgrind happy. Thanks to Andrew Schorr for noticing the problem.
7090
2012-11-10 Arnold D. Robbins <arnold@skeeve.com>
7092
* Update to bison 2.6.5. Various files regenerated.
7093
* io.c (find_source): Add a default value for SHLIBEXT.
7094
(read_with_timeout): For VMS also, just use read().
7096
2012-11-10 John Haque <j.eh@mchsi.com>
7098
* int_array.c (int_copy): Initialize next pointer of newchain to null.
7099
* eval.c (eval_condition): Force string context for an integer used
7102
2012-11-10 Arnold D. Robbins <arnold@skeeve.com>
7104
* gawkapi.c (api_add_ext_func, api_awk_atexit, api_clear_array,
7105
api_create_array, api_create_value, api_register_ext_version,
7106
api_release_value, api_update_ERRNO_string, node_to_awk_value,
7107
remove_element, run_ext_exit_handlers): Add null pointer checks.
7108
Everywhere: Add / fixup leading comments.
7110
* interpret.h (Op_store_sub): If assigning to an uninitialized variable
7111
through SYMTAB, change it to Node_var. Add explanatory comments.
7112
* symbol.c (get_symbol): Rationalized. Skip non-variables in SYMTAB.
7114
2012-11-04 Arnold D. Robbins <arnold@skeeve.com>
7116
* gawkapi.h: Minor documentation edit.
7118
2012-10-31 Arnold D. Robbins <arnold@skeeve.com>
7120
* awkgram.y (want_regexp): Use as a bool, not as an int.
7121
* field.c: Fix a comment.
7122
* gawkapi.h: Add comment to include <errno.h>.
7123
* symbol.c (load_symbols): ``No automatic aggregate initialization.''
7124
Here too. Sigh again.
7126
* gawkapi.h: Minor documentation edits.
7128
2012-11-27 Arnold D. Robbins <arnold@skeeve.com>
7130
* builtin.c (do_fflush): Make fflush() and fflush("") both
7131
flush everything. See the comment in the code.
7133
2012-10-28 Arnold D. Robbins <arnold@skeeve.com>
7135
* Update to bison 2.6.4. Various files regenerated.
7137
2012-10-27 Arnold D. Robbins <arnold@skeeve.com>
7139
* gawkapi.h: Continuing the minor formatting / doc cleanups.
7141
2012-10-26 Arnold D. Robbins <arnold@skeeve.com>
7143
* gawkapi.h: Continuing the minor formatting / doc cleanups.
7145
2012-10-24 Arnold D. Robbins <arnold@skeeve.com>
7147
* gawkapi.h: Still more minor formatting / doc cleanups.
7149
2012-10-23 Arnold D. Robbins <arnold@skeeve.com>
7151
* gawkapi.h: More minor formatting / doc cleanups.
7153
2012-10-21 Arnold D. Robbins <arnold@skeeve.com>
7155
Fixes for z/OS from Dave Pitts.
7157
* awk.h (assoc_list_flags): No trailing comma on last enum value.
7158
* gawkapi.h (awk_valtype_t): Ditto.
7159
* symbol.c (lookup): ``No automatic aggregate initialization.'' Sigh.
7163
* gawkapi.h: Minor formatting / doc cleanups.
7165
2012-10-19 Arnold D. Robbins <arnold@skeeve.com>
7167
If SYMTAB is used, make sure ENVIRON and PROCINFO get loaded too.
7169
* awkgram.y (process_deferred): New function. Call it when program
7170
is completely parsed.
7171
(symtab_used): New variable.
7172
(variable): Set it to true if SYMTAB is looked up.
7173
* main.c (load_environ, load_procinfo): Make sure the routines are
7178
* awkgram.y (yylex): Check continue_allowed and break_allowed as
7179
soon as they are seen in the scanner; the rules that check them
7180
can not be reduced until after a token that allows them is seen,
7181
leading to errors at execution time.
7182
* interpret.h (Op_K_break, Op_K_continue, Op_jmp): Add assertion
7183
that pc->target_jmp is not NULL.
7185
* symbol.c (lookup): Correct a comment.
7187
2012-10-14 Arnold D. Robbins <arnold@skeeve.com>
7189
* gawkapi.h (IOBUF_PUBLIC): Renamed awk_input_buf_t.
7190
(struct iobuf_public): Renamed struct awk_input.
7193
2012-10-13 Arnold D. Robbins <arnold@skeeve.com>
7195
* Update to Automake 1.12.4. Various files regenerated.
7197
2012-10-11 Arnold D. Robbins <arnold@skeeve.com>
7199
* awk.h (dup_ent): New member for Node_param_list.
7200
* symbol.c (install): For parameters, if this is a duplicate, chain
7201
it off the original using the dup_ent pointer.
7202
(remove_params): If there's a duplicate, remove it from the list.
7204
* awk.h: Fix flags to have unique numeric values. Oops.
7206
2012-10-10 Arnold D. Robbins <arnold@skeeve.com>
7208
* gawkapi.h: Add considerably more documentation. Rearrange order
7209
of functions in the struct to make more sense, grouping related
7210
functions together in a more logical order.
7211
* gawkapi.c: Adjust as needed.
7212
* ext.c (make_builtin): Adjust for name change in struct member.
7214
2012-10-05 Arnold D. Robbins <arnold@skeeve.com>
7216
* mbsupport.h: Add a bunch of undefs for z/OS.
7218
2012-10-04 Arnold D. Robbins <arnold@skeeve.com>
7220
* TODO.xgawk: Update.
7221
* awk.h (make_str_node): Removed macro.
7222
(make_string): Modified to call make_str_node.
7223
(r_make_str_node): Renamed to make_str_node.
7224
* gawkapi.c: Changed r_make_str_node to make_str_node everywhere.
7225
* node.c (make_str_node): Renamed from make_str_node.
7227
Update to automake 1.12.4.
7229
* Makefile.in, aclocal.m4, awklib/Makefile.in, doc/Makefile.in,
7230
extension/Makefile.in, extension/aclocal.m4, test/Makefile.in:
7233
* interpret.h (Op_Subscript): Added lint warnings for FUNCTAB
7236
2012-10-02 Arnold D. Robbins <arnold@skeeve.com>
7238
* awk.h (func_table): Declare.
7239
* awkgram.y: If do_posix or do_traditional, then check for
7240
delete on SYMTAB. Add check for delete on FUNCTAB, also.
7241
* interpret.h (Op_Subscript): For FUNCTAB, return the element name
7242
as its value too. Avoids lots of weirdness and allows indirect calls
7243
after assignment from FUNCTAB["foo"] to work.
7244
(Op_store_sub): Disallow assignment to elements of FUNCTAB.
7245
(Op_indirect_func_all): Turn assert into check and fatal error.
7246
* symbol.c (func_table): No longer static.
7247
(lookup): If do_posix or do_traditional, skip the global table.
7248
(release_all_vars): Clear func_table too.
7250
2012-09-25 Arnold D. Robbins <arnold@skeeve.com>
7252
First cut at SYMTAB and FUNCTAB. This does the following:
7253
- Change symbol table handling to use gawk arrays.
7254
- Store symbols in SYMTAB array and allow indirect access
7255
through SYMTAB to variables, both getting and setting.
7256
- List function names in FUNCTAB indexes; Values cannot be
7258
- No documentation yet.
7260
* awk.h (Node_hashnode, hnext, hname, hlength, hcode, hvalue):
7261
Removed, not needed any more.
7262
(init_symbol_table, symbol_table): Add declarations.
7263
* awkgram.y: Disallow delete on SYMTAB, fix warning for tawk
7264
extension if traditional.
7265
* eval.c (nodetypes): Remove Node_hashnode element.
7266
* interpret.h (Op_subscript, Op_store_sub): Handle SYMTAB and go
7267
through to the actual value.
7268
* main.c (main): Init Nnull_string earlier. Add call to
7269
init_symbol_table().
7270
* profile.c (pp_str, pp_len): Change definitions.
7271
(pp_next): New macro.
7272
(pp_push, pp_pop): Adjust uses.
7273
* symbol.c (variables): Removed.
7274
(global_table, param_table, func_table, symbol_table,
7275
installing_specials): New variables.
7276
(lookup, make_params, install_params, remove_params, remove_symbol,
7277
make_symbol, install, get_symbols, release_all_vars, append_symbol,
7278
release_symbols, load_symbols): Rework logic considerably.
7279
(init_symbol_table): New function.
7281
2012-09-23 Arnold D. Robbins <arnold@skeeve.com>
7283
`delete array' and `nextfile' are now in POSIX.
7284
Thanks to Nathan Weeks <weeks@iastate.edu> for the
7285
initiative and letting us know about it.
7287
* awkgram.y: Make the right code changes for `delete array'
7289
(tokentab): Set flags to zero for nextfile.
7291
2012-09-19 Arnold D. Robbins <arnold@skeeve.com>
7293
* symbol.c (load_symbols): Zero out the new node. Prevents assertion
7294
failure on PPC Mac OS X.
7296
2012-09-14 Arnold D. Robbins <arnold@skeeve.com>
7298
Allow read-only access to built-in variables from extensions.
7300
* awk.h (NO_EXT_SET): New flag.
7301
* gawkapi.c (api_sym_lookup, api_sym_update_real): Set flag if off
7302
limits variable instead of failing. Adjust logic.
7303
(api_sym_update_scalar, api_set_array_element, api_del_array_element,
7304
api_release_flattened_array): Adjust logic.
7305
* gawkapi.h: Adjust documentation.
7307
Provide PROCINFO["identifiers"]. Undocumented for now.
7309
* awk.h (load_symbols): Add declaration.
7310
* awkgram.y (variable): Adjust comment formatting.
7311
* main.c (main): Call load_symbols().
7312
* symbol.c (load_symbols): New function.
7314
2012-09-13 Arnold D. Robbins <arnold@skeeve.com>
7316
* configure.ac: Determination of DYNAMIC adjusted. Hopefully is
7319
2012-09-13 Dave Pitts <dpitts@cozx.com>
7321
* awk.h: Add defines for z/OS for newer types.
7323
2012-08-31 Arnold D. Robbins <arnold@skeeve.com>
7325
* gawkapi.c: Wrap various bits in #ifdef DYNAMIC so that
7326
gawk will compile on systems without dynamic loading.
7328
2012-08-24 Arnold D. Robbins <arnold@skeeve.com>
7330
Add version facility to API. Thanks to Manuel Collado
7333
* awk.h (print_ext_versions): Declare.
7334
Rearrange includes and decls to make more sense.
7335
* gawkapi.h (register_ext_version): New API.
7336
(dl_load_func): Add code for ext_version.
7337
* gawkapi.c (api_register_ext_version, print_ext_versions):
7339
* main.c (do_version): New variable.
7340
(optab): Set it for -v / --version.
7341
(main): Set it in arg parsing switch. Call version() after the
7342
extensions have been loaded.
7344
2012-08-22 Arnold D. Robbins <arnold@skeeve.com>
7346
Add output wrapper and two-way processor to extension API.
7348
* awk.h (struct redirect): Replace output FILE * with awk_output_buf_t.
7349
(register_output_wrapper, register_two_way_processor): Declare.
7350
* builtin.c (efwrite): Adjust logic to use rp->output data and
7351
functions if rp is not NULL. Remove redundant declaration of function.
7352
(do_fflush, do_printf, do_print, do_print_rec): Same adjustment.
7353
* ext.c (make_builtin): Adjust error messages.
7354
* gawkapi.c (api_register_output_wrapper,
7355
api_register_two_way_processor): New functions.
7356
(sym_update_real): Adjust code formatting.
7357
* gawkapi.h (awk_input_parser_t): Make next pointer awk_const.
7358
(awk_output_buf_t, awk_two_way_processor_t): New structs.
7359
(api_register_output_wrapper, api_register_two_way_processor): New APIs.
7360
(dl_load_func): Allow for empty function table (NULL elements).
7361
* io.c (find_output_wrapper, init_output_wrapper, find_two_processor,
7362
gawk_fwrite, gawk_ferror, gawk_fflush, gawk_fclose): New functions.
7363
(redirect): Call init_output_wrapper, find_output_wrapper as needed.
7364
Adjust use of rp->fp to rp->output.fp and also function calls.
7365
(close_rp, close_redir, flush_io): Same adjustment.
7366
(two_way_open): Same adjustment. Call find_two_way_processor, and
7367
find_output_wrapper, as needed.
7369
2012-08-17 Arnold D. Robbins <arnold@skeeve.com>
7371
* Update infrastructure: Automake 1.12.3 and bison 2.6.2.
7373
2012-08-15 Arnold D. Robbins <arnold@skeeve.com>
7375
* dfa.c: Sync w/GNU grep.
7377
2012-08-12 Arnold D. Robbins <arnold@skeeve.com>
7379
* gawkapi.h: Make the versions enum constants instead of defines.
7381
2012-08-11 Andrew J. Schorr <aschorr@telemetry-investments.com>
7383
* awkgram.y (add_srcfile): It is now a fatal error to load the
7384
same file with -f and -i (or @include).
7385
* TODO.xgawk: Update to reflect this change.
7387
2012-08-10 Arnold D. Robbins <arnold@skeeve.com>
7389
* FUTURES, TODO.xgawk: Updates.
7391
2012-08-08 Arnold D. Robbins <arnold@skeeve.com>
7393
* configure.ac: Add -DNDEBUG to remove asserts if not developing.
7395
* gawkapi.h: Document how to build up arrays.
7396
* gawkapi.c (api_sym_update): For an array, pass the new cookie
7397
back out to the extension.
7399
* awk.h (IOBUF): Move struct stat into IOBUF_PUBLIC.
7400
(os_isreadable): Change to take an IOBUF_PUBLIC.
7401
* gawkapi.h (IOBUF_PUBLIC): Received struct stat.
7402
(INVALID_HANDLE): Moves to here.
7403
* io.c (iop_alloc): Stat the fd and fill in stat buf.
7404
(iop_finish): Use passed in stat info.
7406
2012-08-05 Arnold D. Robbins <arnold@skeeve.com>
7408
* README.git: More stuff added.
7410
2012-08-01 Arnold D. Robbins <arnold@skeeve.com>
7412
* io.c (iop_finish): New function.
7413
(iop_alloc): Add errno_val parameter. Move code into iop_finish.
7414
Add large explanatory leading comment.
7415
(after_beginfile): Rework logic. Check for input parser first, then
7416
check for invalid iop.
7417
(nextfile): Organize code better. Call iop_alloc then iop_finish.
7418
(redirect): Call iop_alloc, find_input_parser, iop_finish.
7419
(two_way_open): Call iop_alloc, find_input_parser, iop_finish.
7420
(gawk_popen): Call iop_alloc, find_input_parser, iop_finish.
7421
(find_input_parser): Set iop->valid if input parser takes control.
7422
(get_a_record): Rework setting RT to use macros.
7424
2012-07-29 Andrew J. Schorr <aschorr@telemetry-investments.com>
7426
* awk.h (set_RT_to_null, set_RT): Removed.
7427
* gawkapi.h (api_set_RT): Removed.
7428
(get_record): Signature changed in input parser struct.
7429
* gawkapi.c (api_set_RT): Removed.
7430
* io.c (set_RT_to_null, set_RT): Removed.
7431
(get_a_record): Adjustments for new API for input parser.
7433
2012-07-29 Arnold D. Robbins <arnold@skeeve.com>
7435
* awk.h (os_isreadable): Adjust declaration.
7436
(struct iobuf): Add new member `valid'.
7437
* io.c (iop_alloc): Remove do_input_parsers parameter, it's
7438
always true. Adjust logic to set things to invalid if could not
7439
find an input parser.
7440
(after_beginfile): Use valid member to check if iobuf is valid.
7441
Don't clear iop->errcode.
7442
(nextfile): Adjust logic to clear errcode if valid is true and
7443
also to update ERRNO.
7444
(redirect): Check iop->valid and cleanup as necessary, including
7446
(two_way_open): Ditto.
7447
(gawk_popen): Ditto.
7448
(devopen): Remove check for directory.
7450
2012-07-27 Andrew J. Schorr <aschorr@telemetry-investments.com>
7452
* io.c (find_input_parser): Issue a warning if take_control_of fails.
7454
2012-07-27 Arnold D. Robbins <arnold@skeeve.com>
7456
* awk.h (set_RT): Change to take a NODE * parameter.
7457
* io.c (set_RT): Change to take a NODE * parameter.
7458
* gawkapi.h: Change open hook to input parser in comment.
7459
* gawkapi.c (api_set_RT): Adjust call to set_RT.
7461
2012-07-26 Arnold D. Robbins <arnold@skeeve.com>
7463
* awk.h (set_RT_to_null, set_RT): Declare functions.
7464
(os_isreadable): Declare function.
7465
* io.c (set_RT_to_null, set_RT): New functions.
7466
(iop_close): Init ret to zero.
7467
* gawkapi.c (api_register_input_parser): Check for null pointer.
7468
(api_set_RT): New function.
7469
* gawkapi.h (api_set_RT): New function.
7471
2012-07-26 Andrew J. Schorr <aschorr@telemetry-investments.com>
7473
* gawkapi.h (IOBUF_PUBLIC): Document the get_record and close_func
7475
(awk_input_parser_t) Change can_take_file argument to const, and
7477
* io.c (get_a_record): Document that the caller initializes *errcode
7478
to 0, and remote the test for non-NULL errcode.
7480
2012-07-26 Andrew J. Schorr <aschorr@telemetry-investments.com>
7482
* gawkapi.c (api_sym_update_scalar): Fix some minor bugs. Was
7483
not updating AWK_NUMBER when valref != 1. And strings were not
7484
freeing MPFR values.
7486
2012-07-25 Arnold D. Robbins <arnold@skeeve.com>
7488
Start refactoring of IOBUF handling and turn "open hooks"
7489
into "input parsers".
7491
* awk.h (IOP_NOFREE_OBJ): Flag removed.
7492
(register_input_parser): Renamed from register_open_hook.
7493
* ext.c (load_ext): Make sure lib_name is not NULL.
7494
* gawk_api.c (api_register_input_parser): Renamed from
7495
api_register_open_hook.
7496
* gawk_api.h (api_register_input_parser): Renamed from
7497
api_register_open_hook. Rework structure to have "do you want it"
7498
and "take control of it" functions.
7499
* io.c (iop_alloc): Remove third argument which is IOBUF pointer.
7500
Always malloc it. Remove use of IOP_NOFREE_OBJ everywhere.
7501
(find_input_parser): Renamed from find_open_hook.
7502
(nextfile): Don't use static IOBUF.
7503
(iop_close): Call close_func first. Then close fd or remap it
7504
if it's still not INVALID_HANDLE.
7505
(register_input_parser): Renamed from register_open_hook.
7506
Use a FIFO list and check if more than one parser will accept the
7507
file. If so, fatal error.
7509
2012-07-25 Andrew J. Schorr <aschorr@telemetry-investments.com>
7511
* configure.ac: Instead of using acl_shlibext for the shared library
7512
extension, define our own variable GAWKLIBEXT with a hack to work
7513
correctly on Mac OS X.
7514
* Makefile.am (SHLIBEXT): Use the value of GAWKLIBEXT instead of
7517
2012-07-24 Arnold D. Robbins <arnold@skeeve.com>
7519
* configure.ac: Add crude but small hack to make plug-ins work
7522
2012-07-20 Arnold D. Robbins <arnold@skeeve.com>
7524
* gawkapi.h: Rework table to not take up so much space.
7525
* gawkapi.c (api_sym_update_scalar): Rework optimization code
7526
to clean up the function.
7528
2012-07-17 Andrew J. Schorr <aschorr@telemetry-investments.com>
7530
* gawkapi.h: Add comments explaining new api_create_value and
7531
api_release_value functions.
7532
* gawkapi.c (sym_update_real): Allow updates with AWK_SCALAR and
7533
AWK_VALUE_COOKIE types. After creating a regular variable,
7534
remove the call to unref(node->var_value), since this is not
7535
done elsewhere in the code (see, for example, main.c:init_vars).
7536
If the update is for an existing variable, allow any val_type
7537
except AWK_ARRAY (was previously disallowing AWK_SCALAR and
7538
AWK_VALUE_COOKIE for no apparent reason).
7539
(api_sym_update_scalar): The switch should return false for an
7540
invalid val_type value, so change the AWK_ARRAY case to default.
7541
(valid_subscript_type): Any scalar value is good, so accept any valid
7542
type except AWK_ARRAY.
7543
(api_create_value): Accept only AWK_NUMBER and AWK_STRING values.
7544
Anything else should fail.
7546
2012-07-17 Arnold D. Robbins <arnold@skeeve.com>
7550
* awk.h (r_free_wstr): Renamed from free_wstr.
7551
(free_wstr): Macro to test the WSTRCUR flag first.
7552
* node.c (r_free_wstr): Renamed from free_wstr.
7554
Support value cookies:
7556
* gawkapi.h (awk_val_type_t): Add AWK_VALUE_COOKIE.
7557
(awk_value_cookie_t): New type.
7558
(awk_value_t): Support AWK_VALUE_COOKIE.
7559
(api_create_value, api_release_value): New function pointers.
7560
* gawkapi.c (awk_value_to_node, api_sym_update_scalar,
7561
valid_subscript_type): Handle AWK_VALUE_COOKIE.
7562
(api_create_value, api_release_value): New functions.
7564
2012-07-16 Arnold D. Robbins <arnold@skeeve.com>
7566
* gawkapi.c (awk_value_to_node): Support AWK_SCALAR.
7567
(api_sym_update_scalar): Performance improvements.
7569
2012-07-12 Arnold D. Robbins <arnold@skeeve.com>
7571
Allow creation of constants. Thanks to John Haque for the
7572
implementation concept.
7574
* gawk_api.h (api_sym_constant): Create a constant.
7575
* gawk_api.h (api_sym_update_real): Renamed from api_sym_update.
7576
Add is_const parameter and do the right thing if true.
7577
(api_sym_update, api_sym_constant): Call api_sym_update_real
7579
(set_constant): New function.
7581
2012-07-11 Andrew J. Schorr <aschorr@telemetry-investments.com>
7583
* gawkapi.h: Fix typo in comment.
7584
(awk_value_t): Type for scalar_cookie should be awk_scalar_t,
7586
(gawk_api): Add new api_sym_lookup_scalar function.
7587
(sym_lookup_scalar): New wrapper macro for api_sym_lookup_scalar hook.
7588
* gawkapi.c (api_sym_lookup_scalar): New function for faster scalar
7590
(api_impl): Add entry for api_sym_lookup_scalar.
7592
2012-07-11 Andrew J. Schorr <aschorr@telemetry-investments.com>
7594
* gawkapi.c (awk_value_to_node): Change to a switch statement
7595
so AWK_SCALAR or other invalid type is handled properly.
7596
(valid_subscript_type): Test whether a value type is acceptable
7597
for use as an array subscript (any scalar value will do).
7598
(api_get_array_element, api_set_array_element, api_del_array_element):
7599
Use new valid_subscript_type instead of restricting to string values.
7601
2012-07-11 Arnold D. Robbins <arnold@skeeve.com>
7605
* gawkapi.h: Function pointer members renamed api_XXX and
7606
macros adjusted. More documentation.
7607
(awk_valtype_t): New AWK_SCALAR enum for scalar cookies.
7608
(awk_scalar_t): New type.
7609
(awk_value_t): New member scalar_cookie.
7610
(api_sym_update_scalar): New API function.
7611
(erealloc): New macro.
7612
(make_const_string): New macro, renamed from dup_string.
7613
(make_malloced_string): New macro, renamed from make_string.
7614
(make_null_string): New inline function.
7615
(dl_load_func): Add call to init routine through pointer if
7618
* gawkapi.c (awk_value_to_node): Assume that string values came
7620
(node_to_awk_value): Handle AWK_SCALAR.
7621
(api_sym_update): Ditto.
7622
(api_sym_update_scalar): New routine.
7623
(api_get_array_element): Return false if the element doesn't exist.
7624
Always unref the subscript.
7625
(remove_element): New helper routine.
7626
(api_del_array_element): Use it.
7627
(api_release_flattened_array): Ditto.
7628
(api_impl): Add the new routine.
7630
2012-07-11 Andrew J. Schorr <aschorr@telemetry-investments.com>
7632
* gawkapi.c (api_sym_update): Allow val_type to be AWK_UNDEFINED
7633
for setting a variable to "", i.e. dupnode(Nnull_string).
7635
2012-07-10 Andrew J. Schorr <aschorr@telemetry-investments.com>
7637
* awkgram.y (add_srcfile): Lint warning message for a previously loaded
7638
shared library should say "already loaded shared library" instead
7639
of "already included source file".
7641
2012-07-08 Arnold D. Robbins <arnold@skeeve.com>
7643
* gawkapi.h (set_array_element): Use index + value instead
7644
of element structure. Matches get_array_element.
7645
(set_array_element_by_elem): New macro to use an element.
7646
* gawkapi.c (api_set_array_element): Make the necessary adjustments.
7648
2012-07-04 Arnold D. Robbins <arnold@skeeve.com>
7650
* awkgram.y (tokentab): Remove limit on number of arguments
7651
for "and", "or", and "xor".
7652
* builtin.c (do_and, do_or, do_xor): Modify code to perform the
7653
respective operation on any number of arguments. There must be
7656
2012-06-29 Arnold D. Robbins <arnold@skeeve.com>
7658
* gawkapi.h: Improve the documentation of the return values
7661
2012-06-25 Arnold D. Robbins <arnold@skeeve.com>
7663
* TODO.xgawk: Updated.
7664
* awk.h (track_ext_func): Declared.
7665
* awkgram.y (enum defref): Add option for extension function.
7666
(struct fdesc): Add member for extension function.
7667
(func_use): Handle extension function, mark as extension and defined.
7668
(track_ext_func): New function.
7669
(check_funcs): Update logic for extension functions.
7670
* ext.c (make_builtin): Call track_ext_func.
7672
2012-06-24 Andrew J. Schorr <aschorr@telemetry-investments.com>
7674
* TODO.xgawk: Most of IOBUF has been hidden.
7675
* gawkapi.h (IOBUF): Remove declaration (now back in awk.h).
7676
(IOBUF_PUBLIC): Declare new structure defining subset of IOBUF fields
7677
that should be exposed to extensions.
7678
(gawk_api): Update register_open_hook argument from IOBUF to
7680
* awk.h (IOBUF): Restore declaration with 5 fields moved to new
7681
IOBUF_PUBLIC structure.
7682
(register_open_hook): Update open_func argument from IOBUF to
7684
* gawkapi.c (api_register_open_hook): Ditto.
7685
* io.c (after_beginfile, nextfile, iop_close, gawk_pclose): Some fields
7686
such as fd and name are now inside the IOBUF public structure.
7687
(struct open_hook): Update open_func argument from IOBUF to
7688
(register_open_hook): Ditto.
7689
(find_open_hook): opaque now inside IOBUF_PUBLIC.
7690
(iop_alloc): fd and name now in IOBUF_PUBLIC.
7691
(get_a_record): If the get_record hook returns EOF, set the IOP_AT_EOF
7692
flag. Access fd inside IOBUF_PUBLIC.
7693
(get_read_timeout): File name now inside IOBUF_PUBLIC.
7694
* interpret.h (r_interpret): File name now inside IOBUF_PUBLIC.
7695
* ext.c (load_ext): No need to call return at the end of a void
7698
2012-06-24 Arnold D. Robbins <arnold@skeeve.com>
7700
* ext.c (load_ext): Don't return a value from a void function.
7701
* gawkapi.c (api_set_array_element): Set up vname and parent_array.
7703
2012-06-21 Arnold D. Robbins <arnold@skeeve.com>
7705
More API and cleanup:
7707
* awk.h (stopme): Make signature match other built-ins.
7708
* awkgram.y (stopme): Make signature match other built-ins.
7709
(regexp): Minor edit.
7710
* gawkapi.c (api_set_argument): Remove unused variable.
7711
Set parent_array field of array value.
7712
* TODO.xgawk: Update some.
7714
Remove extension() builtin.
7716
* awk.h (do_ext): Removed.
7717
(load_ext): Signature changed.
7718
* awkgram.y (tokentab): Remove do_ext.
7719
Change calls to do_ext.
7720
* ext.c (load_ext): Make init function a constant.
7721
* main.c (main): Change calls to do_ext.
7723
2012-06-20 Arnold D. Robbins <arnold@skeeve.com>
7725
Restore lost debugging function:
7727
* awkgram.y (stopme): Restore long lost debugging function.
7728
* awk.h (stopme): Add declaration.
7732
* ext.c (get_argument): Make extern.
7733
* awk.h (get_argument): Declare it.
7734
* gawkapi.c (api_set_argument): Call it. Finish off the logic.
7735
(api_get_argument): Refine logic to use get_argument.
7736
* gawkapi.h (set_argument): New API.
7738
2012-06-19 Arnold D. Robbins <arnold@skeeve.com>
7740
Remove code duplication in gawkapi.c from msg.c:
7742
* awk.h (err): Add `isfatal' first parameter.
7743
* awkgram.y (err): Adjust all calls.
7744
* msg.c (err): Adjust all calls. Move fatal code to here ...
7745
(r_fatal): From here.
7746
* gawkapi.c: Remove code duplication and adjust calls to `err'.
7748
Handle deleting elements of flattened array:
7750
* awk.h (get_argument): Remove declaration.
7751
* ext.c (get_argument): Make static.
7752
* gawkapi.h (awk_flat_array_t): Make opaque fields const. Add
7753
more descriptive comments.
7754
* gawkapi.c (release_flattened_array): Delete elements flagged
7755
for deletion. Free the flattened array also.
7757
Add additional debugging when developing:
7759
* configure.ac: Add additional debugging flags.
7760
* configure: Regenerated.
7762
2012-06-18 Arnold D. Robbins <arnold@skeeve.com>
7764
* gawkapi.h (get_array_element): Restore `wanted' parameter.
7765
(awk_element_t): Use awk_value_t for index. Add awk_flat_array_t.
7766
(flatten_array): Change signature to use awk_flat_array_t;
7767
(release_flattened_array): Change signature to use awk_flat_array_t;
7768
* gawkapi.c (api_sym_update): Handle case where variable exists already.
7769
(api_get_array_element): Restore `wanted' parameter and pass it
7770
on to node_to_awk_value.
7771
(api_set_array_element): Revisse to match changed element type.
7772
(api_flatten_array): Revise signature, implement.
7773
(api_release_flattened_array): Revise signature, implement.
7775
2012-06-17 Arnold D. Robbins <arnold@skeeve.com>
7779
* gawkapi.h (get_array_element): Remove `wanted' parameter.
7780
(r_make_string): Comment the need for `api' and `ext_id' parameters.
7781
* gawkapi.c (api_sym_update): Move checks to front.
7782
Initial code for handling arrays. Still needs work.
7783
(api_get_array_element): Implemented.
7784
(api_set_array_element): Additional checking code.
7785
(api_del_array_element): Implemented.
7786
(api_create_array): Implemented.
7787
(init_ext_api): Force do_xxx values to be 1 or 0.
7788
(update_ext_api): Ditto.
7790
2012-06-12 Arnold D. Robbins <arnold@skeeve.com>
7794
* gawkapi.h (awk_value_t): Restore union.
7795
(get_curfunc_param): Renamed to get_argument. Return type changed
7796
to awk_bool_t. Semantics better thought out and documented.
7797
(awk_atexit, get_array_element): Return type now void.
7798
(sym_lookup): Return type now void. Argument order rationalized.
7799
* gawkapi.c (node_to_awk_value): Return type is now awk_bool_t.
7800
Semantics now match table in gawkawpi.h.
7801
(api_awk_atexit): Return type now void.
7802
(api_sym_lookup): Return type is now awk_bool_t. Change parameter
7804
(api_get_array_element): Return type is now awk_bool_t.
7806
Further API implementations and fixes for extension/testext.c:
7808
* awk.h (final_exit): Add declaration.
7809
* ext.c (load_ext): Change `func' to install_func.
7810
* gawkapi.c: Add casts to void for id param in all functions.
7811
(api_sym_update): Finish implementation.
7812
(api_get_array_element): Start implementation.
7813
(api_set_array_element): Add error checking.
7814
(api_get_element_count): Add error checking, return the right value.
7815
* main.c (main): Call final_exit instead of exit.
7816
(arg_assign): Ditto.
7817
* msg.c (final_exit): New routine to run the exit handlers and exit.
7818
(gawk_exit): Call it.
7819
* profile.c (dump_and_exit): Ditto.
7821
2012-06-10 Andrew J. Schorr <aschorr@telemetry-investments.com>
7823
* TODO.xgawk: Addition of time extension moved to "done" section.
7825
2012-06-10 Andrew J. Schorr <aschorr@telemetry-investments.com>
7827
* gawkapi.c (api_update_ERRNO_string): Treat boolean true as a request
7828
for TRANSLATE, and false as DONT_TRANSLATE.
7830
2012-06-06 Arnold D. Robbins <arnold@skeeve.com>
7832
* cint_array.c (tree_print, leaf_print): Add additional casts
7833
for printf warnings.
7835
* awk.h (update_ext_api): Add declaration.
7836
* gawkapi.c (update_ext_api): New function.
7837
* eval.c (set_LINT): Call update_ext_api() at the end.
7838
* gawkapi.h: Document that do_XXX could change on the fly.
7840
* awk.h (run_ext_exit_handlers): Add declaration.
7841
* msg.c (gawk_exit): Call it.
7843
2012-06-05 Arnold D. Robbins <arnold@skeeve.com>
7845
* ext.c (load_ext): Remove use of RTLD_GLOBAL. Not needed in new
7846
scheme. Clean up error messages.
7848
2012-06-04 Arnold D. Robbins <arnold@skeeve.com>
7850
* configure.ac: Remove use of -export-dynamic for GCC.
7851
* configure: Regenerated.
7853
2012-05-30 Arnold D. Robbins <arnold@skeeve.com>
7855
* main.c (is_off_limits_var): Minor coding style edit.
7856
* gawkapi.c (awk_value_to_node): More cleanup.
7857
(node_to_awk_value): Use `wanted' for decision making.
7858
(api_sym_update): Start implementation. Needs more work.
7859
General: More cleanup, comments.
7860
* gawkapi.h (api_sym_update): Add additional comments.
7862
2012-05-29 Arnold D. Robbins <arnold@skeeve.com>
7864
* gawkapi.c (node_to_awk_value): Add third parameter indicating type
7865
of value desired. Based on that, do force_string or force_number
7866
to get the "other" type.
7867
(awk_value_to_node): Clean up the code a bit.
7868
(get_curfunc_param): Move forcing of values into node_to_awk_value.
7869
(api_sym_lookup): Add third parameter indicating type of value wanted.
7870
(api_get_array_element): Ditto.
7871
* gawk_api.h: Additional comments and clarifications. Revise APIs
7872
to take third 'wanted' argument as above.
7873
(awk_value_t): No longer a union so that both values may be accessed.
7874
All macros: Parenthesized the bodies.
7875
* bootstrap.sh: Rationalize a bit.
7877
2012-05-26 Andrew J. Schorr <aschorr@telemetry-investments.com>
7879
* Makefile.am (include_HEADERS): Add so gawkapi.h will be installed.
7880
(base_sources): Add gawkapi.h so that it is in dist tarball.
7881
* TODO.xgawk: Update.
7882
* main.c (is_off_limits_var): Stop returning true for everything
7885
2012-05-25 Arnold D. Robbins <arnold@skeeve.com>
7887
* main.c (is_off_limits_var): New function to check if a variable
7888
is one that an extension function may not change.
7889
* awk.h (is_off_limits_var): Declare it.
7890
* gawkapi.c (api_sym_lookup): Use it.
7892
* bootstrap.sh: Touch various files in the extension directory also.
7894
2012-05-24 Andrew J. Schorr <aschorr@telemetry-investments.com>
7896
* gawkapi.h (awk_param_type_t): Remove (use awk_valtype_t instead).
7897
(awk_ext_func_t): Pass a result argument, and return an awk_value_t *.
7898
(gawk_api.get_curfunc_param): Add a result argument.
7899
(gawk_api.set_return_value): Remove obsolete function.
7900
(gawk_api.sym_lookup, gawk_api.get_array_element): Add a result
7902
(gawk_api.api_make_string, gawk_api.api_make_number): Remove hooks,
7903
since access to gawk internal state is not required to do this.
7904
(set_return_value): Remove obsolete macro.
7905
(get_curfunc_param, sym_lookup, get_array_element): Add result argument.
7906
(r_make_string, make_number): New static inline functions.
7907
(make_string, dup_string): Revise macro definitions.
7908
(dl_load_func): Remove global_api_p and global_ext_id args,
7909
and fix SEGV by setting api prior to checking its version members.
7910
(GAWK): Expand ifdef to include more stuff.
7911
* gawkapi.c (node_to_awk_value): Add result argument.
7912
(api_get_curfunc_param): Add result argument, and use awk_valtype_t.
7913
(api_set_return_value): Remove obsolete function.
7914
(awk_value_to_node): New global function to convert back into internal
7916
(api_add_ext_func): Simply call make_builtin.
7917
(node_to_awk_value): Add result argument, and handle Node_val case.
7918
(api_sym_lookup, api_get_array_element): Add result argument.
7919
(api_set_array_element): Implement.
7920
(api_make_string, api_make_number): Remove functions that belong on
7922
(api_impl): Remove 3 obsolete entries.
7923
* TODO.xgawk: Update to reflect progress.
7924
* Makefile.am (base_sources): Add gawkapi.c.
7925
* awk.h: Include gawkapi.h earlier.
7926
(api_impl, init_ext_api, awk_value_to_node): Add declarations
7927
so we can hook in new API.
7928
(INSTRUCTION): Add new union type efptr for external functions.
7929
(extfunc): New define for d.efptr.
7930
(load_ext): Remove 3rd obj argument that was never used for anything.
7931
(make_builtin): Change signature for new API.
7932
* awkgram.y (load_library): Change 2nd argument to load_ext
7933
from dlload to dl_load, and remove pointless 3rd argument.
7934
* main.c (main): Call init_ext_api() before loading shared libraries.
7935
Change 2nd argument to load_ext from dlload to dl_load, and remove
7936
pointless 3rd argument.
7937
* ext.c (do_ext): Remove pointless 3rd argument to load_ext.
7938
(load_ext): Remove 3rd argument. Port to new API (change initialization
7939
function signature). If initialization function fails, issue a warning
7940
and return -1, else return 0.
7941
(make_builtin): Port to new API.
7942
* interpret.h (r_interpret): For Op_ext_builtin, call external functions
7943
with an awk_value_t result buffer, and convert the returned value
7944
to a NODE *. For Node_ext_func, code now in extfunc instead of builtin.
7946
2012-05-21 Andrew J. Schorr <aschorr@telemetry-investments.com>
7948
* configure.ac: Remove libtool, and call configure in the
7949
extension subdirectory. Change pkgextensiondir to remove the
7950
version number, since the new API has builtin version checks.
7951
* TODO.xgawk: Update.
7952
* ltmain.sh: Removed, since libtool no longer used here.
7954
2012-05-19 Andrew J. Schorr <aschorr@telemetry-investments.com>
7956
* TODO.xgawk: Update to reflect progress and new issues.
7957
* main.c (main): Add -i (--include) option.
7959
* awkgram.y (add_srcfile): Eliminate duplicates only for SRC_INC
7960
and SRC_EXTLIB sources (i.e. -f duplicates should not be removed).
7961
* io.c (find_source): Set DEFAULT_FILETYPE to ".awk" if not defined
7964
2012-05-15 Arnold D. Robbins <arnold@skeeve.com>
7966
* awk.h: Include "gawkapi.h" to get IOBUF.
7967
* gawkapi.h: Considerable updates.
7968
* gawkapi.c: New file. Start at implementing the APIs.
7970
2012-05-13 Andrew J. Schorr <aschorr@telemetry-investments.com>
7972
* TODO.xgawk: Update to reflect recent discussions and deletion of
7973
extension/xreadlink.[ch].
7975
2012-05-11 Arnold D. Robbins <arnold@skeeve.com>
7977
Sweeping change: Use `bool', `true', and `false' everywhere.
7979
2012-04-09 Andrew J. Schorr <aschorr@telemetry-investments.com>
7981
* eval.c (unset_ERRNO): Fix memory management bug -- need to use
7982
dupnode with Nnull_string.
7984
2012-04-08 Andrew J. Schorr <aschorr@telemetry-investments.com>
7986
* Makefile.am (valgrind): Define VALGRIND instead of redefining AWK.
7987
This allows test/Makefile.am to set up the command environment as
7989
(valgrind-noleak): Ditto, plus set --leak-check=no instead of the
7990
default summary setting.
7992
2012-04-07 Andrew J. Schorr <aschorr@telemetry-investments.com>
7994
* TODO.xgawk: Update to reflect progress.
7996
2012-04-01 Andrew J. Schorr <aschorr@telemetry-investments.com>
7998
* TODO.xgawk: Move valgrind-noleak item into "done" section.
7999
* Makefile.am (valgrind-noleak): Add new valgrind rule that omits
8000
the "--leak-check=full" option to help spot more serious problems.
8002
2012-04-01 Andrew J. Schorr <aschorr@telemetry-investments.com>
8004
* TODO.xgawk: Move ERRNO item into "done" section.
8005
* awk.h (update_ERRNO, update_ERRNO_saved): Remove declarations.
8006
(update_ERRNO_int, enum errno_translate, update_ERRNO_string,
8007
unset_ERRNO): Add new declarations.
8008
* eval.c (update_ERRNO_saved): Renamed to update_ERRNO_int.
8009
(update_ERRNO_string, unset_ERRNO): New functions.
8010
* ext.c (do_ext): Use new update_ERRNO_string function.
8011
* io.c (ERRNO_node): Remove redundant extern declaration (in awk.h).
8012
(after_beginfile, nextfile): Replace update_ERRNO() with
8013
update_ERRNO_int(errno).
8014
(inrec): Replace update_ERRNO_saved with update_ERRNO_int.
8015
(do_close): Use new function update_ERRNO_string.
8016
(close_redir, do_getline_redir, do_getline): Replace update_ERRNO_saved
8017
with update_ERRNO_int.
8019
2012-03-27 Andrew J. Schorr <aschorr@telemetry-investments.com>
8021
* TODO.xgawk: Update to reflect debate about how to support Cygwin
8022
and other platforms that cannot link shared libraries with unresolved
8024
* awkgram.y (add_srcfile): Minor bug fix: reverse sense of test
8025
added by Arnold in last patch.
8026
* configure.ac: AC_DISABLE_STATIC must come before AC_PROG_LIBTOOL.
8028
2012-03-26 Arnold D. Robbins <arnold@skeeve.com>
8032
* awkgram.y (add_srcfile): Use whole messages, better for
8034
* io.c (init_awkpath): Small style tweak.
8035
* main.c (path_environ): Straighten out initial comment, fix
8036
compiler warning by making `val' const char *.
8038
2012-03-25 Andrew J. Schorr <aschorr@telemetry-investments.com>
8040
* configure.ac (AC_DISABLE_STATIC): Add this to avoid building useless
8041
static extension libraries.
8043
2012-03-25 Andrew J. Schorr <aschorr@telemetry-investments.com>
8045
* TODO.xgawk: New file listing completed and pending xgawk enhancements.
8047
2012-03-24 Andrew J. Schorr <aschorr@telemetry-investments.com>
8049
* io.c (path_info): Fix white space.
8050
(pi_awkpath, pi_awklibpath): Avoid structure initializers.
8051
(do_find_source): Eliminate pointless parentheses.
8052
(find_source): Leave a space after "&".
8053
* main.c (load_environ): Fix typo in comment.
8055
2012-03-21 Andrew J. Schorr <aschorr@telemetry-investments.com>
8057
* awkgram.y (LEX_LOAD): New token to support @load.
8058
(grammar): Add rules to support @load.
8059
(tokentab): Add "load".
8060
(add_srcfile): Improve error message to distinguish between source files
8061
and shared libraries.
8062
(load_library): New function to load libraries specified with @load.
8063
(yylex): Add support for LEX_LOAD (treated the same way as LEX_INCLUDE).
8065
2012-03-20 Andrew J. Schorr <aschorr@telemetry-investments.com>
8067
* Makefile.am (EXTRA_DIST): Remove extension.
8068
(SUBDIRS): Add extension so libraries will be built.
8069
(DEFS): Define DEFLIBPATH and SHLIBEXT so we can find shared libraries.
8070
* awk.h (deflibpath): New extern declaration.
8071
* configure.ac: Add support for building shared libraries by adding
8072
AC_PROG_LIBTOOL and AC_SUBST for acl_shlibext and pkgextensiondir.
8073
(AC_CONFIG_FILES): Add extension/Makefile.
8074
* io.c (pi_awkpath, pi_awklibpath): New static structures to contain
8076
(awkpath, max_pathlen): Remove static variables now inside pi_awkpath.
8077
(init_awkpath): Operate on path_info structure to support both
8078
AWKPATH and AWKLIBPATH. No need for max_path to be static, since
8079
this should be called only once for each environment variable.
8080
(do_find_source): Add a path_info arg to specify which path to search.
8081
Check the try_cwd parameter to decide whether to search the current
8082
directory (not desirable for AWKLIBPATH).
8083
(find_source): Choose appropriate path_info structure based on value
8084
of the is_extlib argument. Set EXTLIB_SUFFIX using SHLIBEXT define
8085
instead of hardcoding ".so".
8086
* main.c (path_environ): New function to add AWKPATH or AWKLIBPATH
8087
to the ENVIRON array.
8088
(load_environ): Call path_environ for AWKPATH and AWKLIBPATH.
8090
2012-06-19 Arnold D. Robbins <arnold@skeeve.com>
8092
* main.c (main): Do setlocale to "C" if --characters-as-bytes.
8093
Thanks to "SP" for the bug report.
8095
2012-05-09 Arnold D. Robbins <arnold@skeeve.com>
8097
* configure.ac: Added AC_HEADER_STDBOOL
8098
* awk.h, dfa.c, regex.c: Reworked to use results
8099
of test and include missing_d/gawkbool.h.
8101
2012-05-07 Arnold D. Robbins <arnold@skeeve.com>
8103
* array.c (prnode): Add casts to void* for %p format.
8104
* debug.c (print_instruction): Ditto.
8105
* builtin.c: Fix %lf format to be %f everywhere.
8109
* replace.c: Don't include "config.h", awk.h gets it for us.
8111
2012-05-04 Arnold D. Robbins <arnold@skeeve.com>
8113
* getopt.c [DJGPP]: Change to __DJGPP__.
8114
* mbsupport.h [DJGPP]: Change to __DJGPP__.
8118
* awk.h: Workarounds for _TANDEM_SOURCE.
8120
2012-05-01 Arnold D. Robbins <arnold@skeeve.com>
8122
* dfa.c: Sync with GNU grep. RRI code now there, needed additional
8124
* configure.ac: Add check for stdbool.h.
8125
* regex.c: Add check for if not have stdbool.h, then define the
8128
2012-04-27 Arnold D. Robbins <arnold@skeeve.com>
8130
* dfa.c: Sync with GNU grep.
8131
* xalloc.h (xmemdup): Added, from grep, for dfa.c. Sigh.
8133
2012-04-27 Arnold D. Robbins <arnold@skeeve.com>
8135
Update to autoconf 2.69, automake 1.12.
8137
* INSTALL, aclocal.m4, configh.in, depcomp, install-sh, missing,
8138
mkinstalldirs, ylwrap: Updated.
8139
* configure.ac (AC_TYPE_LONG_LONG_INT, AC_TYPE_UNSIGNED_LONG_LONG_INT,
8140
AC_TYPE_INTMAX_T, AC_TYPE_UINTMAX_T): Renamed from gl_* versions.
8141
* configure: Regenerated.
8143
2012-04-24 Arnold D. Robbins <arnold@skeeve.com>
8145
* cmd.h (dPrompt, commands_Prompt, eval_Prompt, dgawk_Prompt): Changed
8146
to dbg_prompt, commands_prompt, eval_prompt, dgawk_prompt.
8148
* command.y: Ditto. Some minor whitespace and comments cleanup.
8150
2012-04-24 Arnold D. Robbins <arnold@skeeve.com>
8152
io.c cleanup and some speedup for RS as regexp parsing.
8154
* awk.h (Regexp): New members has_meta and maybe_long.
8155
(enum redirval): Add redirect_none as value 0.
8156
(remaybelong): Remove function declaration.
8157
* awkgram.y: Use redirect_none instead of 0 for no redirect cases.
8158
* io.c (go_getline_redir): Second arg now of type enum redirval.
8159
Changed intovar into into_variable.
8160
(comments and whitespace): Lots of general cleanup.
8161
(socket_open): readle changed to read_len.
8162
(two_way_open): Add additional calls to os_close_on_exec.
8163
(rsrescan): Simplify code a bit and use RS->maybe_long.
8164
* re.c (make_regexp): Set up new members in Regexp struct.
8165
(remaybelong): Remove function.
8166
(reisstring): Simplified code.
8168
2012-04-16 Eli Zaretskii <eliz@gnu.org>
8170
* io.c (read_with_timeout) [__MINGW32__]: Just call the blocking
8171
'read', as 'select' is only available for sockets.
8172
* mpfr.c (set_ROUNDMODE) [!HAVE_MPFR]: Renamed from set_RNDMODE.
8173
* main.c (load_procinfo): Declare name[] also when HAVE_MPFR is
8174
defined even though HAVE_GETGROUPS etc. are not.
8176
2012-04-12 John Haque <j.eh@mchsi.com>
8178
* array.c, awk.h, awkgram.y, builtin.c, command.y, debug.c,
8179
field.c, mpfr.c, profile.c: Change RND_MODE to ROUND_MODE.
8181
2012-04-11 John Haque <j.eh@mchsi.com>
8183
* main.c (varinit): Change RNDMODE to ROUNDMODE.
8185
2012-04-11 Arnold D. Robbins <arnold@skeeve.com>
8187
* main.c: Change --arbitrary-precision to --bignum.
8189
2012-04-02 John Haque <j.eh@mchsi.com>
8191
Add support for arbitrary-precision arithmetic.
8194
* awk.h (struct exp_node): Add union to handle different number types.
8195
(MPFN, MPZN): New flag values.
8196
(DO_MPFR, do_mpfr): New defines.
8197
(PREC_node, RNDMODE_node): Add declarations.
8198
(PRECISION, RND_MODE, MNR, MFNR, mpzval, do_ieee_fmt): Add declarations.
8199
(make_number, str2number, format_val, cmp_numbers): Ditto.
8200
(force_number): Change definition.
8201
(Func_pre_exec, Func_post_exec): New typedefs.
8202
(POP_NUMBER, TOP_NUMBER): Change definitions.
8203
(get_number_ui, get_number_si, get_number_d, get_number_uj,
8204
iszero, IEEE_FMT, mpg_float, mpg_integer, mpg_float,
8205
mpg_integer): New defines.
8206
* awkgram.y (tokentab): Add alternate function entries for MPFR/GMP.
8207
(snode): Choose the appropriate function.
8208
(negate_num): New function to negate a number.
8210
(yylex): Adjust number handling code.
8211
* array.c (value_info, asort_actual, sort_user_func): Adjust for
8213
(do_adump, indent): Minor changes.
8214
(sort_up_index_number, sort_up_value_number, sort_up_value_type): Use
8215
cmp_numbers() for numeric comparisons.
8216
* builtin.c (mpz2mpfr): New function.
8217
(format_tree): Adjust to handle MPFR and GMP numbers.
8218
* eval.c (register_exec_hook): New function to manage interpreter hooks.
8219
(num_exec_hook, pre_execute, post_execute): New and adjusted definitions.
8220
(h_interpret): Renamed from debug_interpret.
8221
(init_interpret): Changed to use the new name.
8222
(flags2str): New entries for MPFN and MPZN.
8223
(cmp_nodes): Reworked to use separate routine for numeric comparisons.
8224
(set_IGNORECASE, set_BINMODE, set_LINT, update_NR, update_FNR,
8225
update_NF): Adjust code and some cleanup.
8226
* field.c (rebuild_record): Field copying code reworked to handle
8228
(set_NF): Minor adjustment.
8229
* io.c (INCREMENT_REC): New macro.
8230
(inrec, do_getline): Use the new macro.
8231
(nextfile, set_NR, set_FNR, get_read_timeout, pty_vs_pipe): Adjust code
8232
to handle MPFR/GMP numbers.
8233
* interpret.h (r_interpret): Adjust TOP_NUMBER/POP_NUMBER usage.
8234
(EXEC_HOOK): New macro and definition.
8235
(DEBUGGING): Removed.
8236
* main.c (DEFAULT_PREC, DEFAULT_RNDMODE): New defines.
8237
(opttab): New entry for option arbitrary-precision.
8238
(main): Handle the new option.
8239
(usage): Add to usage message.
8240
(varinit): Add PREC and RNDMODE.
8241
(load_procinfo): Install MPFR and GMP related items.
8242
(version): Append MPFR and GMP versions to message.
8243
* msg.c (err) : Adjust FNR handling with MPFR/GMP.
8244
* node.c (r_format_val): Renamed from format_val.
8245
(r_force_number): Return NODE * instead of AWKNUM.
8246
(make_number, str2number, format_val, cmp_numpers: Defined and initialized.
8247
(r_unref): Free MPFR/MPZ numbers.
8248
(get_numbase): Renamed from isnondecimal and return the base.
8249
(cmp_awknums): New function to compare two AWKNUMs.
8250
* command.y (yylex): Adjust number handling code.
8251
(grammar): Minor adjustments to handle negative numbers.
8252
* debug.c (init_debug): New function.
8253
(do_info, do_set_var, watchpoint_triggered, serialize,
8254
initialize_watch_item, do_watch, print_watch_item): Minor adjustments.
8255
(debug_pre_execute): Adjusted to handle MPFR and GMP numbers.
8257
2012-04-09 Arnold D. Robbins <arnold@skeeve.com>
8259
* INSTALL, config.guess, config.sub, depcomp, install-sh,
8260
missing, mkinstalldirs, ylwrap: Update to latest from automake 1.11.4.
8262
2012-04-08 Arnold D. Robbins <arnold@skeeve.com>
8264
* Update various files to automake 1.11.4.
8266
2012-03-30 Arnold D. Robbins <arnold@skeeve.com>
8268
* configure.ac (GAWK_AC_NORETURN): Do as macro instead of inline.
8270
2012-03-29 Arnold D. Robbins <arnold@skeeve.com>
8272
* dfa.h, dfa.c: Sync with grep. Major cleanups and some changes
8274
* re.c (research): Pass size_t* to dfaexec to match type change.
8275
* configure.ac (AH_VERBATIM[_Noreturn]): Added from Paul Eggert to
8277
(AC_INIT): Bump version.
8278
* configure, configh.in, version.c: Regenerated.
8280
2012-03-28 Arnold D. Robbins <arnold@skeeve.com>
8282
* 4.0.1: Release tar ball made.
8284
2012-03-28 Arnold D. Robbins <arnold@skeeve.com>
8286
* getopt.c: Add DJGPP to list of platforms where it's ok
8287
to include <stdlib.h>.
8288
* awkgram.y, builtin.c, ext.c, mbsupport.h, re.c: Update
8291
2012-03-21 Corinna Vinschen <vinschen@redhat.com>
8293
* getopt.c: Add Cygwin to list of platforms where it's ok
8294
to include <stdlib.h>.
8296
2012-03-20 Arnold D. Robbins <arnold@skeeve.com>
8298
Get new getopt to work on Linux and C90 compilers:
8300
* getopt.c: Undef ELIDE_CODE for gawk.
8301
(_getopt_internal_r): Init first.needs_free to 0. In test for -W
8302
move executable code to after declarations for C90 compilers.
8303
* getopt1.c: Undef ELIDE_CODE for gawk.
8305
Minor bug fix with printf, thanks to John Haque:
8307
* builtin.c (format_tree): Initialize base to zero at the top
8310
Getting next tar ball ready:
8312
* configure.ac: Remove duplicate check for wcscoll. Thanks
8315
2012-03-16 Arnold D. Robbins <arnold@skeeve.com>
8317
* getopt.c, getopt.h, getopt1.c, getopt_int.h, regcomp.c,
8318
regex.c, regex.h, regex_internal.c, regex_internal.h,
8319
regexec.c: Sync with GLIBC, what the heck.
8321
2012-03-14 Eli Zaretskii <eliz@gnu.org>
8323
* mbsupport.h (btowc): Change for non-DJGPP.
8324
* re.c (dfaerror): Add call to exit for DJGPP.
8326
2012-03-14 Arnold D. Robbins <arnold@skeeve.com>
8328
* regex_internal.c (re_string_skip_chars): Fix calculation of
8329
remain_len with m.b. chars. Thanks to Stanislav Brabec
8332
2012-02-28 Arnold D. Robbins <arnold@skeeve.com>
8334
* main.c (init_groupset): Make `getgroups' failing a non-fatal
8335
error. After all, what's the big deal? Should help on Plan 9.
8337
2012-02-27 Arnold D. Robbins <arnold@skeeve.com>
8339
* dfa.c (parse_bracket_exp): Revert changes 2012-02-15 to stay
8341
* dfa.h (dfarerror): Add __attribute__ from grep.
8343
2012-02-15 Arnold D. Robbins <arnold@skeeve.com>
8345
Fix warnings from GCC 4.6.2 -Wall option.
8347
* awkgram.y (newline_eof): New function to replace body of
8349
(yylex): Replace body of NEWLINE_EOF macro.
8350
* dfa.c (parse_bracket_exp): Init variables to zero.
8351
* ext.c (dummy, junk): Remove.
8352
* regex_internal.c (re_string_reconstruct): Remove buf array. It was
8355
2012-02-10 Arnold D. Robbins <arnold@skeeve.com>
8357
* dfa.c: Sync with GNU grep.
8359
2012-02-07 Arnold D. Robbins <arnold@skeeve.com>
8361
* main.c (main): Move init of `output_fp' to before parsing of
8362
program so that error messages from msg.c don't dump core.
8363
Thanks to Michael Haardt <michael@moria.de>.
8365
2012-01-13 Arnold D. Robbins <arnold@skeeve.com>
8367
* dfa.c [is_valid_unibtye_character]: Fix from GNU grep to
8368
bug reported by me from Scott Deifik for DJGPP.
8370
2012-01-03 Arnold D. Robbins <arnold@skeeve.com>
8372
* dfa.c: Sync with GNU grep.
8374
2012-01-02 Arnold D. Robbins <arnold@skeeve.com>
8376
* io.c (Read_can_timeout, Read_timeout, Read_default_timeout):
8377
Renamed to use lower case.
8378
Other minor stylistic edits.
8380
2012-01-01 John Haque <j.eh@mchsi.com>
8382
* awk.h (struct iobuf): New entry read_func.
8383
* io.c (Read_can_timeout, Read_timeout, Read_default_timeout):
8385
(init_io): New routine to initialize the variables.
8386
(in_PROCINFO): New "clever" routine to parse elements with indices
8387
separated by a SUPSEP.
8388
(get_read_timeout): New routine to read timeout value for an IOBUF.
8389
(read_with_timeout): New routine to read from a fd with a timeout.
8390
(pty_vs_pipe): Use in_PROCINFO().
8391
(get_a_record): Set the timeout value and the read routine as necessary.
8392
* main.c (main): Call init_io().
8394
2011-12-31 Arnold D. Robbins <arnold@skeeve.com>
8396
* profile_p.c: Remove the file.
8397
* msg.c (err): Remove check for name being dgawk.
8399
2011-12-31 Arnold D. Robbins <arnold@skeeve.com>
8401
* awk.h [STREQ, STREQN]: Remove macros.
8402
* awkgram.y, builtin.c, command.y, debug.c, eval.c,
8403
io.c, msg.c: Change all uses to call strcmp, strncmp.
8405
2011-12-28 Arnold D. Robbins <arnold@skeeve.com>
8407
* int_array.c, str_array.c: Fix some compiler warnings 32/64
8408
bit system differences.
8410
2011-12-26 John Haque <j.eh@mchsi.com>
8412
Merge gawk, pgawk and dgawk into a single executable gawk.
8414
* awk.h (DO_PRETTY_PRINT, DO_PROFILE, DO_DEBUG,
8415
do_pretty_print, do_debug): New defines.
8416
(interpret): New variable, a pointer to an interpreter routine.
8417
(enum exe_mode): Nuked.
8418
* main.c (opttab): New options --pretty-print and --debug;
8419
Remove option --command.
8420
(usage): Update usage messages.
8421
* interpret.h: New file.
8422
* eval.c (r_interpret): Move to the new file.
8423
(debug_interpret): New interpreter routine when debugging.
8424
(init_interpret): New routine to initialize interpreter related
8426
* eval_d.c, eval_p.c: Delete files.
8427
* debug.c (interpret): Renamed to debug_prog.
8428
(DEFAULT_PROMPT, DEFAULT_HISTFILE, DEFAULT_OPTFILE): Remove prefix 'd'.
8429
* profile.c (init_profiling): Nuked.
8430
* Makefile.am: Adjusted.
8432
Add command line option --load for loading extensions.
8434
* awk.h (srctype): Add new source type SRC_EXTLIB.
8435
* ext.c(load_ext): New routine to load extension.
8436
(do_ext): Adjust to use load_ext().
8437
* main.c (opttab): Add new option --load.
8438
(main): Call load_ext() to load extensions.
8439
(usage): Add usage message for the new option.
8440
* io.c (get_cwd): New routine.
8441
(do_find_source): Use the new routine.
8442
(find_source): Handle new type SRC_EXTLIB.
8443
* awkgram.y (parse_program, next_sourcefile): Skip type SRC_EXTLIB.
8444
(add_srcfile): Adjust call to find_source.
8445
* debug.c (source_find): Same.
8449
* ext.c (get_argument): Fixed argument parsing.
8450
* array.c (null_array_func): Reworked array routines for an empty array.
8451
* str_array.c, int_array.c: Make GCC happy, use %u instead of %lu
8453
* eval.c (node_Boolean): New array for TRUE and FALSE nodes.
8454
(init_interpret): Create the new nodes.
8455
(eval_condition): Add test for the new nodes.
8456
(setup_frame): Disable tail-recursion optimization when profiling.
8457
* interpret.h (r_interpret): Use the boolean nodes instead of making
8458
new ones when needed.
8460
2011-12-26 Arnold D. Robbins <arnold@skeeve.com>
8462
Finish Rational Range Interpretation (!)
8464
* dfa.c (match_mb_charset): Compare wide characters directly
8465
instead of using wcscoll().
8466
* regexec.c (check_node_accept_byte): Ditto.
8468
Thanks to Paolo Bonzini for pointing these out.
8470
2011-12-06 John Haque <j.eh@mchsi.com>
8472
* debug.c (source_find): Fix misplaced call to efree.
8473
* profile.c (redir2str): Add a missing comma in the redirtab array.
8474
* eval.c (r_interpret): Disallow call to exit if currule is undefined.
8475
This avoids the possibility of running END blocks more than once when
8476
used in a user-defined sorted-in comparison function.
8477
* array.c (sort_user_func): Adjust appropriately.
8479
2011-12-06 Arnold D. Robbins <arnold@skeeve.com>
8481
* awk.h, mbsupport.h: Changes for MBS support on DJGPP
8483
* io.c: Disable pty support on z/OS.
8485
2011-11-27 Arnold D. Robbins <arnold@skeeve.com>
8487
* dfa.c: Sync with GNU grep.
8488
* dfa.h: Add _GL_ATTRIBUTE_PURE macro. Bleah.
8490
2011-11-14 John Haque <j.eh@mchsi.com>
8492
* debug.c (set_breakpoint_at): Fix problem with setting
8493
breakpoints in a switch statement. Thanks to Giorgio Palandri
8494
<giorgio.palandri@gmail.com> for the bug report.
8496
2011-11-14 Arnold D. Robbins <arnold@skeeve.com>
8498
* mbsupport.h: Add check for HAVE_BTOWC, per Pat Rankin.
8500
2011-11-12 Eli Zaretskii <eliz@gnu.org>
8502
* mbsupport.h: Additional glop for dfa.c in Windows environment.
8504
2011-11-01 Arnold D. Robbins <arnold@skeeve.com>
8506
* dfa.c: Move glop for ! MBS_SUPPORT to ...
8507
* mbsupport.h: ... here.
8508
* replace.c: Include missing_d/wcmisc.c if ! MBS_SUPPORT.
8509
* regex_internal.h: Move include of mbsupport.h up and add
8510
additional checks to avoid inclusion of wctype.h and wchar.h.
8512
2011-10-27 Arnold D. Robbins <arnold@skeeve.com>
8514
* builtin.c (do_strftime): Per Pat Rankin, instead of casting
8515
fclock, use a long variable and check for negative or overflow.
8517
2011-10-25 Arnold D. Robbins <arnold@skeeve.com>
8519
Merge with gawk_performance branch done. Additionally:
8521
* cint_array.c, int_array.c, str_array.c: Fix compiler complaints
8522
about printf formats (signed / unsigned vs. %d / %u).
8523
* eval.c (setup_frame): Add a missing return value.
8525
2011-10-25 Arnold D. Robbins <arnold@skeeve.com>
8527
* Makefile.am (dist-hook): Use `cd $(srcdir)/pc' so that
8528
`make distcheck' works completely.
8529
* builtin.c (do_strftime): Add cast to long int in check
8530
for fclock < 0 for systems where time_t is unsigned (e.g., VMS).
8532
2011-10-25 Stefano Lattarini <stefano.lattarini@gmail.com>
8534
dist: generated file `version.c' is not removed by "make distclean"
8536
* Makefile.am (distcleancheck_listfiles): Define to ignore the
8537
generated `version.c' file.
8539
2011-10-24 Arnold D. Robbins <arnold@skeeve.com>
8541
* dfa.c (wcscoll): Create for VMS.
8542
* Makefile.am (dist-hook): Run sed scripts to make pc/config.h.
8544
2011-10-24 Eli Zaretskii <eliz@gnu.org>
8546
* builtin.c [HAVE_POPEN_H]: Include "popen.h".
8547
* README.git: Update for pc/ systems.
8549
2011-10-21 Arnold D. Robbins <arnold@skeeve.com>
8551
* Makefile.am (distcleancheck_listfiles): Added, per advice from
8552
Stefano Lattarini <stefano.lattarini@gmail.com>.
8553
* dfa.c: Additional faking of mbsupport for systems without it;
8556
2011-10-21 Stefano Lattarini <stefano.lattarini@gmail.com>
8558
* configure.ac (AM_C_PROTOTYPES): Remove call to this macro.
8559
The comments in configure.ac said that the call to AM_C_PROTOTYPES
8560
was needed for dfa.h, synced from GNU grep; but this statement is
8561
not true anymore in grep since commit v2.5.4-24-g9b5e7d4 "replace
8562
AC_CHECK_* with gnulib modules", dating back to 2009-11-26. Also,
8563
the support for automatic de-ANSI-fication has been deprecated in
8564
automake 1.11.2, and will be removed altogether in automake 1.12.
8565
* vms/vms-conf.h (PROTOTYPES, __PROTOTYPES): Remove these #define,
8566
they are not used anymore.
8567
* pc/config.h (PROTOTYPES): Likewise.
8569
2011-10-18 Dave Pitts <dpitts@cozx.com>
8571
* dfa.c: Move some decls to the top of their functions for
8574
2011-10-18 Arnold D. Robbins <arnold@skeeve.com>
8576
* builtin.c (do_strftime): Add check for negative / overflowed
8577
time_t value with fatal error. Thanks to Hermann Peifer
8578
<peifer@gmx.eu> for the bug report.
8579
* dfa.c (setbit_wc): Non-MBS version. Add a return false
8580
since VMS compiler doesn't understand that abort doesn't return.
8582
2011-10-10 Arnold D. Robbins <arnold@skeeve.com>
8584
* builtin.c (do_sub): Init textlen to zero to avoid "may be
8585
used uninitialized" warning. Thanks to Corinna Vinschen for
8587
* eval.c (unwind_stack): Add parentheses around condition in while
8588
to avoid overzealous warning from GCC.
8590
2011-09-30 Eli Zaretskii <eliz@gnu.org>
8592
* io.c (remap_std_file): Fix non-portable code that caused
8593
redirected "print" to fail if a previous read from standard input
8594
returned EOF. Reported by David Millis <tvtronix@yahoo.com>.
8595
(remap_std_file): Per Eli's suggestion, removed the leading close
8596
of oldfd and will let dup2 do the close for us.
8598
2011-10-11 John Haque <j.eh@mchsi.com>
8600
* symbol.c: Add licence notice.
8601
* array.c (PREC_NUM, PREC_STR): Define as macros.
8603
2011-10-09 Arnold D. Robbins <arnold@skeeve.com>
8605
* dfa.c: Sync with GNU grep.
8607
2011-10-07 John Haque <j.eh@mchsi.com>
8609
Tail recursion optimization.
8610
* awkgram.y (grammar, mk_function): Recognize tail-recursive
8612
* awk.h (tail_call, num_tail_calls): New defines.
8613
* eval.c (setup_frame): Reuse function call stack for
8614
tail-recursive calls.
8615
(dump_fcall_stack): Reworked.
8617
2011-10-04 Arnold D. Robbins <arnold@skeeve.com>
8619
* awk.h, main.c (gawk_mb_cur_max): Make it a constant 1 when
8620
MBS_SUPPORT isn't available to allow GCC dead code constant
8621
expression computation and dead code elimination to help out.
8623
2011-10-02 Arnold D. Robbins <arnold@skeeve.com>
8625
* io.c (rsnullscan, get_a_record): Fix the cases where terminators
8626
are incomplete when RS == "". Also fix the case where the new value
8627
is shorter than the old one. Based on patch from Rogier
8628
<rogier777@gmail.com> as submitted by Jeroen Schot
8629
<schot@A-Eskwadraat.nl>.
8631
2011-09-24 Arnold D. Robbins <arnold@skeeve.com>
8633
* eval.c, io.c, re.c: Fix some spelling errors. Thanks to
8634
Jeroen Schot <schot@A-Eskwadraat.nl>.
8636
2011-09-21 Arnold D. Robbins <arnold@skeeve.com>
8638
* dfa.c, mbsupport.h: Sync with GNU grep. Large amount of changes
8639
that remove many ifdefs, moving many conditions for multibyte
8640
support into regular C code and relying GCC's dead code optimization
8641
to eliminate code that won't be needed.
8642
* dfa.c: For gawk, add a number of additional defines so that things
8643
will compile if MBS_SUPPORT is 0.
8644
* array.c, awk.h, awkgram.y, builtin.c, eval.c, field.c, main.c,
8645
node.c, re.c: Change `#ifdef MBS_SUPPORT' to `#if MBS_SUPPORT'.
8646
* awk.h, regex_internal.h: Move NO_MBSUPPORT handling to ...
8647
* mbsupport.h: ...here.
8649
2011-09-16 Arnold D. Robbins <arnold@skeeve.com>
8651
* dfa.c: Sync with GNU grep.
8653
2011-09-08 John Haque <j.eh@mchsi.com>
8655
Optimization for compound assignment, increment and
8656
decrement operators; Avoid unref and make_number calls
8657
when there is no extra references to the value NODE.
8659
2011-09-03 Arnold D. Robbins <arnold@skeeve.com>
8661
* dfa.c: Sync with GNU grep.
8663
2011-08-31 John Haque <j.eh@mchsi.com>
8665
Grammar related changes: Simplify grammar for user-defined
8666
functions and general cleanups.
8668
* symbol.c: New file.
8669
* awkgram.y: Move symbol table related routines to the
8671
(rule, func_name, function_prologue, param_list): Reworked.
8672
(install_function, check_params): Do all error checks
8673
for the function name and parameters before installing in
8675
(mk_function): Finalize function definition.
8676
(func_install, append_param, dup_params): Nuked.
8677
* symbol.c (make_params): allocate function parameter nodes
8678
for the symbol table. Use the hash node as Node_param_list;
8679
Saves a NODE for each parameter.
8680
(install_params): Install function parameters into the symbol
8682
(remove_params): Remove parameters out of the symbol table.
8683
* awk.h (parmlist, FUNC): Nuked.
8684
(fparms): New define.
8686
Dynamically loaded function parameters are now handled like
8687
those for a builtin.
8689
* awk.h (Node_ext_func, Op_ext_builtin): New types.
8690
(Op_ext_func): Nuked.
8691
* ext.c (make_builtin): Simplified.
8692
(get_curfunc_arg_count): Nuked; Use the argument 'nargs' of
8693
the extension function instead.
8694
(get_argument, get_actual_argument): Adjust.
8695
* eval.c (r_interpret): Update case Op_func_call for a dynamic
8696
extension function. Handle the new opcode Op_ext_builtin.
8697
* pprint (profile.c): Adjust.
8699
Use a single variable to process gawk options.
8701
* awk.h (do_flags): New variable.
8702
(DO_LINT_INVALID, DO_LINT_ALL, DO_LINT_OLD, DO_TRADITIONAL,
8703
DO_POSIX, DO_INTL, DO_NON_DEC_DATA, DO_INTERVALS,
8704
DO_PROFILING, DO_DUMP_VARS, DO_TIDY_MEM,
8705
DO_SANDBOX): New defines.
8706
(do_traditional, do_posix, do_intervals, do_intl,
8707
do_non_decimal_data, do_profiling, do_dump_vars,
8708
do_tidy_mem, do_sandbox, do_lint,
8709
do_lint_old): Defined as macros.
8710
* main.c: Remove definitions of the do_XX variables. Add
8711
do_flags definition.
8712
* debug.c (execute_code, do_eval, parse_condition): Save
8713
do_flags before executing/parsing and restore afterwards.
8715
Nuke PERM flag. Always increment/decrement the reference
8716
count for a Node_val. Simplifies macros and avoids
8717
occasional memory leaks, specially in the debugger.
8719
* awk.h (UPREF, DEREF, dupnode, unref): Simplified.
8721
* (*.c): Increment the reference count of Nnull_string before
8722
assigning as a value.
8724
Revamped array handling mechanism for more speed and
8725
less memory consumption.
8727
* awk.h (union bucket_item, BUCKET): New definitions. Used as
8728
bucket elements for the hash table implementations of arrays;
8729
40% space saving in 32 bit x86.
8730
(buckets, nodes, array_funcs, array_base, array_capacity,
8731
xarray, alookup, aexists, aclear, aremove, alist,
8732
acopy, adump, NUM_AFUNCS): New defines.
8733
(array_empty): New macro to test for an empty array.
8734
(assoc_lookup, in_array): Defined as macros.
8735
(enum assoc_list_flags): New declaration.
8736
(Node_ahash, NUMIND): Nuked.
8737
* eval.c (r_interpret): Adjust cases Op_subscript,
8738
Op_subscript_lhs, Op_store_var and Op_arrayfor_incr.
8739
* node.c (dupnode, unref): Removed code related to Node_ahash.
8740
* str_array.c: New file to handle array with string indices.
8741
* int_array.c: New file to handle array with integer indices.
8742
* cint_array.c: New file. Special handling of arrays with
8743
(mostly) consecutive integer indices.
8745
Memory pool management reworked to handle NODE and BUCKET.
8747
* awk.h (struct block_item, BLOCK, block_id): New definitions.
8748
(getblock, freeblock): New macros.
8749
(getbucket, freebucket): New macros to allocate and deallocate
8751
(getnode, freenode): Adjusted.
8752
* node.c (more_nodes): Nuked.
8753
(more_blocks): New routine to allocate blocks of memory.
8755
2011-08-24 Arnold D. Robbins <arnold@skeeve.com>
8757
Fix pty co-process communication on Ubuntu GNU/Linux.
8759
* io.c: Add include of <sys/ioctl.h> to get definition of TIOCSCTTY.
8760
(two_way_open): Move call for this ioctl to after setsid() call.
8762
2011-08-23 Arnold D. Robbins <arnold@skeeve.com>
8764
* regex_internal.c (re_string_fetch_byte_case): Remove
8765
__attribute((pure)) since it causes failures with gcc -O2
8766
-fno-inline. Thanks to Neil Cahill <ncahill_alt@yahoo.com>
8767
for reporting the bug.
8769
2011-08-10 John Haque <j.eh@mchsi.com>
8771
BEGINFILE/ENDFILE related code redone.
8773
* awk.h (prev_frame_size, has_endfile, target_get_record,
8774
target_newfile): New defines.
8775
* awkgram.y (mk_program): Initialize has_endfile appropriately for
8777
(parse_program): Initialize new jump targets for
8778
Op_get_record and Op_newfile.
8779
* eval.c (unwind_stack): Change argument to number of
8780
items to be left in the stack. Adjust code.
8781
(pop_fcall, pop_stack): New defines.
8782
(setup_frame): Initialize prev_frame_size.
8783
(exec_state, EXEC_STATE): New structure and typedef.
8784
(exec_state_stack): New variable.
8785
(push_exec_state, pop_exec_state): New functions to save and
8786
later retrieve an execution state.
8787
(r_interpret): Use the new functions and the defines in
8788
cases Op_K_getline, Op_after_beginfile, Op_after_endfile,
8789
Op_newfile and Op_K_exit.
8790
* io.c (after_beginfile): When skipping a file using nextfile,
8791
return zero in case there was an error opening the file.
8792
(has_endfile): Nuke global variable.
8793
(inrec): Add a second argument to pass errno to the calling
8795
* debug.c (print_instruction): Update cases.
8797
2011-08-10 Arnold D. Robbins <arnold@skeeve.com>
8799
Fix (apparently long-standing) problem with FIELDWIDTHS.
8800
Thanks to Johannes Meixner <jsmeix@suse.de>.
8802
* field.c (set_FIELDWIDTHS): Adjust calculations.
8804
Fix problem with FPAT, reported by "T. X. G." <leopardie333@yahoo.com>
8806
* awk.h (Regexp): Add new member 'non_empty'.
8807
* field.c (fpat_parse_field): Save/restore local variable non_empty
8808
from member in Regexp struct.
8810
2011-08-09 Arnold D. Robbins <arnold@skeeve.com>
8812
Fix pty issue reported by "T. X. G." <leopardie333@yahoo.com>
8814
* configure.ac: Check for setsid.
8815
* awk.h: If not HAVE_SETSID define it as an empty macro.
8816
* io.c (two_way_open): Call setsid if using pty's.
8818
2011-07-29 Eli Zaretskii <eliz@gnu.org>
8820
* builtin.c (format_tree): Rename small -> small_flag,
8821
big -> big_flag, bigbig -> bigbig_flag. Solves compilation errors
8822
when building Gawk with libsigsegv on MS-Windows, see
8823
https://lists.gnu.org/archive/html/bug-gawk/2011-07/msg00029.html.
8825
2011-07-28 Arnold D. Robbins <arnold@skeeve.com>
8827
* builtin.c (do_sub): Revert to gawk 3.1 behavior for backslash
8828
handling. It was stupid to think I could break compatibility.
8829
Thanks to John Ellson <ellson@research.att.com> for raising
8832
2011-07-26 John Haque <j.eh@mchsi.com>
8834
* eval.c (r_interpret): In cases Op_var_assign and Op_field_assign,
8835
include Op_K_getline_redir in the test for skipping the routine.
8837
2011-07-26 John Haque <j.eh@mchsi.com>
8839
Fix handling of assign routines for 'getline var'.
8840
Rework the previous fix for (g)sub.
8842
* awk.h: New define assign_ctxt for use in Op_var_assign
8843
and Op_field_assign opcodes. Remove define AFTER_ASSIGN.
8844
* awkgram.y (snode, mk_getline): Initialize assign_ctxt.
8845
* builtin.c (do_sub): Adjust to take only the first two
8847
* eval.c (r_interpret): In cases Op_var_assign and Op_field_assign,
8848
skip the routine as appropriate. Adjust case Op_sub_builtin.
8849
* main.c (get_spec_varname): New function.
8850
* debug.c (print_instruction): Use the new function to get
8851
special variable name.
8853
2011-07-17 Arnold D. Robbins <arnold@skeeve.com>
8855
* main.c (varinit): Mark FPAT as NON_STANDARD. Thanks to
8856
Wolfgang Seeberg <wolfgang.seeberg@yahoo.com> for the report.
8857
* Makefile.am (EXTRA_DIST): Add po/README, per advice from
8859
* dfa.c: Sync with GNU grep.
8860
* xalloc.h (xzalloc): New function, from GNU grep, for dfa.c.
8861
* README: Note that bug list is really a real mailing list.
8863
2011-07-16 Arnold D. Robbins <arnold@skeeve.com>
8865
* Makefile.am (AUTOMAKE_OPTIONS): Removed.
8866
* configure.ac (AM_INIT_AUTOMAKE): Removed dist-bzip2 option, on
8867
advice from Karl Berry.
8869
2011-07-15 John Haque <j.eh@mchsi.com>
8871
* awk.h (Op_sub_builtin): New opcode.
8872
(GSUB, GENSUB, AFTER_ASSIGN, LITERAL): New flags for
8874
* awkgram.y (struct tokentab): Change opcode to Op_sub_builtin
8875
for sub, gsub and gensub.
8876
(snode): Update processing of sub, gsub and gensub.
8877
* builtin.c (do_sub, do_gsub, do_gensub): Nuke.
8878
(sub_common): Renamed to do_sub. Relocate gensub argument
8879
handling code from do_gensub to here; Simplify the code a
8881
* eval.c (r_interpret): Handle Op_sub_builtin. Avoid field
8882
re-splitting or $0 rebuilding if (g)sub target string is
8883
a field and no substitutions were done.
8884
* pprint (profile.c): Add case for the new opcode.
8885
* print_instruction (debug.c): Ditto.
8887
Take out translation for errno strings; extensions will
8888
need to use their own domain.
8890
* awk.h (enum errno_translate): Removed.
8891
(update_ERRNO_string): Remove second translate parameter.
8892
* eval.c (update_ERRNO_string): Remove second translate parameter
8893
and code that used it.
8894
* gawkapi.h (api_update_ERRNO_string): Remove third translate
8896
* gawkapi.c (api_update_ERRNO_string): Remove third translate
8897
parameter and change call to update_ERRNO_string.
8898
* io.c (do_close): Fix call to update_ERRNO_string.
8900
2011-07-15 Arnold D. Robbins <arnold@skeeve.com>
8902
* awk.h: Typo fix: "loner" --> longer. Thanks to Nelson Beebe.
8903
* builtin.c (efwrite): Fix flushing test back to what it was
8904
in 3.1.8. Thanks to Strefil <strefil@yandex.ru> for the problem
8906
* configure.ac: Bump version to 4.0.0a for stable branch.
8908
2011-06-24 Arnold D. Robbins <arnold@skeeve.com>
8910
* Makefile.am (EXTRA_DIST): Add ChangeLog.0.
8911
* 4.0.0: Remake the tar ball.
8913
2011-06-23 Arnold D. Robbins <arnold@skeeve.com>
8915
* configure.ac: Update version to 4.0.0.
8916
* configure: Regenerated.
8917
* ChangeLog.0: Rotated ChangeLog into this file.
8918
* ChangeLog: Created anew for gawk 4.0.0 and on.
8919
* README: Bump version to 4.0.0.
8920
* 4.0.0: Release tar ball made.