-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathChangeLog
More file actions
3328 lines (2299 loc) · 115 KB
/
ChangeLog
File metadata and controls
3328 lines (2299 loc) · 115 KB
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
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
2025-04-02 Arnold D. Robbins <arnold@skeeve.com>
* README: Version adjusted for release.
* configure.ac: Ditto.
* 5.3.2: Release tar made.
2025-03-27 Arnold D. Robbins <arnold@skeeve.com>
* field.c (do_split): Fix subtle issue with " " vs. / /
as separator argument to split(). Reported by Jason Kwan
with assistance from Nethox.
2025-03-25 Arnold D. Robbins <arnold@skeeve.com>
* io.c (find_source): Always append .awk when searching, even if
--traditional. Thanks to Nethox <nethox+awk@gmail.com> for
pointing out the inconsistency.
* NEWS: Updated.
2025-03-19 Collin Funk <collin.funk1@gmail.com>
Fix build on AIX.
* awk.h [_AIX]: Include <sys/cred.h> before defining macros which
cause errors when expanded in function prototypes.
2025-03-18 Arnold D. Robbins <arnold@skeeve.com>
* awk.h (POP_SCALAR): Use DEREF on original value for Node_var_new.
2025-03-17 Arnold D. Robbins <arnold@skeeve.com>
Fix problems calling functions indirectly with Node_var_new.
Thanks to Denis Shirokov <cosmogen@gmail.com> for the report
and test case.
* awk.h (POP_SCALAR): Handle Node_var_new.
(fixtype): Change assertion into a runtime test and failure.
That way it'll happen even if compiled with NDEBUG.
Unrelated cleanup:
* builtin.c (call_match): Remove redundant tests for
Node_var_new inside a test for either Node_var_new or
Node_elem_new.
2025-03-11 Arnold D. Robbins <arnold@skeeve.com>
* re.c (check_bracket_exp): Rewrite the routine to correctly handle
special characters after the opening bracket. Thanks to
Mohamed Akram <mohd.akram@outlook.com> for the report.
(reflags2str): Unrelated: Add RE_DEBUG to the list.
2025-03-09 Arnold D. Robbins <arnold@skeeve.com>
Bug fix:
* eval.c (elem_new_reset): Set vname to NULL. This is a bug fix that
only showed up when compiling for 32 bit.
Memory cleanup:
* eval.c (setup_frame, PUSH_CODE, init_interpret): After call to
getnode(), memset the new node to zero.
* field.c (set_record): Ditto.
* interpret.h (r_interpret): Case Op_array_for_init: Ditto.
* node.c (make_str_node): Ditto.
* profile.c (pp_push): Ditto.
* symbol.c (append_symbol): Ditto.
Compiler warning fix:
* main.c (enable_pma): Add a return true to silence compiler
warnings when USE_PERSISTENT_MALLOC is not defined.
General improvement:
* interpret.h (r_interpret): Case Op_func_call, if do_itrace,
print the function name.
2025-02-24 Arnold D. Robbins <arnold@skeeve.com>
* NEWS: Updated.
* main.c (UPDATE_YEAR): Update.
* array.c, awk.h, awkgram.y, cint_array.c, command.y, debug.c,
eval.c, ext.c, field.c, floatcomp.c, gawkapi.c, int_array.c,
interpret.h, io.c, mpfr.c, node.c, printf.c, profile.c, re.c,
str_array.c, symbol.c: Update copyright year.
2025-02-14 Paul Eggert <eggert@cs.ucla.edu>
* main.c (main): Omit BSD hack that misbehaved by putting stderr
in O_APPEND mode, which can cause later stderr output to be put in
the wrong place, even after Gawk has exited and even if Gawk
never outputs anything. For example, the shell command
"echo abcdefgh >foo; (gawk 'BEGIN{}'; echo ouch >&2) 2<>foo"
incorrectly appended "ouch" to the end of foo rather than
correctly overwriting the start of "foo" with "ouch".
The BSD issue can be addressed in the test case instead.
2025-02-16 Arnold D. Robbins <arnold@skeeve.com>
* int_array.c (INT_CHAIN_MAX): Bump it up from 2 to 10.
* str_array.c (STR_CHAIN_MAX): Ditto.
2025-02-05 Arnold D. Robbins <arnold@skeeve.com>
* configure.ac: Add checks for spawn.h and _NSGetExecutablePath
function.
* awk.h (os_disable_aslr): Add function declaration.
* main.c (enable_pma): Move OS specific code out of this function
and in posix/gawkmisc.c. Instead, call os_disable_aslr().
2025-02-05 Arnold D. Robbins <arnold@skeeve.com>
* main.c (enable_pma): Remove unused argc parameter and adjust
call. Add call to unsetenv() for magic env var if it was
there, so that the environment is as it was before the exec.
2025-02-05 Arnold D. Robbins <arnold@skeeve.com>
* main.c (enable_pma): New function. Has the entire init flow
for PMA. Also has new linux-specific code to deal with being
an PIE executable.
(main): Call enable_pma().
* configure.ac: Add checks for <sys/personality.h> and the
personality() system call.
* NEWS: Updated.
2025-02-05 Arnold D. Robbins <arnold@skeeve.com>
Bug fixes for indirect calls of match and patsplit.
Thanks to Denis Shirokov <cosmogen@gmail.com> for the report
and test case.
* builtin.c (call_match): Pop the text of the stack. Handle
the case that the regex is Node_var_new or Node_elem_new.
Same for the text. Push text onto the stack first, then
everything else.
Also, free the vname for the regex argument if it's a Node_var_new;
same for the text argument.
* eval.c (setup_frame): Handle Node_regex and Node_dynregex.
* field.c (do_patsplit): Handle the case of the source being
Node_param_list, and then if Node_var_new or Node_elem_new.
2025-02-05 Arnold D. Robbins <arnold@skeeve.com>
* node.c (r_unref): For Node_var_new, free the vname.
2025-02-05 Arnold D. Robbins <arnold@skeeve.com>
Stylistic cleanups and small code cleanups.
* array.c, eval.c, ext.c, interpret.h: Some stylistic cleanups.
* awk.h (eln_pa, eln_vn): Renamed to elemnew_parent and
elemnew_vname. All uses adjusted.
(union worn): Renamed to `z' and only needs the wsp and vn
pointers in it.
2025-02-03 Cristian Ioneci <mekanofox@astropostale.com>
Fix issues triggered by using in certain ways array elements passed to
a function; issues include crash dumps, reads-after-free, internal errors,
incorrect results.
See test cases in test/ar2fn_*.awk.
* awk.h: Add an union around `wsp', `wslen', part of NODE's `sub.val', in
order to overlap a char* over `wsp'; adjust/add #defines to access the
moved/added members.
(force_string_fmt, force_number): Clear Node_elem_new specific members
when the type is changed.
* interpret.h (r_interpret): Make a newborn Node_elem_new remember its
parent and a string representation of the index in the parent; for that
use `typre' and the added char* mentioned above (in awk.h)
(r_interpret): Clear Node_elem_new specific members when the type is
changed.
* array.c (force_array): The node will become a Node_var_array: if
present, use the values stashed in the previously mentioned fields to
properly set its `parent_array' and `vname'.
(adjust_param_node): New function.
(adjust_fcall_stack): Extra handling of Node_elem_new nodes.
* eval.c (elem_new_reset): New function.
(elem_new_to_scalar): Clear Node_elem_new specific members using the newly
introduced function above.
* ext.c (get_actual_argument): Clear Node_elem_new specific members when
the type is changed.
* gawkapi.c (api_sym_update): Clear Node_elem_new specific members when
the type is changed.
* mpfr.c (mpg_force_number): Clear Node_elem_new specific members when
the type is changed.
* node.c (r_force_number): Clear Node_elem_new specific members when
the type is changed.
(r_unref): Add code to free the eln_vn member of a Node_elem_new.
2025-01-26 Arnold D. Robbins <arnold@skeeve.com>
* interpret.h (r_interpret): Case Op_store_var; move REGEX
check to ...
* node.c (r_unref): ... here.
* builtin.c (do_sub): Remove REGEX freeing code, simplify what
remained when checking if original target was a regex.
2025-01-24 Arnold D. Robbins <arnold@skeeve.com>
* interpret.h (r_interpret): Case Op_store_var; add a
check for valref == 1. Duh.
2025-01-23 Arnold D. Robbins <arnold@skeeve.com>
* interpret.h (r_interpret): Case Op_store_var; free up
typed regex stuff to avoid memory leaks. See memleak2 test.
Thanks to Denis Shirokov <cosmogen@gmail.com> for the report
and test case.
2025-01-22 Arnold D. Robbins <arnold@skeeve.com>
* configure.ac: Add hack if GCC to use -O3 instead of -O2.
Unrelated:
* builtin.c (call_sub, call_split_func): Handle the case of
the function name being preceded by awk::.
Thanks to Denis Shirokov <cosmogen@gmail.com> for the reports.
2025-01-20 Arnold D. Robbins <arnold@skeeve.com>
* TODO: Add item about variable line number and filename
definition point.
2025-01-07 Arnold D. Robbins <arnold@skeeve.com>
Thanks to Cristian Ioneci <mekanofox@astropostale.com> for the
report and test case and fixes for these.
* builtin.c (do_isarray): Handle Node_param_list also.
(do_typeof): Additional checking for passed-in array.
2025-01-06 Arnold D. Robbins <arnold@skeeve.com>
* builtin.c (do_typeof): Handle Node_param_list. Thanks to
Thanks to Denis Shirokov <cosmogen@gmail.com> for the report and
test case.
2025-01-02 Arnold D. Robbins <arnold@skeeve.com>
* NEWS: Updated. Copyright year updated, too.
2024-12-15 Arnold D. Robbins <arnold@skeeve.com>
* awk.h (emalloc, erealloc, ezalloc): Move to using __func__
instead of requiring the function name as a string in the
source code.
* All source files: Updated all uses.
2024-12-11 Arnold D. Robbins <arnold@skeeve.com>
* awk.h: Remove accidentally left-over Tandem bits.
2024-10-17 Paul Eggert <eggert@cs.ucla.edu>
* floatcomp.c (adjust_uint): Add commentary.
2024-10-13 Arnold D. Robbins <arnold@skeeve.com>
* NEWS: Updated.
2024-10-10 Arnold D. Robbins <arnold@skeeve.com>
Check if RE match at end of string could be an exact
match. This is true if the maybe_long flag is false.
Thanks to Ronald D. Rechenmacher <ron@fnal.gov> for
the idea.
* io.c (rsrescan): Add an additional check when the
match is exactly at the end.
* re.c (make_regexp): Add backslash to the list of
characters which sets the maybe_long field.
2024-09-25 Arnold D. Robbins <arnold@skeeve.com>
Clean up spurious newlines in pretty printer output.
Thanks to John Devin <john.m.devin@gmail.com> for the
motivation.
* awk.h (close_prof_file): New function.
* main.c (main): All close_prof_file.
* profile.c (close_prof_file): New function.
(at_start): New variable.
(pprint, print_lib_list, print_include_list, print_comment,
pp_func, pp_namespace): Use it.
2024-09-19 Arnold D. Robbins <arnold@skeeve.com>
* array.c (do_delete): Handle case where subscript is Node_elem_new.
Thanks to Denis Shirokov <cosmogen@gmail.com> for the report and
test case.
2024-09-17 Arnold D. Robbins <arnold@skeeve.com>
* 5.3.1: Release tar made.
2024-09-17 Arnold D. Robbins <arnold@skeeve.com>
* Makefile.am, awkgram.y, command.y, debug.c, eval.c,
gawkapi.c, interpret.h, mpfr.c: Update copyright year.
* Checklist: Updated a bit.
* NEWS: Version changed.
* configure.ac: Bump version.
2024-09-04 Arnold D. Robbins <arnold@skeeve.com>
* Checklist: Add two more items to do.
2024-08-16 Arnold D. Robbins <arnold@skeeve.com>
* printf.c (zero_fill_to_precision): Fix calculation of buflen.
Thanks and a tip of the hatlo to Address Sanitizer.
2024-08-12 Arnold D. Robbins <arnold@skeeve.com>
* awkgram.y (push_ns_onto_namespace_chain): New function.
(mk_function, set_namespace): Use it.
2024-08-12 Arnold D. Robbins <arnold@skeeve.com>
Fix some C23 compilation issues. Thanks to
Jeffrey Cliff <jeffrey.cliff@gmail.com> for the report.
* awkgram.y (get_src_buf): Remove obsolete comment.
* io.c (iop_alloc, get_read_timeout): Fix casts for read.
2024-08-11 John E. Malmberg <wb8tyw@qsl.net>
* printf.c (format_mpg_integer_digits): Improved fix
from Arnold for if !HAVE_MPFR.
2024-08-11 John E. Malmberg <wb8tyw@qsl.net>
* printf.c (format_float): Fix cant_happen macro call.
(format_mpg_integer_digits): Return NULL if !HAVE_MPFR.
2024-08-10 Arnold D. Robbins <arnold@skeeve.com>
Thanks again to Michal Jaegermann for tips on removing
compiler warnings:
* eval.c (cmp_scalars): Default ret to false and add a
default case to the switch.
2024-08-09 Arnold D. Robbins <arnold@skeeve.com>
Thanks to Michal Jaegermann for tips on removing
compiler warnings:
* eval.c (opcode2str): Return "" instead of NULL.
(cmp_doubles): Default ret to false and add a default case
to the switch.
* printf.c (format_signed_integer): Add some additional
parentheses.
2024-08-06 Arnold D. Robbins <arnold@skeeve.com>
* printf.c (format_unsigned_integer, format_signed_integer):
Additional fixes. New added tests pass.
2024-07-26 Arnold D. Robbins <arnold@skeeve.com>
* re.c (check_bracket_exp): Make the code actually work.
2024-07-23 Arnold D. Robbins <arnold@skeeve.com>
Finish cleaning up the printf refactoring. All tests run, both
regular and -M. Test suite is valgrind clean!
Summary of changes:
* printf.c: New file.
(format_args): Moved here and renamed from format_tree. Considerably
simplified by moving code out into new routines.
(struct flags): New struct.
(add_thousands, do_printf, do_sprintf, format_nan_inf, mbc_byte_count,
mbc_char_count, out_of_range, printf_common, reverse): Moved to here.
(add_alt_format, add_plus_or_space_and_fill, adjust_flags, compute_zero_flag,
fill_to_field_width, format_float, format_integer_digits,
format_mpg_integer_digits, format_out_of_range, format_signed_integer,
format_unsigned_integer, zero_fill_to_precision): New routines.
2024-07-21 Arnold D. Robbins <arnold@skeeve.com>
* printf.c: Simplify printing of signed integers; move several
common tasks out into separate routines, and use char * instead
of const char * to avoid a lot of casting.
2024-07-20 Tim Rice <trice@posteo.net>
* io.c (csvscan): Set the sentinel if we found CR-LF.
2024-07-20 Arnold D. Robbins <arnold@skeeve.com>
* printf.c: Continuing fixes and cleanups.
2024-07-17 Arnold D. Robbins <arnold@skeeve.com>
* NEWS: Updated.
* printf.c (fill_to_field_width): New function.
(format_out_of_range, format_unsigned_integer): Start to use it.
2024-07-16 Arnold D. Robbins <arnold@skeeve.com>
* printf.c: Continue cleaning up code and removing now-dead code.
2024-07-16 Arnold D. Robbins <arnold@skeeve.com>
* awk.h (format_args): Renamed from format_tree. Remove
format_tree_old.
* debug.c, main.c, mpfr.c, node.c: Adjusted.
* printf.c (format_args): Renamed. Removed all old, factored-out
code.
(format_tree_old): Removed.
2024-07-16 Arnold D. Robbins <arnold@skeeve.com>
* printf.c: Use mpfr_sprintf() just to generate digits.
All tests now passing, even with -M.
2024-07-13 Arnold D. Robbins <arnold@skeeve.com>
* printf.c: Continued progress against the printf-corners test.
2024-07-11 Arnold D. Robbins <arnold@skeeve.com>
* printf.c: Signed and unsigned integer printing and float printing
working for current tests. MPFR integer printing also for current
tests. A few tests still to go in printf-corners.
2024-07-09 Arnold D. Robbins <arnold@skeeve.com>
* printf.c: Signed printing I think is working. Unsigned is better.
Checkpoint commit.
2024-07-07 Arnold D. Robbins <arnold@skeeve.com>
* printf.c: Signed and unsigned integer printing mostly working now.
Still to go: Finish that up, get GMP/MPFR integer printing working.
2024-07-05 Arnold D. Robbins <arnold@skeeve.com>
* printf.c: Lots of cleanup. Floating point format pretty
much working. Signed integer printing getting there.
Unsigned integer printing still to do.
2024-07-02 Arnold D. Robbins <arnold@skeeve.com>
* awk.h (format_tree_new, format_tree_old): Add declarations.
(format_tree): Temporarily make into a function.
* main.c (format_tree): Declare it.
(main): Check PRINTF_NEW environment variable and if so,
use the new version. Otherwise use the old one.
* printf.c (struct flags): Declare.
(format_tree_old): The original version.
(format_tree_new): The new one, being refactored.
(add_thousands): Use the global `loc' variable, not a parameter.
static const char *format_integer(NODE *arg, struct flags *flags);
(format_mpg_integer, format_float, format_out_of_range,
compute_zero_flag): New functions.
2024-07-02 Arnold D. Robbins <arnold@skeeve.com>
* re.c (make_regexp): \u escapes also now treated literally
for do_traditional.
2024-06-26 Arnold D. Robbins <arnold@skeeve.com>
Start on printf rework.
* printf.c: New file, with stuff for printf in it.
* builtin.c: Move printf functions into printf.c.
* awk.h (efwrite): Add declaration.
* Makefile.am (base_source): Added printf.c.
2024-06-21 Arnold D. Robbins <arnold@skeeve.com>
* io.c (csvscan): Add a missing buffer overrun check. Restores
`AwKBUFSIZE=42 make check' to passing. :-)
2024-06-16 Arnold D. Robbins <arnold@skeeve.com>
* interpret.h (r_interpret): Op_push: When converting a
Node_elem_new into a Node_var, clear the MPFN and MPZN flags.
Allows the test suite to run again with -M.
2024-06-10 Arnold D. Robbins <arnold@skeeve.com>
* main.c (nostalgia): Remved function.
[COPYRIGHT_YEAR]: Bumped to 2024.
(main): Removed --nostalgia from options and from handling.
* NEWS: Updated.
2024-06-08 Arnold D. Robbins <arnold@skeeve.com>
* io.c: Remove check for OSF/1. It's too obsolete now.
2024-06-05 Arnold D. Robbins <arnold@skeeve.com>
* io.c: Fix a comment typo for enum recvalues.
2024-06-03 Arnold D. Robbins <arnold@skeeve.com>
* awk.h [USE_REAL_MALLOC]: Define this so that emalloc() and friends
use the real routines. For memory debugging.
* configure.ac: Enable USE_REAL_MALLOC if 'mallocdebug' is in
.developing. Add debug to .y files if 'yaccdebug' is in
.developing. Use '^...$' in grep test for all tests from
the .developing file.
2024-05-19 Arnold D. Robbins <arnold@skeeve.com>
* awkgram.c: Updated.
* builtin.c (gawk_system): Remove an unused variable.
* io.c (gawk_popen_write): Ditto.
2024-05-18 Arnold D. Robbins <arnold@skeeve.com>
* awkgram.y (check_params): Make the message about not allowing
reseved variables as parameters explicit that this is from POSIX.
2024-04-28 Arnold D. Robbins <arnold@skeeve.com>
* re.c: Update copyright year.
2024-04-20 Arnold D. Robbins <arnold@skeeve.com>
* eval.c (cmp_scalars): Call fixtype() on the values before
trying to compare them. Thanks to Ed Morton for the bug
report. See test/strsubscript.awk for the test case.
2024-02-29 Arnold D. Robbins <arnold@skeeve.com>
* re.c (do_sub): Fix arguments in call to SUBPATSTART().
2024-02-23 Arnold D. Robbins <arnold@skeeve.com>
Another attempt to fix the race conditions on SIGPIPE. See
https://lists.gnu.org/archive/html/bug-gawk/2023-12/msg00011.html.
* awk.h (do_nothing_on_signal): Remove declaration.
(wait_any): Add declaration.
* builtin.c (gawk_system): New function.
(do_system): Call it.
* io.c (wait_any): Make extern, not static.
(gawk_popen_write, gawk_popen_write_close): New functions.
(redirect_string): Call gawk_popen_write.
(close_rp): Call gawk_popen_write_close.
(do_nothing_on_signal): Removed.
(getdtablesize): Define as a macro if needed.
* configure.ac: Add check for getdtablesize.
* awk.h, builtin.c, io.c, node.c, gawkapi.h, configure.ac: Updated
copyright years also.
2024-02-01 Arnold D. Robbins <arnold@skeeve.com>
* .gitignore: Ignore .dirstamp files. Thanks to "M"
<c24p0101@gmail.com> for the suggestion.
2024-01-28 Arnold D. Robbins <arnold@skeeve.com>
* node.c (str2wstr): Always allocate the array for use
by do_match(). Bug reported by Sam James <sam@gentoo.org>.
Thanks to Miguel Pineiro Jr. <mpj@pineiro.cc> for the
simplified test case.
2024-01-20 Arnold D. Robbins <arnold@skeeve.com>
* configure.ac: MPFR on 32 bit Power PC is back
to working. Remove the check that disables it.
* NEWS: Updated.
2024-01-16 Andrew J. Schorr <aschorr@telemetry-investments.com>
* gawkapi.h: Add a comment suggesting that do_flags be converted
to a bitmask if we ever need to add another value, since the current
approach breaks ABI compatibility for each new flag.
2024-01-12 Arnold D. Robbins <arnold@skeeve.com>
Use newer interfaces for getting the time if they're available.
Thanks to Andreas Schwab <schwab@suse.de> and Andrew Schorr.
* builtin.c (do_systime): Use clock_gettime() or gettimeofday() or
time(), in that order.
* configure.ac: Add checks for clock_gettime() and gettimeofday().
2023-12-26 Arnold D. Robbins <arnold@skeeve.com>
* gawkapi.c (api_get_argument): Sync handling of AWK_UNDEFINED
with the doc.
(node_to_awk_value): Similar.
2023-12-25 Arnold D. Robbins <arnold@skeeve.com>
* debug.c (serialize_list): Fix a compiler warning about
an unused variable.
2024-12-25 Andrew J. Schorr <aschorr@telemetry-investments.com>
* io.c (get_read_timeout): Make gawk match the doc and have
GAWK_READ_TIMEOUT work if no entry in PROCINFO. Thanks
to Ed Morton for the report.
2023-12-24 Arnold D. Robbins <arnold@skeeve.com>
* debug.c (print_array): Use the subscript as the
subarray name instead of the `vname' field. This field
is not there for arrays created with NUMINT subscripts.
Thanks again to Hermann Peifer for the report.
Unrelated:
* debug.c (find_subscript): Fail early on Node_var_new
and Node_elem_new. Thanks yet again to Hermann Peifer
for the report.
2023-12-21 Arnold D. Robbins <arnold@skeeve.com>
Fix multidimensional array printing in the debugger, again.
Thanks again to Hermann Peifer for the report.
* debug.c (print_array): Maintain a stack of array names
and indexes, and print it when printing the value.
(print_array_names): New function.
2023-12-21 Arnold D. Robbins <arnold@skeeve.com>
Try to close a race condition window on SIGPIPE. See the thread at
https://lists.gnu.org/archive/html/bug-gawk/2023-12/msg00011.html.
Thanks to Andreas Schwab <schwab@suse.de>.
* awk.h (ignore_sigpipe, set_sigpipe_to_default): Remove decls,
they're not functions.
(do_nothing_on_signal): Add declaration.
(silent_catch_sigpipe): New macro.
* builtin.c (do_system): Replace call of set_sigpipe_to_default()
with call to silent_catch_sigpipe().
* io.c (redirect_string, gawk_popen): Ditto.
(do_nothing_on_signal): New function.
2023-12-12 Eli Zaretskii <eliz@gnu.org>
* io.c (redirect_string): Check registered parsers before failing
due to EISDIR.
2023-12-02 Arnold D. Robbins <arnold@skeeve.com>
* debug.c (print_array): Fix printing of multidimensional arrays.
Thanks to Hermann Peifer for the report.
2023-11-28 Arnold D. Robbins <arnold@skeeve.com>
Straighten out Node_elem_new some more. Thanks to "M"
<c24p0101@gmail.com> for the report and to Andrew Schorr for
the reduced test case.
* awk.h (force_string_fmt): Don't clear NUMBER from the flags.
(force_number): Handle Node_elem_new case. (Ooops.)
* builtin.c (do_typeof): Make unassigned case check smarter.
* mpfr.c (mpg_force_number): Don't clear STRING and don't
change the string value.
* node.c (r_force_number): Ditto.
2023-11-20 Arnold D. Robbins <arnold@skeeve.com>
* command.y (yylex): Change _("%s") into "%s". Sheesh.
2023-11-16 Arnold D. Robbins <arnold@skeeve.com>
* eval.c (cmp_scalars): Check for REGEX as well as STRING
in order to do a string compare. Thanks to
"*" <cl2ap0101@gmail.com> for the report.
2023-11-04 Arnold D. Robbins <arnold@skeeve.com>
* NEWS: Fix the spelling of "Ukrainian". Thanks to
Bruce Horrocks.
2023-11-02 Arnold D. Robbins <arnold@skeeve.com>
* 5.3.0: Release tar ball made.
2023-10-31 Corinna Vinschen <vinschen@redhat.com>
* awk.h (wcitomb): Add declaration.
* node.c (parse_escape): Use it on Cygwin.
2023-10-24 Arnold D. Robbins <arnold@skeeve.com>
* eval.c (setup_frame): Fix a potential use after free
error. Thanks to Michal Jaegermann for the report.
2023-10-23 Arnold D. Robbins <arnold@skeeve.com>
* builtin.c (do_sub): Fix a use-after-free issue reported
by Miguel Pineiro Jr. <mpj@pineiro.cc>.
2023-10-22 Arnold D. Robbins <arnold@skeeve.com>
* nonposix.h, re.c: Update coyright year.
2023-10-21 Arnold D. Robbins <arnold@skeeve.com>
* main.c (parse_args): Deal better with things if -p
given twice. Thanks to Hermann Peifer for the report.
* Checklist: Revised a bit.
* awkgram.y (isnoeffect): Add Op_exec_count to the list so
that `gawk --lint --profile BEGIN{0}' also produces a lint
warning. Thanks yet again to Hermann Peifer.
2023-10-19 Arnold D. Robbins <arnold@skeeve.com>
* NEWS: Updated.
* README: Version bumped to 5.3.0. Updated info about makeinfo
and texinfo.tex versions.
2023-10-17 Arnold D. Robbins <arnold@skeeve.com>
* re.c (make_regexp): Fix setting ok_to_escape.
2023-10-15 Arnold D. Robbins <arnold@skeeve.com>
* NEWS: Editing, in preparation for release.
2023-10-12 Eli Zaretskii <eliz@gnu.org>
* node.c (parse_escape) [__MINGW32__]: Use w32_wc_to_lc to convert
Unicode codepoints.
* nonposix.h (w32_wc_to_lc) [__MINGW32__]: Add prototype.
2023-10-08 Arnold D. Robbins <arnold@skeeve.com>
* node.c (parse_escape): Fix warning message for \u escape.
* interpret.h (Op_lint_plus): Improve the test, especially
for if dealing with user intput. Thanks to Hermann Peifer
for the report.
2023-10-03 Arnold D. Robbins <arnold@skeeve.com>
* profile.c (pprint): Add case for Op_lint_plus. Thanks to
Hermann Peifer for the report.
2023-09-19 Arnold D. Robbins <arnold@skeeve.com>
* NEWS: Updated.
2023-09-13 Arnold D. Robbins <arnold@skeeve.com>
Fix handling of zero length matching in multibyte locales
with sub/gsub. Thanks again to Ed Morton for the report.
* builtin.c (do_sub): When the match is empty and we copy in
the subsequent character, check gawk_mb_cur_max to know whether
to copy one byte or multiple bytes.
2023-09-11 Arnold D. Robbins <arnold@skeeve.com>
* field.c (do_split): Fix some whitespace.
Unrelated: Add do_csv variable to the API.
* gawkapi.h: Bump major version to 4, minor version back to zero.
(DO_FLAGS_SIZE): Increase to 7.
(gawk_do_csv, do_csv): New macros.
* gawkapi.c (init_ext_api): Init the do_csv element. Replace
numeric indices with symbolic ones.
* NEWS: Updated for do_csv in the API, and the major and
minor API versions.
2023-09-01 Miguel Pineiro Jr <mpj@pineiro.cc>
Fix the handling of zero-length matches in multibyte locales.
Thanks to Ed Morton <mortoneccc@comcast.net> for the report.
* builtin.c (do_match): Translate rstart (byte idx to char idx)
even when rlength is zero. For this we tweak the conversion of
rlength to keep it in bounds when rstart and rlength are both 0.
* node.c (str2wstr): Add an entry to the indices array for the
terminating null. It facilitates the tweak above and is needed
to translate the idx of a zero-width match at the end of the
string.
2023-08-27 Arnold D. Robbins <arnold@skeeve.com>
* re.c (make_regexp): When do_traditional and looking to see
if an escape created a metacharacter, use `metas' instead of
a separate string, since BWK awk now also handles interval
expressions. Found by inspection.
2023-08-25 Miguel Pineiro Jr <mpj@pineiro.cc>
* awk.h (enum escape_results): Fix ESCAPE_LINE_CONINUATION typo.
* node.c (make_str_node): Ditto.
* (parse_escape): Ditto.
* re.c (make_regexp): Ditto.
Unrelated: Use size_t for multibyte character lengths (aside
from it being the type which the interfaces return, using it
avoids implementation-defined behavior when -1 or -2 is cast
to size_t then stored in an int).
* node.c (make_str_node): Change mblen from int to size_t.
Unrelated: Change the length of a translated escape sequence
from int to size_t (to match the underlying interfaces).
* awk.h (parse_escape): Change prototype.
* node.c (make_str_node): Adjust to accomodate new type.
* (parse_escape): Ditto.
* re.c (make_regexp): Ditto.
Unrelated: Clarify make_regexp, inspired by make_str_node.
* re.c (make_regexp): Copy multibyte characters at once, move
the escape sequence post-processing into the switch statement
to explicitly connect a return value with its handling, add a
default case to catch unrecognized values, and move ok_to_escape
next to where it's used (and only set it once).
2023-08-21 Arnold D. Robbins <arnold@skeeve.com>
* node.c (make_str_node): Don't use N_() in cant_happen message.
* re.c (make_regexp): Ditto.
2023-08-20 Arnold D. Robbins <arnold@skeeve.com>
Change parse_escape() to return an enum instead of relying
on manifest constants.
* awk.h (enum escape_results): New enum.
(parse_escape): Now returns a value from it, add nbytes pointer
parameter.
* node.c (make_str_node): Revised to use switch/case on
parse_escape return value.
(parse_escape): Update code.
* re.c (make_regexp): Revised to use switch/case on parse_escape
return value.
2023-08-20 Miguel Pineiro Jr <mpj@pineiro.cc>
* awk.h (ELIDE_BACK_NL): Removed.
(parse_escape): Update declaration.
* main.c (cmdline_fs): Don't use ELIDE_BACK_NL.
(arg_assign): Ditto.
* node.c (make_str_node): Rework handling of return value
from parse_escape.
(parse_escape): Change return code to convey more info,
fully parse escapes and handle conversion from unicode to
UTF-8.
* re.c (make_regexp): Rework for new interface to parse_escape.
2023-07-09 Arnold D. Robbins <arnold@skeeve.com>
* re.c (make_regexp): In error message, use the original text
directly as a string and not with calculated length. Thanks
to Neil R. Ormos <ormos-gnulists17@ormos.org> for the report.
2023-06-27 Arnold D. Robbins <arnold@skeeve.com>
* NEWS: Updated.
2023-06-22 Arnold D. Robbins <arnold@skeeve.com>
* field.c (comma_parse_field): Don't set the field if len
is zero. Kudos to BWK's awk for finding this gawk bug.
2023-06-12 Arnold D. Robbins <arnold@skeeve.com>
* main.c (cmdline_fs): Add ELIDE_BACK_NL to flags in call
to make_str_node(). Fixes weirdness with -F. Thanks to
Denys Vlasenko <dvlasenk@redhat.com> for the report.
2023-06-04 Arnold D. Robbins <arnold@skeeve.com>
* builtin.c (do_sub): Fix a Day 1 gensub bug, reported by
Denys Vlasenko <dvlasenk@redhat.com>.
2023-06-02 Arnold D. Robbins <arnold@skeeve.com>
* NEWS: Updated.
2023-05-07 Arnold D. Robbins <arnold@skeeve.com>
* 5.2.2: Release tar ball made.
2023-05-07 Arnold D. Robbins <arnold@skeeve.com>
* README: Update version.
* debug.c: Update copyright year.
2023-04-22 Arnold D. Robbins <arnold@skeeve.com>
* awkgram.y, builtin.c, debug.c, eval.c, interpret.h,
profile.c: Fix some implicit fall through warnings.
Thanks to "Jannick" <thirdedition@gmx.net> for the report.
2023-04-21 Arnold D. Robbins <arnold@skeeve.com>
* array.c (asort_actual): Initialize `value' to avoid
compiler complaints. Thanks to Michal Jaegermann
for the report.
* main.c (usage): Cast array subscript to int to silence
a compiler warning. Thanks to "Jannick" <thirdedition@gmx.net>
for the report.
2023-04-14 Arnold D. Robbins <arnold@skeeve.com>
* array.c (asort_actual): Handle Node_elem_new. Add braces
for scoping, fixes tcc compiler error (GCC is too permissive!).
Update copyright year.
* Makefile.am, configure.ac, awk.h, agwkgram.y, builtin.c,
command.y, eval.c, field.c, io.c, msg.c, node.c, profile.c,
symbol.c: Update copyright year.
2023-04-13 Arnold D. Robbins <arnold@skeeve.com>
* array.c (asort_actual): Handle Node_var_new. Can happen
if you sort SYMTAB. Thanks to zhou shuiqing
<zhoushuiqing321@outlook.com> for the report.
2023-04-13 Andrew J. Schorr <aschorr@telemetry-investments.com>
* io.c (csvscan): Convert CR-LF pairs to plain LF, both at the
end of the line and when embedded. Plain CRs are not touched.
2023-04-07 Andrew J. Schorr <aschorr@telemetry-investments.com>
* io.c (csvscan): Instead of stripping all carriage returns in the
input, simply include the CR in the RT if it occurs just before
the linefeed character.
2023-04-07 Arnold D. Robbins <arnold@skeeve.com>
* array.c (assoc_info): Update to handle additional cases so
that one may dump SYMTAB or FUNCTAB. Issue reported by
zhou shuiqing <zhoushuiqing321@outlook.com>.
2023-03-26 Arnold D. Robbins <arnold@skeeve.com>
* NEWS: Updated.
2023-03-24 Arnold D. Robbins <arnold@skeeve.com>
Add support for \u escape sequence.
* awk.h (parse_escaape): New bool* parameter for unicode.
* node.c (make_str_node): Deal with a \u escape.
(parse_escape): Handle \u.
* re.c (make_regexp): Deal with a \u escape.
2023-03-24 Arnold D. Robbins <arnold@skeeve.com>
* io.c (set_RS): Fix first time and warning logic for csv mode.
2023-03-23 Arnold D. Robbins <arnold@skeeve.com>
* io.c (csvscan): Strip CRs.
2023-03-21 Manuel Collado <mcollado2011@gmail.com>
* io.c (csvscan): Real implementation.
2023-03-18 Miguel Pineiro Jr. <mpj@pineiro.cc>
Allow records longer than INT_MAX. For test cases,
see https://lists.gnu.org/archive/html/bug-gawk/2021-05/msg00003.html.
* awk.h (set_record): `cnt' is now size_t.
* field.c (set_record): `cnt' is now size_t. Adjust databuf_size
and MAX_SIZE macro.
* io.c (get_a_record): Add new second parameter, size_t *len,
which holds the size. Adjust return value meaning. Deal with
return from an extension's get_a_record() function.
(do_getline_redir): Adjust calling get_a_record().
(do_getline): Ditto.
(inrec): Ditto.
2023-03-17 Arnold D. Robbins <arnold@skeeve.com>
* field.c (do_split): Modify behavior for --csv.
2023-03-16 Arnold D. Robbins <arnold@skeeve.com>
* awk.h (enum do_flag_values): Add DO_CSV.
(do_csv): New macro.
(init_csv_fields, init_csv_records): Add declarations.
* field.c (init_csv_fields): New function.
(set_parser): Don't set the parser if doing CSV. Add warnings.
* io.c (csvscan): New function (placeholder for now).
(init_csv_records): New function.
(set_RS): Don't set the parser if doing CSV. Add warnings.
* main.c (optab): Add new options -k/--csv.
(main): Fatal out if --posix and --csv. Call init_csv_records()
and init_csv_fields().