1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
|
2020-12-19 Arnold D. Robbins <arnold@skeeve.com>
First steps fixing +inform, +nancy. Sigh.
* awk.h (is_ieee_magic_val): Add declaration.
* node.c (is_ieee_magic_val): Make extern, not static.
(r_force_number): Make the check smarter, catch -nan.
2020-11-02 Arnold D. Robbins <arnold@skeeve.com>
* re.c (make_regexp): Cast len parameter to int to avoid
compiler warnings.
2020-10-31 Arnold D. Robbins <arnold@skeeve.com>
* re.c (make_regexp): When re_compile_pattern fails, use the
original text of the regexp in the error message. Thanks to Neil
R. Ormos <ormos-gnulists17@ormos.org> for the report.
2020-10-29 Arnold D. Robbins <arnold@skeeve.com>
* eval.c (setup_frame): Handle the case of values from FUNCTAB.
Thanks to Denis Shirokov <cosmogen@gmail.com> for the report.
2020-10-12 Arnold D. Robbins <arnold@skeeve.com>
* gawkapi.c (api_lintwarn): Fix comparison, should be to check
lintfunc, not lintwarn. Thanks to OLLIER Jean-François
<lalanne.51@wanadoo.fr>, reported 23 March, 2014.
2020-10-11 Arnold D. Robbins <arnold@skeeve.com>
* re.c (make_regexp): Add {} to characters that cause rp->maybe_long
to be true.
* io.c (rsrescan): Update comment for step 4.
2020-09-21 Arnold D. Robbins <arnold@skeeve.com>
* awk.h (enum redirect_flags): Add RED_NONE.
(redirect_flags_t): New typedef.
* io.c (redflags2str): Handle RED_NONE.
(check_duplicated_redirections): New function.
(redirect_string): Use new typedef. Call new function if do_lint
instead of using inline code.
(close_redir): Add error message for failure on close of two-way pipe.
2020-09-04 Arnold D. Robbins <arnold@skeeve.com>
* awkgram.y [GRAMMAR]: Install arrays as Node_var_array. Improves
PROCINFO["identifiers"]. Thanks to anoncoward@nym.hush.com
for the report.
2020-08-25 Arnold D. Robbins <arnold@skeeve.com>
* interpret.h (r_interpret): At Op_rule, check if in BEGINFILE. If so,
clear the record. Fixes an issue reported by Pat Rankin in May, 2011.
2020-08-24 Arnold D. Robbins <arnold@skeeve.com>
* awkgram.y, builtin.c, command.y, debug.c, gawkapi.c,
io.c, node.c: Make all messages consistent: Remove final periods
from messages that had them.
* TODO: Updated.
2020-08-20 Arnold D. Robbins <arnold@skeeve.com>
* awk.h (NODE): Move valref completely out of the union. Fixes
core dumps on old GCC on CentOS 7.
2020-08-13 Arnold D. Robbins <arnold@skeeve.com>
Fix TIDYMEM / use of mtrace.
* configure.ac: Add mtrace to list of functions searched for.
* symbol.c (make_symbol): Set valref to 1. Allows the
release_all_vars function to work.
Unrelated:
* array.c (value_info): Spell ROUNDMODE correctly in output.
* mpfr.c (set_ROUNDMODE): Ditto.
2020-08-12 Arnold D. Robbins <arnold@skeeve.com>
* awkgram.c, command.c: Regenerated with Bison 3.7.1.
* NEWS: Updated.
Unrelated:
* profile.c (pp_namespace): Always print a newline before the
@namespace, in case it comes after a comment. Thanks to J Naman
for the report.
* symbol.c (comp_symbol): Adjust comparison so that names in the
awk namespace come out first. Makes the order of functions in
pretty-printed output more sane. Thanks also to J Naman for
getting me to explore this issue.
2020-07-29 Arnold D. Robbins <arnold@skeeve.com>
* custom.h (FLEXIBLE_ARRAY_MEMBER): Define to 1 for dfa.h.
2020-07-28 Arnold D. Robbins <arnold@skeeve.com>
Eliminate 'iszero: redefined' warning from tcc.
* awk.h (is_zero): Renamed from `iszero'.
(boolval): Update usage.
* awkgram.y [GRAMMAR]: Ditto.
(negate_num): Ditto.
* debug.c (condition_triggered): Ditto.
* eval.c (set_LINT): Ditto.
2020-07-26 Arnold D. Robbins <arnold@skeeve.com>
* awkgram.c, command.c: Regenerated with Bison 3.7.
* NEWS: Updated.
Unrelated:
* gawkapi.h (api_get_mpfr, api_get_mpz): Mark as obsolete.
2020-07-22 Arnold D. Robbins <arnold@skeeve.com>
* Makefile.in: Regenerated.
2020-07-21 Arnold D. Robbins <arnold@skeeve.com>
* configure.ac (AM_INIT_AUTOMAKE): Update to 1.16.
* ar-lib, compile, config.guess, config.rpath, config.sub,
depcomp, install-sh, missing, ylwrap: Moved to build-aux.
2020-07-20 gettextize <bug-gnu-gettext@gnu.org>
* configure.ac (AM_GNU_GETTEXT_VERSION): Bump to 0.20.2.
2020-07-19 Arnold D. Robbins <arnold@skeeve.com>
* NEWS: Fix title on leading set of changes. Thanks to
Marcus <marcuscruse@ya.ru> for the report.
Unrelated: Bump minor API version since semantics have changed.
* gawkapi.h (api_minor_version): Increase to 1.
Unrelated: Fix a spelling error in a comment.
* mpfr.c (force_mpnum): Fix a typo.
2020-07-17 Arnold D. Robbins <arnold@skeeve.com>
* gawkapi.h (gawk_api_minor_version): Increase, since the
MPFR/MPZ stuff changed some. Remains source and binary
compatible, but semantics are different.
2020-07-15 Arnold D. Robbins <arnold@skeeve.com>
Finish cleaning up MPFR valgrind issues.
* awk.h (struct block_header): Remove MPFR and GMP enums.
* gawkapi.c (getmpfr, freempfr, getmpz, freempz): Removed
(api_get_mpfr): Use emalloc instead of getmpfr.
(api_get_mpz): Use emalloc instead of getmpz.
* gawkapi.h: Add comments on MPFR and MPZ
(make_number_mpfr, make_number_mpz): Update comments.
* node.c (nextfree): Remove mpfr and mpz entries.
* NEWS: Updated.
Unrelated:
* config.guess, config.sub: Updated from GNULIB.
2020-07-13 Arnold D. Robbins <arnold@skeeve.com>
* mpfr.c (mpg_interpret): Small speedup. If do_itrace and opcode is
not one that's handled, return early.
2020-07-12 Arnold D. Robbins <arnold@skeeve.com>
* mpfr.c (mpg_interpret): Make the instruction tracing more sane.
Fix the testext test for MPFR.
* gawkapi.c (awk_value_to_node): Use correct code to copy
MPFR/MPN numbers and don't free the original values.
* interpret.h (r_interpret): At Op_ext_builtin, separate out calls
to the external function and awk_value_to_node, for ease in a
debugger.
* NEWS: Updated.
2020-07-10 Arnold D. Robbins <arnold@skeeve.com>
Fix printf issues. Thanks to Michal Jaegermann for the report.
* cint_array.c (cint_dump): Fix printf formats.
* debug.c (print_symbol): Ditto.
* mpfr.c (mpg_interpret): Ditto.
2020-07-09 Arnold D. Robbins <arnold@skeeve.com>
Fix dbugeval2 test for MPFR.
* debug.c (do_eval): Preserve DO_MPFR flag in do_flags before
parsing the string to be evaluated.
Fix indirect call tests for MPFR:
* awkgram.y (lookup_builtin): Only return the MPFR builtin
function if the pointer is not NULL.
Unrelated:
* config.guess, config.sub: Updated from GNULIB.
2020-07-08 Arnold D. Robbins <arnold@skeeve.com>
* str_array.c (str_lookup): If a pure number, copy to a string. Fixes
the printfchar test for MPFR.
Fix typeregex2 and typedregex3 tests for MPFR:
* mpfr.c (mpg_zero): No longer static inline.
(force_mpnum): Handle the case of a strongly typed regex.
(mpg_interpret): Add tracing for do_itrace.
* awk.h (mpg_zero): Add declaration.
* node.c (make_typed_regex): Init to zero for MPFR via mpg_zero.
2020-07-07 Arnold D. Robbins <arnold@skeeve.com>
* awk.h: Turn all the flag defines into enums. GDB can then show
the bit maps directly.
Unrelated: Fix another MPFR bug, reported by Hyunho Cho
<mug896@naver.com>.
* mpfr.c (force_mpnum): Restore the character at the end of
the string if only saw + or -.
2020-07-07 Andrew J. Schorr <aschorr@telemetry-investments.com>
* node.c (r_dupnode): Sanitize the code, particularly for MPFR.
2020-07-05 Arnold D. Robbins <arnold@skeeve.com>
Bug fixes in MPFR, reported by Hyunho Cho<mug896@naver.com>.
* node.c (r_dupnode): Set strndmode and also set stlen of new
string. (How did that one get by us for so long?)
* mpfr.c (force_mpnum): Check for a + or - sign with nothing following it.
Unrelated. Make do_itrace a real variable so that it's easier to
change the value from a debugger.
* awk.h (do_itrace): Declare.
(DO_ITRACE, do_itrace): Remove macros.
* main.c (do_itrace): Define.
(parse_args): Set do_itrace.
2020-07-03 Arnold D. Robbins <arnold@skeeve.com>
Fix a double free error with -M. Thanks to
"NIDE, Naoyuki" <nide@ics.nara-wu.ac.jp> for the report.
* field.c (clear_mpfr): New macro, clears MPFR and NUMCUR bits.
(reset_record): Use it on the newly copied field values.
(purge_record): Add introductory comment since we're in the file.
2020-07-01 Arnold D. Robbins <arnold@skeeve.com>
* eval.c (posix_compare): Rewrite contributed by
Michael Builov <mbuilov@gmail.com>.
Unrelated:
* awk.h: New option: do_itrace.
* interpret.h (r_interpret): Print instruction trace if enabled.
* main.c (optab): New option: -I/--trace.
(parse_args): Update optlist and the code to handle it.
* NEWS: Updated.
2020-06-29 Arnold D. Robbins <arnold@skeeve.com>
* debug.c: Cleanup messages. Error messages start with lower
case letter.
* TODO: Updated.
2020-06-14 Arnold D. Robbins <arnold@skeeve.com>
Disallow SYMTAB and FUNCTAB as destination arguments to builtin
functions that clear arrays:
* awk.h (check_symtab_functab): Add declaration.
* array.c (asort_actual): Call it in check for second argument.
* builtin.c (check_symtab_functab): New function.
(do_match): Call it in check for third argument.
* field.c (do_patsplit, do_split): Call it in checks for fourth and
second arguments.
2020-06-12 Arnold D. Robbins <arnold@skeeve.com>
* array.c (asort_actual): If SYMTAB or FUNCTAB is the second argument,
fatal out. If they are the first argument, make it work when a
second argument is supplied.
* TODO, NEWS: Updated.
2020-06-10 Arnold D. Robbins <arnold@skeeve.com>
More miscellaneous fixes from Michael Builov <mbuilov@gmail.com>.
* node.c (r_unref): Handle GAWKDEBUG same as in awk.h:unref.
(parse_escape): isxdigit/isdigit/isupper called with possible negative
int: fixed. Dead code under "if (do_lint && j > 2)" eliminated,
j cannot be > 2.
(init_btowc_cache): Also initialize wide-char at index 255.
And so that `make check' passes with GAWKDEBUG defined:
* msg.c (err): Remvoe abort() call if fatal. Didn't really do
anything special for us.
2020-06-10 Arnold D. Robbins <arnold@skeeve.com>
* awkgram.c, command.c: Regenerated with bison 3.6.3.
* NEWS: Updated.
2020-06-10 Andrew J. Schorr <aschorr@telemetry-investments.com>
Convert exec_count from long long to unsigned long long.
* awk.h (INSTRUCTION): Change ldl type from long long to unsigned
long long.
* debug.c (print_instruction): Fix printf format for exec_count.
* profile.c (indent): The argument is now an unsigned long long,
and fix the printf format to match.
2020-06-10 Arnold D. Robbins <arnold@skeeve.com>
Miscellaneous fixes from Michael Builov <mbuilov@gmail.com>.
* awkgram.y (rule_block): Fix size declaration
(parse_program): Adjust memset call.
(get_comment): Check for end of file before checking for space.
* io.c (gawk_popen): Move os_close_on_exec call inside #endif.
* builtin.c (do_bindtextdomain): Don't pass NULL to strlen.
* debug.c (set_breakpoint): Don't dereference NULL pointer in D_func.
(serialize_list): Get the buffer management right to avoid overrun.
2020-06-10 Arnold D. Robbins <arnold@skeeve.com>
Thanks to Andrew Schorr for suggesting a better way to
handle exec_count being a long long.
* awk.h (INSTRUCTION): Make new ldl member be the long long.
(exec_count): Is now ldl.
* profile.c (pprint): Fix printf of exec_count.
2020-06-09 Arnold D. Robbins <arnold@skeeve.com>
* awkgram.y (tokexpand): Use size_t instead of int for size of
buffer.
2020-06-08 Arnold D. Robbins <arnold@skeeve.com>
* awkgram.y: Fix `print $"2"' case. Thanks to Ed Morton
Morton <mortoneccc@comcast.net> for the report.
Unrelated:
* awk.h (INSTRUCTION): Make dl a long long for profiling
counts on 32 bit systems. Thanks to Peter Lindgren
for the report.
* profile.c (indent): Take a long long parameter and fix
the printf format.
2020-06-05 Arnold D. Robbins <arnold@skeeve.com>
* awkgram.y: Allow @/foo/ as return expression in a function.
Oops.
2020-06-05 Arnold D. Robbins <arnold@skeeve.com>
* configure.ac: Add call to AM_PROG_AR for use in
cross compiles. Thanks to Sergei Trofimovich <slyfox@gentoo.org>
for the patch.
2020-05-15 Arnold D. Robbins <arnold@skeeve.com>
* config.guess, config.sub: Updated from GNULIB.
2020-05-14 Arnold D. Robbins <arnold@skeeve.com>
* awkgram.c, command.c: Rebuild with Bison 3.6.
* NEWS: Updated.
2020-05-06 Arnold D. Robbins <arnold@skeeve.com>
Add lint check for string + string. It's not concatenation
in awk, but is in most other languages. Thanks to Roland Illig
<roland.illig@gmx.de> for the suggestion.
* awk.h (Op_lint_plus): New opcode.
* awkgram.y (mk_binary): Add it into the list in the right place
if do_lint.
* eval.c (optypes): Add case for Op_lint_plus.
* interpret.h (r_interpret): Ditto.
2020-04-14 Arnold D. Robbins <arnold@skeeve.com>
* 5.1.0: Release tar ball made.
2020-04-10 Arnold D. Robbins <arnold@skeeve.com>
* field.c (save_FPAT): New global variable.
(get_field): Check if using FPAT or not in order to pass in
the right variables to parse_field function. Fixes bug in
delayed field parsing when using FPAT. Thanks to
luciole75w <luciole75w@gmail.com> for the bug report.
(set_FPAT): Use global save_FPAT instead of local save_fpat.
Unrelated:
* awkgram.c, command.c: Rebuild with Bison 3.5.4.
* NEWS: Updated.
Unrelated:
* awk.h (do_lint_extensions): Define to zero if NO_LINT.
2020-04-02 Arnold D. Robbins <arnold@skeeve.com>
* field.c (re_parse_field): If default parsing and trailing
whitespace, don't set a null field at the end. Thanks to
Ed Morton <mortoneccc@comcast.net> for the report.
2020-03-18 Arnold D. Robbins <arnold@skeeve.com>
* TODO: Add more stuff.
2020-03-15 Arnold D. Robbins <arnold@skeeve.com>
* Makefile.am (zos-diffout): New target.
* awkgram.y, command.y: Upgrade to Bison 3.5.3.
* NEWS: Updated.
2020-03-11 Arnold D. Robbins <arnold@skeeve.com>
* main.c: Further message update. Thanks again to
Roland Illig <roland.illig@gmx.de>.
2020-03-09 Andrew J. Schorr <aschorr@telemetry-investments.com>
* array.c (sort_up_value_string): If either arg is not a Node_val,
call out to sort_up_value_type instead. If cmp_strings returns zero,
fall back to sort_up_index_string as a tie-breaker.
(sort_up_value_number): If either arg is not a Node_val, call out to
sort_up_value_type instead. If cmp_strings returns zero, fall back
to sort_up_index_string as a tie-breaker.
(do_sort_up_value_type): Renamed from sort_up_value_type with one
change: if both arguments have type Node_var, we compare the
var_value NODEs instead.
(sort_up_value_type): New wrapper function around do_sort_up_value_type
to fall back to sort_up_index_string as a tie-breaker.
2020-03-09 Arnold D. Robbins <arnold@skeeve.com>
* array.c, awk.h, awkgram.y, builtin.c, command.y, debug.c,
ext.c, int_array.c, io.c, main.c, symbol.c: Messages refined
based on suggestions from Roland Illig <roland.illig@gmx.de>.
2020-03-06 Jannick <thirdedition@gmx.net>
* Makefile.am: Replace AM_MAKEFLAGS with AM_CFLAGS and AM_LDFLAGS.
Put pc/Makefile.tst into BUILT_SOURCES, instead of in dist-hook.
Add $(srcdir) to rules for the yacc files. Use AM_LDFLAGS in
the efence rule.
* configure.ac: Use GAWK_CANONICAL_HOST instead of AC_CANONICAL_HOST;
this supplies MSYS2 support. Remove use of EXEEXT.
2020-03-04 Arnold D. Robbins <arnold@skeeve.com>
* NEWS: Updated.
2020-02-13 John E. Malmberg <wb8tyw@qsl.net>
* custom.h: OpenVMS needs _REGEX_INCLUDE_LIMITS_H defined.
2020-02-09 Arnold D. Robbins <arnold@skeeve.com>
* awkgram.y: Add lint check for assignment in condition to
if and for statements. Thanks to Jannick <thirdedition@gmx.net>
for the suggestion.
* debug.c (do_eval): Remove @eval from the symbol table if there
was a syntax error in the statement being evaluated. Thanks again
to Jannick, for the report.
2020-02-04 John E. Malmberg <wb8tyw@qsl.net>
* custom.h: Fix OpenVMS SIZE_MAX value.
2020-02-01 Arnold D. Robbins <arnold@skeeve.com>
* awk.h, dfa.c: Move include of mbsupport.h to ...
* custom.h: ... here.
* configure.ac: Add check for isblank.
2020-01-27 Arnold D. Robbins <arnold@skeeve.com>
* custom.h: Fix non-VMS compilation.
2020-01-26 John E. Malmberg <wb8tyw@qsl.net>
* custom.h: Additional OpenVMS typedefs needed.
* getext.h: Fix macro for implementations without gettext
to not force the result to be a const char *.
2020-01-26 Andrew J. Schorr <aschorr@telemetry-investments.com>
* array.c (sort_up_value_type): Small efficiency tweak. Only
run through the list of other types if both values are not scalars.
2020-01-24 Arnold D. Robbins <arnold@skeeve.com>
* array.c, profile.c, cint_array.c, builtin.c, interpret.h,
main.c: Update copyright years.
2020-01-23 Arnold D. Robbins <arnold@skeeve.com>
* array.c (sort_up_value_type): Handle other types of nodes,
in case someone applies PROCINFO["sorted_in"] to SYMTAB or
FUNCTAB. This threw an assertion error if assertions were
enabled. Thanks to John Namam <Gawer@703n.com> for the report.
(asort_actual): Disallow SYMTAB and FUNCTAB as first arguments.
* TODO: Note that we should should eventually allow SYMTAB/FUNCTAB
passed to asort/asaorti if a destination array is provided. (The
current code breaks right now.)
2020-01-19 Arnold D. Robbins <arnold@skeeve.com>
* profile.c (pp_top): New macro.
(pprint): Be smarter for print[f] with redirection that was
parenthesized, to not print `printf(("hello\n")) > "..."'.
Unrelated:
* compile, config.guess, config.rpath, config.sub, depcomp: Updated
from GNULIB.
2020-01-14 Andrew J. Schorr <aschorr@telemetry-investments.com>
* cint_array.c (cint_array_init): Fix off-by-one error in array
bounds overflow check for an NHAT value set in the environment.
Thanks to Michael Builov <mbuilov@gmail.com> for the report.
2020-01-08 Arnold D. Robbins <arnold@skeeve.com>
Fix a number of subtle memory leaks. Thanks to the
combination of MEMDEBUG and valgrind for finding them.
* builtin.c (do_print): Unref tmp if force_string_ofmt
returned something different.
(call_sub, call_match, call_split_func): Free any
created regexp.
* debug.c (do_eval): Free the node holding the @eval function
when done with it.
* field.c (init_fields): Create fields_arr[0] and Nnull_field
in a rational fashion.
* interpret.h (Op_assign_concat): Handle newly created node
better.
Unrelated:
* interpret.h (Op_subscript): When retrieving from SYMTAB, check
for Node_var_new; variables can exist but have not been assigned
a value. Thanks to Denis Shirokov <cosmogen@gmail.com> for the report.
Unrelated:
* builtin.c (do_typeof): Handle Node_array_ref also. Thanks to
Denis Shirokov <cosmogen@gmail.com> for the report.
2019-12-22 Arnold D. Robbins <arnold@skeeve.com>
* config.guess: Updated from GNULIB.
2019-12-22 Jannick <thirdedition@gmx.net>
* configure.ac: Hardcode the shared object extension to dll
on Windows platforms, i.e.whenever EXEEXT is '.exe'.
2019-12-22 Arnold D. Robbins <arnold@skeeve.com>
* gettext.h: Update from gettext 0.20.1.
* NEWS: Updated.
2019-12-18 Paul Eggert <eggert@Penguin.CS.UCLA.EDU>
Fix memcpy issue found by -fsanitize=undefined
* field.c (set_record): Don't memcpy (databuf, NULL, 0),
as the C standard says the resulting behavior is undefined.
2019-12-16 Arnold D. Robbins <arnold@skeeve.com>
* awkgram.y, command.y: Upgrade to Bison 3.5.
* NEWS: Updated.
2019-11-21 Arnold D. Robbins <arnold@skeeve.com>
* config.rpath: Update from GNULIB.
2019-11-10 Arnold D. Robbins <arnold@skeeve.com>
* compile, config.rpath: Update from GNULIB. Adds msys support.
2019-11-03 Arnold D. Robbins <arnold@skeeve.com>
* field.c (get_field): Remove special case code for fpat_parse_field.
Fixes a bug reported by Ed Morton <mortoneccc@comcast.net>.
2019-10-19 Arnold D. Robbins <arnold@skeeve.com>
* compile, depcomp: Update from GNULIB.
2019-10-13 Arnold D. Robbins <arnold@skeeve.com>
Fix handling of assigning @/.../ to FS and RS. Thanks
to Stephane Chazelas <stephane.chazelas@gmail.com>
for the report.
* field.c (set_FS): Check for REGEX in the flags.
* io.c (set_RS): Ditto.
2019-10-04 Arnold D. Robbins <arnold@skeeve.com>
* config.guess, config.sub, install-sh: Updated from GNULIB.
2019-09-30 John E. Malmberg <wb8tyw@qsl.net>
* custom.h: OpenVMS does not provide ULLONG_MAX
2019-09-20 Florian Weimer <fweimer@redhat.com>
* configure.ac (PRINTF_HAS_F_FORMAT): Include <string.h> for
strcmp.
(PRINTF_HAS_A_FORMAT): Likewise.
* configure: Regenerate.
2019-09-17 Arnold D. Robbins <arnold@skeeve.com>
* awkgram.y, commands.y: Upgrade to Bison 3.4.2.
* NEWS: Updated.
2019-09-10 Andrew J. Schorr <aschorr@telemetry-investments.com>
* awk.h (block_header): Remove cnt field and replace it with
highwater. If MEMDEBUG is defined, add active counter.
* node.c (r_getblock): The cnt field was replaced by active. Update
highwater as appropriate.
(r_freeblock): Decrement the active counter (renamed from cnt).
(more_blocks): Bump the highwater counter (renamed from cnt).
* builtin.c (do_typeof): When providing PROCINFO debug memory stats,
replace count_<blah> with <blah>_active and <blah>_highwater. When
MEMDEBUG is not set, we calculate the active value by subtracting the
number of elements in the free list from the highwater value.
2019-09-01 Arnold D. Robbins <arnold@skeeve.com>
* profile.c (pp_list, pp_concat): Fix use-after-free errors
in both routines. Thanks to valgrind and Andy's MEMDEBUG code.
2019-09-01 Andrew J. Schorr <aschorr@telemetry-investments.com>
* awk.h (block_header): Add cnt field even when MEMDEBUG is not
defined, and add a name field.
* node.c (nextfree): Initialize new name field.
(more_blocks): Bump nextfree[id].cnt by BLOCKCHUNK.
* builtin.c (do_typeof): When the 1st argument is PROCINFO and the
2nd arg is provided, return new "count_<blah>" fields containing
the memory allocation accounts of the various block types.
2019-08-30 Andrew J. Schorr <aschorr@telemetry-investments.com>
* configure.ac (.developing): Add -DMEMDEBUG to CFLAGS.
* awk.h (block_header): If MEMDEBUG is defined, add cnt field
to track the number of allocations.
(getblock, freeblock): When MEMDEBUG is defined, replace these
macros with calls to new functions r_getblock and r_freeblock.
* node.c (r_getblock, r_freeblock): New functions that simply
use malloc and free when MEMDEBUG is defined.
2019-08-30 Andrew J. Schorr <aschorr@telemetry-investments.com>
* interpret.h (r_interpret): For Op_match_rec, unref if a
dynamic regexp. Fixes another memory issue. See the thread starting
at https://lists.gnu.org/archive/html/bug-gawk/2019-08/msg00023.html.
2019-08-29 Arnold D. Robbins <arnold@skeeve.com>
Restore a modified version of the change of
2016-05-03, which used realloc to shrink the buffer.
* builtin.c (format_tree): Reduce INITIAL_OUT_SIZE to 64.
At the end, call realloc only if there is more
than (2 * INITIAL_OUT_SIZE) bytes to give back.
2019-08-23 Arnold D. Robbins <arnold@skeeve.com>
* main.c (main): Fix whitespace issues.
* re.c (re_update): Small code cleanup in handling t->re_cnt.
Thanks to Andrew Schorr.
2019-08-21 Arnold D. Robbins <arnold@skeeve.com>
* config.guess: Updated from GNULIB.
2019-08-15 Arnold D. Robbins <arnold@skeeve.com>
Revert a6df7afc605079df7d85318846a522ef64aaa44d, change of
2016-05-03, which used realloc to shrink the buffer, in an
attempt to save memory. In actuality, it could cause increased
memory usage, even though there was no memory leak. See
https://lists.gnu.org/archive/html/bug-gawk/2019-08/msg00003.html
and the rest of thread for more detail.
* builtin.c (format_tree): Don't use realloc, just call
make_str_node with the original buffer. Remove `olen_final'
variable and its use.
2019-08-15 Andrew J. Schorr <aschorr@telemetry-investments.com>
Reduce memory usage by only compiling the IGNORECASE version of
regexp when it's actually needed.
* awkgram.y (make_regnode): Only compile the regular version.
* re.c (re_cache_get): New function.
(re_update): Use it as appropriate.
2019-07-23 Koichi Murase <myoga.murase@gmail.com>
* builtin.c (do_xor): Remove unneeded local variable `i'. Simplify
the loop's computation.
(do_and): Improve the initial value for the result.
2019-07-23 Andrew J. Schorr <aschorr@telemetry-investments.com>
Fix reporting of negative arguments for and(), or() and xor().
Thanks to Koichi Murase <myoga.murase@gmail.com> for the
report.
* builtin.c (do_and): Use nargs instead of i in the loop to
check for non-numeric and negative arguments.
(do_or): Ditto.
(do_xor): Ditto.
2019-07-23 Arnold D. Robbins <arnold@skeeve.com>
* Checklist: Updated.
2019-07-21 Arnold D. Robbins <arnold@skeeve.com>
* command.y, custom.h, eval.c, ext.c, field.c, io.c,
msg.c, node.c, nonposix.h, re.c: Update copyright year.
* NEWS: Updated.
* README: Updated.
2019-07-16 Arnold D. Robbins <arnold@skeeve.com>
* TODO: Updated.
* awkgram.y [GRAMMAR]: Change some lint warnings to use lintwarn.
(yylex): Ditto.
* field.c (choose_fs_function): Ditto.
* main.c (main): Ditto.
* node.c (parse_escape): Ditto.
2019-07-09 Arnold D. Robbins <arnold@skeeve.com>
* gawkapi.h: Update copyright year, fix some spelling errors.
2019-07-08 Andrew J. Schorr <aschorr@telemetry-investments.com>
2019-07-08 Andrew J. Schorr <aschorr@telemetry-investments.com>
* gawkapi.h (gawk_api_major_version): Bump from 2 to 3 because the
namespace changes altered the function signatures in gawk_api_t.
And add a comment at the top of the structure with a reminder that
the version number should be bumped whenever the struct is altered
in any way.
2019-06-30 Arnold D. Robbins <arnold@skeeve.com>
* interpret.h (r_interpret): Fix two more cases of warning
about gawk extensions.
* awkgram.y [GRAMMAR]: And two more cases here. Thanks to
Mark Krauze <daburashka@ya.ru> for making me look for them.
Unrelated:
* config.sub: Updated from GNULIB.
2019-06-26 Arnold D. Robbins <arnold@skeeve.com>
* symbol.c (install): Strip off any leading `awk::' before
installing a symbol. Thanks to Andrew Schorr for the
report.
2019-06-21 Arnold D. Robbins <arnold@skeeve.com>
* config.guess, config.sub: Updated from GNULIB.
* awkgram.y (get_src_buf): Set buffers to zero to avoid
possible issues with accessing uninitialized memory.
Thanks to valgrind, as pointed out by Nadezhda Vyukova
<qniva@yandex.ru>.
* NEWS, README.git: Fix some typos.
2019-06-19 Arnold D. Robbins <arnold@skeeve.com>
* re.c (make_regexp): If do_posix, have {} in ok_to_escape.
Thanks to Ed Morton <mortoneccc@comcast.net> for the report.
2019-06-18 Arnold D. Robbins <arnold@skeeve.com>
* 5.0.1: Release tar ball made.
2019-06-06 Arnold D. Robbins <arnold@skeeve.com>
* main.c (usage): Update comment for translators.
2019-06-02 Arnold D. Robbins <arnold@skeeve.com>
* awkgram.c, command.c: Update to Bison 3.4.
* NEWS: Updated.
2019-05-22 Arnold D. Robbins <arnold@skeeve.com>
Add --lint=no-ext. Suggest by Mark Krauze <daburashka@ya.ru>.
* NEWS: Updated.
* awk.h (DO_LINT_EXTENSIONS): New enum.
(do_lint_extensions): New macro.
* awkgram.y (yylex, snode): Use do_lint_extensions instead of
do_lint where appropriate.
* builtin.c (do_length): Ditto.
* eval.c (set_IGNORECASE, set_BINMODE): Ditto.
(set_LINT): Revise logic.
* field.c (do_split, set_FIELDWIDTHS, chose_fs_function, set_FPAT):
Ditto.
* io.c (set_RS): Ditto.
* main.c (usage): Updated.
(parse_args): Revise the code to handle --lint=no-ext.
2019-05-10 Arnold D. Robbins <arnold@skeeve.com>
* NEWS: Updated.
2019-05-06 Arnold D. Robbins <arnold@skeeve.com>
In sandbox mode, disallow assigning filenames that weren't
there initially. Thanks to Nolan Woods <nolan_w@sfu.ca> for
pointing out the gap.
* awk.h (init_argv_array): Add declaration.
* cint_array.c (argv_store): New vtable for ARGV.
(argv_shadow_array): New file static variable
(argv_store, init_argv_array): New functions.
* main.c (init_args): If in sandbox mode, build shadow array of
initial argv values. Call init_argv_array.
2019-05-05 Arnold D. Robbins <arnold@skeeve.com>
* ext.c (load_ext): Fix the message in the version for when
extensions are not available.
2019-04-24 Arnold D. Robbins <arnold@skeeve.com>
* msg.c (msg): Use %ld for the line number value. Thanks to
Michal Jaegermann for the report.
2019-04-23 Arnold D. Robbins <arnold@skeeve.com>
* config.sub: Updated from GNULIB.
2019-02-21 Andrew J. Schorr <aschorr@telemetry-investments.com>
* interpert.h (Op_store_field): Move call to force_string to
here from unfield. Speeds up work with fields that are numeric
only. Thanks to Tom Gray <tom_gray@keysight.com> for the report.
2019-04-21 Arnold D. Robbins <arnold@skeeve.com>
* POSIX.STD: Updated.
* field.c (get_field): If NF == -1, check parse high water to
set in_middle correctly. Thanks to <oguzismailuysal@gmail.com>
for the report.
2019-04-18 Arnold D. Robbins <arnold@skeeve.com>
* msg.c (msg): Add an undocumented feature. "Use the Source, Luke."
* Makefile.am (EXTRA_DIST): Add ChangeLog.1 to the list. Ooops.
* CheckList: Updated.
Fix core dump reported by Steve Kemp <steve@steve.org.uk>:
* awk.h (errcount): Declare.
* awkgram.y (errcount): No longer static.
* command.y (dbg_errcount): Renamed from errcount.
* main.c (catchsig, catchsegv): If errcount > 0, just exit,
don't abort.
2019-04-12 Arnold D. Robbins <arnold@skeeve.com>
* configure.ac: Update version to 5.0.0.
* configure: Regenerated.
* ChangeLog.1: Rotated ChangeLog into this file.
* ChangeLog: Created anew for gawk 5.0.0 and on.
* README: Bump version to 5.0.0.
* 5.0.0: Release tar ball made.
|