Debian Codegraph @

CHANGES

raw
1 -- $MawkId: CHANGES,v 1.441 2026/03/03 01:19:00 tom Exp $
2
3 20260302
4 + amend behavior if stdout is a terminal/tty: do not make -W
5 interactive "the default" because that interferes with setting RS and
6 FS. Instead, simply use setbuf (report by Joerg van den Hoff).
7
8 20260129
9 + make -W interactive the default if stdout is a terminal/tty
10 (Original-Mawk #41).
11 + fix a regression in test case (Original-Mawk #78).
12 + modify relational operators to check for inf/nan (NetBSD #59332).
13 + improve loop unrolling in regex, needed for lower-limit check with
14 brace expressions (Original-Mawk #93).
15 + improve checks for size parameters of zmalloc and zrealloc
16 (Original-Mawk #91).
17 + improve precedence of operators (Original-Mawk #63, patch by jlp765).
18 + fix a for-in loop comparison (Original-Mawk #86, patch by jlp765).
19 + improve limit-checks for $n expressions, in case of sign extension
20 (report by Dima Kogan).
21 + improve portability of initialization of srand (Debian #1124627,
22 Original-Mawk #85).
23 + updated configure macros
24 + update install-sh,l config.guess, and config.sub
25
26 20250514
27 + improve makefile rule producing parse.c and parse.h from parse.y
28 (Debian #1105498).
29
30 20250131
31 + transform nested "+" repetitions to "{1,}" form, to work with the
32 runtime stack.
33 + modify M_ENTER to record its loop-level into a runtime stack, which
34 can be checked by failing operations to provide quick recovery.
35
36 20241231
37 + in-progress changes to improve regex brace expressions, using new
38 machine codes M_ENTER and M_LOOP.
39 + add a T_CAT in compiled regex to fix a panic (report by Dimitar
40 Dimitrov).
41
42 20241214
43 + fix stricter gcc15 warnings.
44
45 20241213
46 + disallow reading from a directory like a file (Original-Mawk #83).
47
48 20241212
49 + modify calls on stdtod() to disallow hexadecimal, infinite and
50 not-a-number values unless the "--posix" option is given (report by
51 Xose Vazquez Perez).
52 + fix a regression in rexp3.c for pattern /^.$/ (cf: 20240819)
53
54 20241209
55 + modify use of OFMT when given a format such as %c which cannot fully
56 represent a floating point value, like gawk/bwk.
57 + modify format for infinite values, showing plus/minus signs.
58 + allow format to contain an escaped '%'
59 + further printf/sprintf fixes, using line-coverage to guide testing
60
61 20241117
62 + improve printf/sprintf by handling special case of 2^64 which can be
63 represented as an exact value (Original-Mawk #78).
64 + modify use of mktemp in test-scripts to work with HPUX, which uses
65 a different interpretation of the "-d" option.
66 + update configure script
67
68 20240905
69 + update manual page discussing approved extensions.
70 + mask nonprintable characters when reporting errors in scripts
71 + fix for unmatchable pattern workaround in 20240819, in case the regex
72 also has a syntax error immediately after (report/testcase by Tyler
73 Hawkins).
74 + fix sign-extension in scan.c (report/testcase by Tyler Hawkins).
75
76 20240827
77 + amend fix for Original-Mawk #48, providing for deep function
78 recursion, but disallowing more than 255 parameters for printf, etc.
79 + add test-cases to test/mawkerrs
80 + update config.guess and config.sub
81
82 20240825
83 + modify struct declarations to simplify further changes to reduce use
84 of typeless pointers.
85 + reduce memory requirements for test/longlines.sh (discussion with
86 Boyuan Yang).
87 + fix compiler warning about out-of-bounds reference to eval_stack[]
88 + fix regression in ".*$" regex (Debian #1079389).
89
90 20240819
91 + several changes to improve results with lcov, increasing coverage
92 measured by line/function percentages from 82.3/89.2 to 90.5/96.0;
93 using new bundled and separate test-cases as well as some code fixes.
94 + some code-changes provide for overriding compiled-in limits to make
95 testing simpler, e.g., SP_SIZE, FB_SHIFT, SPRINTF_LIMIT.
96 + adjusted ifdef's based on coverage analysis which showed used code
97 + test package builds with "unused" cases in rexp*.c disabled
98 + new bundled test cases include cclass.awk and mawkerrs script.
99 The latter is invoked via the "mawk_errs" target in the makefile.
100 + correct a case in rexp3.c which addressed past end of string.
101 + improve regex handling of nul character.
102 + add a null pointer check to cell_destroy()
103 + show state value in the panic exit in rexp0.c
104 + add RE_bad_state, for panics in rexp2.c and rexp3.c
105 + add workaround in rexp.c for patterns like /{0}/ and /^{0]/ where
106 nothing could match, for now with a comment indicating that a
107 RE_none() along with a M_REJECT state seems the way to completely
108 resolve this. The workaround was needed because trimming the {0}
109 caused out-of-bounds access.
110 + use C_NOINIT in bi_funct.c for readability
111 + address special-case in the trace call in execute.c, to avoid
112 calling da_type_name() when sp happens to be just before
113 eval_stack[] -- which happens in the first call from the main
114 program.
115 + add/use TRACE_FUNC2 for cases where we know the number of arguments
116 is not sp->type
117 + fix a regression in fin.c introduced by buffer-changes in 20230808
118 + fixes for is_string_split() function, making it work for both
119 internal and external regex.
120 + change ifdef in version.c to provide for test-package showing the
121 effective limit of sprintf buffer.
122 + correction to usage message: -W traditional rather than -W compat
123 + test/mawktest uses mktemp for the working files
124 + add test/longline.sh
125 + add test/hashbang-S.sh for later use in testing.
126 + add test/cclass.awk script for character-classes
127 + improve regular expression matching (Original-Mawk #76).
128
129 20240716
130 + add --enable-arc4random option to configure script; this is normally
131 disabled for mawk because the developer of arc4random did not provide
132 a useful method for initialization (Debian #1075717).
133 + improve configure-check for clock_gettime, checking for both
134 monotonic and realtime clocks, as well as adding a check for
135 clock_gettime in the "rt" library for Solaris
136
137 20240622
138 + ensure input buffer is null-terminated (patch by James Cowgill,
139 Original-Mawk #77).
140
141 20240123
142 + improve manpage style/formatting.
143 + improve conversion of parameter of srand() when using srandom()
144 (Original-Mawk #66).
145 + minor improvement for configure script
146
147 20231210
148 + correct interator type in REcompile (Original-Mawk #73)
149 + improve configure script check for arc4random
150 + reduce compiler warnings in configure script checks
151
152 20231126
153 + fix a couple of problems reported by Coverity:
154 + modify cell_destroy() to set the string pointer to NULL if zfree()
155 might have freed it.
156 + replace a couple of strcpy's with loop.
157 + eliminate a fixed-size array in re_cmpl.c
158 + change casts in strftime() and srand() to avoid truncation on 64-bit
159 machines (report by John Naman).
160
161 20231102
162 + environment-fixes for building with Solaris 10.
163
164 20231101
165 + repair parsing for comma-separated -W options used in "#" lines
166 (report by Leif Baron).
167 + updated makedeps.sh and examples/deps.awk, to update Makefile.in
168 + remove obsolete/incorrect zero-termination assignment from fillbuff()
169 (Original-Mawk #71).
170 + updated configure macros
171 + update config.guess and config.sub
172
173 20230816
174 + start work on _CALLX
175 + da.c: replace most of the string-literals in fprintf's with result
176 from da_op_name()
177 + da.c, mawk.h: simplify ifdef for da_op_name(), to reuse in
178 refactoring of _CALL
179 + da.c: dumping the function name in front of the offset is
180 distracting, use just "@"
181 + da.c: make the trace show offsets like the -Wdump option
182 + da.c: add traces to show which function is being dumped (and
183 possibly patched). this improves on the fix for dump_funcs() as well,
184 freeing the linked-list
185 + code.c: fix a use-after-free when no-leaks and traces are combined.
186 + code.c: add trace to be_setup()
187 + parse.y: make trace message consistent with fcall.c
188 + execute.c: eliminate a couple of comparisons
189 + change SYMTAB_TYPES to mixed enum/masks, to reduce comparisons for
190 array types.
191 + some cleanup, using NUM_ARGS and SYM_TYPE typedefs.
192
193 20230808
194 + modify input buffer-resizing to improve performance with very long
195 lines (report/testcase by Leif LeBaron).
196
197 20230804
198 > fixes for nulls (patches by Miguel Pineiro Jr).
199 + support nulls in toupper() and tolower().
200 + modify str_str() to ensure lengths for key/target are large enough
201 for the memcmp() call.
202 + treat special case of failure to open input file due to too many open
203 files as a fatal error (report/testcase by Christoph Brunhuber).
204 + fix a shift/reduce conflict for length vs length()
205 + quote string-parameter in a few error-messages
206 + add MinGW-code for system() calls (Original-Mawk #51).
207
208 20230730
209 + rexp.c: do not unroll repetition into loops if the repetition applies
210 to more than one character.
211 + rexp3.c: increment machine on completing M_2JC step to fix a case
212 with infinite loop.
213 + print.c: improve parameter-passing, eliminating a duplicate check.
214
215 20230726
216 + modify makefile to install mawk-array and mawk-code manpages.
217
218 20230725
219 + use da_string more consistently in dumps.
220 + improve scanner to some type-checks of arrays versus scalars by
221 deferring this into the runtime execution (report by Rajeev V Pillai).
222
223 20230716
224 + modify scanner to accommodate scripts which use the same name for
225 some function-parameters as for a function (report by Kaz Kylheku).
226 + amend/limit special case optimization for redundant wildwards
227 (Original-Mawk #36).
228 + regenerate parse.c using byacc 20230521
229
230 20230525
231 + fix a regression for big-endian machines caused by mismatch between
232 printf/sprintf format and long integer types (Original-Mawk #69, cf:
233 20200731).
234
235 20230404
236 + add a null-pointer check in bi_mktime() (Original-Mawk #57).
237 + cast parameter of srand() to double if it is not already (patch by
238 "q3cpma", Original-Mawk #66).
239 + manpage fixes (report/suggested by David Apps).
240 + fix parsing of "--" token on command-line, from 20200828 changes
241 (report by Pavel Vinogradov).
242 + add a null-pointer check in the case for "-W" when parsing command
243 options (Original-Mawk #68).
244 + improve CF_XOPEN_SOURCE configure macro to avoid clearing the host's
245 definition for _XOPEN_SOURCE if _POSIX_C_SOURCE is defined (report
246 by A. Wilcox).
247 + modify makefile "clean" rule to remove ".i" files.
248 + modify configure script to allow for using clock_gettime vs
249 gettimeofday.
250
251 20230322
252 + remove an unwanted string/number conversion in print.c, from changes
253 in 20200717 (report by Jan Psota).
254 + reduce compiler-warnings in configure script checks.
255
256 20230215
257 + update URLs, changing ftp to https
258 + modify configure.in, moving checks for standard headers before the
259 options, to improve check for arc4random (Redhat #2167291).
260
261 20230203
262 + split up do_printf to fix build with fortified mingw stdio.h
263 + reduce compiler-warnings in configure script checks.
264
265 20221229
266 + fix shellcheck warnings in test-scripts.
267 + updated configure macros
268 + update config.guess, config.sub, and install-sh
269
270 20210824
271 + updated configure macros
272 + update config.guess and config.sub
273
274 20210528
275 + add FreeBSD build-scripts, for test-builds
276 + updated configure macros
277 + update config.guess and config.sub
278
279 20201023
280 + start work on experimental approach to interval-expressions which
281 does not involve loop-unrolling.
282 + improve type-checking for builtin-regex's by using PTR only for the
283 external-regex's.
284 + improve dump format, showing intervals in curly-brace format.
285
286 20201016
287 + improve dump format, showing the jump-targets rather than offsets.
288
289 20201009
290 + show limits for brace-expressions in dump.
291 + change RE_panic to stdarg, and log its message in trace file
292
293 20200925
294 + improve compatibility vs gawk/bwk in gsub handling of backslash by
295 only escaping backslash with itself if those backslashes happen to
296 precede a "&", e.g., "\\&" vs "\\" (Original-Mawk #14).
297 + fix a regression in recent command-line option parsing.
298 + modify configure/makefile to use .PHONY if available.
299 + review/improve example-scripts
300
301 20200918
302 + build-fix for HP-UX 11.23, which lacks #define's for maximum of
303 int64_t and uint64_t
304 + build-fix for OpenBSD, which mis-types int64_t, just like macOS.
305 + build-fix for macOS, which mis-types int64_t
306
307 20200911
308 + improve range of printf/sprintf for decimal formats by using the
309 unsigned limit if the value is positive.
310 + improve checks for command-line numeric options.
311 + allow long-options to be abbreviated.
312
313 20200828
314 + modify configure script to move gcc -Werror flags to EXTRA_CFLAGS
315 to avoid breaking configure-checks.
316 + use sprintf-buffer for intermediate output of strftime, to handle
317 extra-long format strings.
318 + modify MAWK_LONG_OPTIONS "ignore" to limit that to the "-xxx" options
319 in this set of changes, plus the existing --lint/--lint-old options.
320 + allow -Wxxx options to use long-option format as -xxx, for better
321 script-compatibility with gawk.
322 + use standard output for -Whelp, but show usage message in standard
323 error when no command arguments are given.
324 + print version for -Wversion consistently in standard output.
325 + improve use of const for making tables readonly.
326 + change -W compat to -W traditional for better script-compatibility
327 with gawk.
328
329 20200821
330 + completed first draft of mawk-code.7
331
332 20200807
333 + begin man/mawk-code.7
334 + drop noweb dependency, move docs to man/mawk-arrays.7
335
336 20200731
337 + amend fix for Debian #303825 to more closely match gawk and BWK.
338 Those use larger data types, e.g., long vs int, for limits, and also
339 provide for using int64_t and uint64_t. Internally, mawk now uses
340 long long's where those are supported.
341 + add --help and --version options
342
343 20200724
344 + modify logic for "{0}" in rexp.c so that a left-parenthesis is not
345 trimmed when cancelling the previous token.
346 + modify RE_cat to add a dummy M_ACCEPT as a workaround for logic in
347 the new RE_init_it_cnt and RE_set_limit functions.
348 + modify regexp_system.c to work with interval-expressions.
349 + recognize gawk's --traditional and --posix as aliases for mawk's
350 -W options, as well as -r and --re-interval to improve scripting
351 compatibility.
352 + add -W compat and -W posix, using the former to replace
353 -W repetitions and the latter to replace -W posix_space
354 + enable interval-expressions by default.
355
356 20200717
357 + add configure option "--disable-interval-expr"
358 > integrated/adapted changes by James Parkinson (jlp765):
359 + add regexp intervals,
360 + add tests for intervals to test/mawktest and associated
361 test/repetitions files,
362 + add -W repetitions to enable r{m,n}
363 + add man page updates to man/mawk.1
364
365 20200708
366 + update manpage comment about "nextfile" (AustinGroup #607).
367 + amend manpage comment about "fflush" (AustinGroup #634).
368 + amend manpage comment about "delete array" (AustinGroup #544).
369 + updated configure macros
370 + update config.guess and config.sub
371
372 20200120
373 + resync with my-autoconf.
374 + fix typos found with codespell.
375 + when reading input in interactive mode, provide for extending the
376 buffer size for very long lines (Original-Mawk #59).
377
378 20200106
379 + correct line-number shown in too-many-arguments error message for
380 the case where the function is a forward reference (report by
381 "mukti").
382 + fix install for manpage when configure --srcdir option is used
383 (report by Rajeev V Pillai).
384 + use both CFLAGS/LDFLAGS when linking in makefile (report by
385 Rajeev V Pillai).
386 + fix clang-9 warning in bi_funct.c (report by Rajeev V Pillai).
387 + minor improvement to gcc warning options, from vile
388
389 20191231
390 + updated configure macros
391 + update config.guess and config.sub
392
393 20190203
394 + improve manpage formatting, e.g., for man2html
395 + improve debug-traces
396
397 20190129
398 + eliminate non-portable tdestroy() from zmalloc no-leaks code.
399 + updated configure macros
400 + update config.guess and config.sub
401
402 20181114
403 + revert a change for memory-leaks which made the forced-exit via a
404 user function inconsistent with earlier versions (report by Andre
405 Sihera).
406 + amend a change for memory-leaks to avoid a double-free (Original-Mawk
407 #56).
408
409 20171017
410 + add Debian compile/link flags to test-package.
411 + cleanup spurious warnings from latest gcc.
412 + changes for Original-Mawk #48:
413 + add checks for stack overflow and underflow
414 + increase stack limit to 1024
415 + updated configure macros
416 + update config.guess and config.sub
417
418 20161120
419 + add runtime check for assignments to OFMT and CONVFMT to ensure
420 they use a single parameter (Original-Mawk #47).
421 + repair build for --with-valgrind, broken in 20160930 const-fixes.
422
423 20161107
424 + correct sign-extension from 20160615 change to rand() (report by
425 Christian Neukirchen).
426
427 20160930
428 + optimize closes on regular expressions to filter out redundant
429 wildcards, fixing a special case leftover by changes in 20100224
430 (Original-Mawk #34).
431 + add regular-expressions to the -Wdump option when using mawk's
432 built-in regular expressions.
433 + fix a sign-extension in character-class parser (Original-Mawk #46).
434 + minor optimizations.
435 + improve use of const in tables.
436
437 20160927
438 + allow single-quote as a flag in printf, to complete the change
439 for LC_NUMERIC in 20121129 (report by Graham Monteith).
440 + revert one of the fixes made for a Coverity warning about loss of
441 precision in 20121209, which unnecessarily exposed a different
442 problem (Original-Mawk #45).
443
444 20160918
445 + simplify "system()" function by calling C "system()" function, and
446 use POSIX macros for wait-status to provide a less-ambiguous return
447 value (suggested by Aharon Robbins).
448 + add a null-pointer check in bi_mktime (patch by Ismael Luceno).
449
450 20160905
451 + escape '/' in range for test/reg4.awk to allow test-comparison with
452 gawk and BWK.
453 + updated configure macros, e.g., for compiler warnings and static
454 analysis:
455 + CF_CC_ENV_FLAGS
456 + CF_GNU_SOURCE
457 + CF_PROG_LINT
458 + CF_RAND
459 + CF_XOPEN_SOURCE
460 + minor build-fix for HPUX 11.11 "make", which is confused by the
461 recursive use of "make" in clean/distclean rules.
462 + amend fix for Gentoo #424137 to eliminate a memory leak when opening
463 files (Original-Mawk #44).
464 + update config.guess and config.sub
465
466 20160615
467 + correct range when using system rand() function, which was 0..2
468 rather than 0..1 on BSD systems (report/patch by Masaki Waga).
469
470 20160313
471 + correct order of checks for machine state in REtest which caused an
472 out-of-bounds reference (Original-Mawk #36).
473
474 20160226
475 + update COPYING from
476 https://www.gnu.org/licenses/old-licenses/gpl-2.0.txt
477 (Original-Mawk #38).
478 + minor updates to configure script macros
479 + update config.guess and config.sub
480
481 20150503
482 + add --with-man2html configure option
483 + improve description of -W options and how they can be combined into
484 a comma-separated list (adapted from Leif LeBaron).
485 + modify parsing for -Wexec to permit its value to be separated by '='
486 in addition to a space, for consistency with the other -W options.
487 + cosmetic changes to configure script macros, from work on xterm.
488 + update config.guess and config.sub
489
490 20141206
491 + Mawk behaves incorrectly when using the nextfile statement. It marks
492 the file as dead, but does not check such state and thus ends reading
493 from a closed fd (patch by Ismael Luceno).
494
495 20141027
496 + remove a special check for anchored regular expressions in gsub3
497 which did not handle expressions with "|" alternation (report by
498 "Ypnose").
499
500 20140914
501 + rename vs6.mak / vs6.h to vs2008 for Visual Studio 2008 compiles.
502 + remove MS-DOS support.
503 + add a check in split for empty regex, treating that the same as an
504 empty string (Original-Mawk #9).
505 + correct inconsistently-ifdef'd reset of errno in check_strnum()
506 function, which caused some values to be internally classified as
507 strings rather than strnums (Original-Mawk #26).
508 + add parameter to REmatch to control use of REG_NOTBOL and its
509 equivalent in mawk (prompted by discussion with Mike Brennan,
510 Original-Mawk #24).
511 + settle on "gsub3" implementation (suggested by Mike Brennan,
512 Original-Mawk #11).
513 + change default for configure option --enable-init-srand to enable
514 this (discussion with Mike Brennan).
515 + add -W random option to set initial srand() seed.
516 + add TraceVA, use to provide debug-traces for errmsg().
517 + add note in manpage about "nextfile", see for example:
518 http://www.opengroup.org/austin/docs/austin_578.txt
519 http://austingroupbugs.net/view.php?id=607
520 + make it possible to build with "bsd" library ported to Linux by
521 setting LIBS=-lbsd before running configure script.
522 + show random-function names in version message, as well as maximum
523 integer-value.
524 + modify initialization of srand default seed from time of day to use
525 gettimeofday, etc., so that successive runs of mawk are less likely
526 to use the same seed value (suggested by Mike Brennan).
527 + make a further refinement, "gsub3" which uses a single pass.
528 + change SType and SLen types to improve performance as well as
529 handling larger regular expressions (suggested by Mike Brennan).
530 + fix some minor issues reported by Coverity.
531 + regenerate parse.c using byacc 20140422
532 + modify makefile-rule for generating parse.c to keep the "#line"
533 preprocessor lines consistent with the actual filename. This is
534 needed by lcov.
535 + add test/reg7.awk to help with recent testing.
536 + discard intermediate new_gsub used for regression-testing, will do
537 further improvements based on "gsub2".
538 + fix a comparison in rexp3.c to work with embedded nulls (patch by
539 Mike Brennan).
540 + in-progress changes to implement "gsub2", which will reduce copying.
541 + discard intermediate old_gsub used for regression-testing, using
542 original gsub function renamed to "gsub0" for that purpose.
543 + remove old compiler information from version message.
544 + remove NF value from version message.
545 + patches by Mike Brennan:
546 + changed the intermediate storage of STRINGS used by split.
547 + cleaned up the xxx_split() functions.
548 a) removed hand loop unrolling. What was an optimization for
549 intel 8086/88 is silly today.
550 b) consequence of a) some macros went away so the code is easier
551 to read/understand.
552 c) handles null in input string
553 Note: re_split() does \x00 null correctly, but it calls
554 REmatch() which does not. I have examples where REmatch works
555 with nulls and examples of not working. That needs to be fixed.
556 + changed field allocation to support no upper limit.
557 + when comparing two strings, allow for embedded nulls.
558 + add checks in rexp3.c for infinite loop for testcase noloop.awk
559 (report by Tibor Palinkas).
560 + improve test-package for debian by adding postrm script to restore
561 "mawk-base" to its unalternatized configuration, as well as adding
562 messages to the other pre/post scripts.
563 + patches by Mike Brennan:
564 + increase some limits: NF is now 1048575, sprintf limit is 8192.
565 + updated array.w; mostly documentation improvements
566 + add array.pdf generated from array.w
567 + add -Wu / -Wusage / -Wh / -Whelp to show usage message, like gawk.
568 If long options are enabled, honor --help and --usage as well.
569 + if no command-line parameters are given, show usage message like
570 gawk and BWK (report by Michael Sanders).
571 + improve configure macros CF_ADD_CFLAGS, CF_ADD_LIBS, CF_XOPEN_SOURCE,
572 e.g., for Minix3.2 port.
573 + restore in-progress change to gsub; resolved problem handling its
574 internal use of vectors for second parameter when "&" marker is used.
575 + improve configure check for Intel compiler warnings; trim unwanted
576 -no-gcc option.
577 + for Solaris suppress the followup check for defining _XOPEN_SOURCE
578 + update config.guess and config.sub
579
580 20131226
581 + add configure check to work around recent breakage in Cygwin's math.h
582 which declares _LIB_VERSION without allowing it to be updated (report
583 by Gert Hulselmans).
584 + minor updates to configure script, for clang and mingw
585 + update config.guess and config.sub
586
587 20130803
588 + minor updates to configure script
589 + add limit-checks, improve index computation in scan.c to fix old
590 1.3.3 problems with very long string-literals in the parsed script
591 (report by Marcin Krol).
592 + update config.guess and config.sub
593
594 20130219
595 + modify missing-operand check in rexp.c to allow the case of empty
596 "()", matching behavior of gawk and BWK (report by Arkadiusz
597 Miskiewicz).
598 + revert in-progress change to gsub retain ifdef'd for additional
599 development since it did not handle array as the second parameter
600 (report by Arkadiusz Miskiewicz).
601
602 20121209
603 + build-fix for cygwin in matherr.c, which declares a different type
604 for _LIB_VERSION
605 + add missing "-f" option in examples/gdecl.awk
606 + fix a regression in fflush, ensuring that it returns an error if
607 the argument does not match any output filename (report by Nathan
608 Weeks).
609 + modify wording of configure --help message to make it clear that
610 the default for --with-builtin-regex uses the builtin regular
611 expression engine of mawk.
612 + fix issues reported by Coverity scan. Most of these were minor,
613 and were addressed by modifying the source to allow Coverity to
614 improve its analysis of the code.
615 + amend support for LC_NUMERIC by translating period to the local
616 decimal separator as needed to work with strtod() which is used
617 to validate decimal constants when scanning source files. This
618 fixes an infinite loop with
619 mawk 'BEGIN { print 1.0 }'
620 (report by Jan Psota).
621 + regenerate man/mawk.doc, overlooked in previous updates.
622
623 20121129
624 + change behavior if internal fflush call fails: rather than exiting
625 with an error, propagate the return value to the script as -1, for
626 consistency with gawk and BWK (discussion with Aharon Robbins and
627 Nathan Weeks).
628 + add special case for forward reference to a function using an array
629 parameter, updating the function's parameter type so that the array
630 is passed properly.
631 + support length(array), as done in gawk and BWK awk (Original-Mawk #1).
632 + support LC_NUMERIC, which will modify the displayed decimal point in
633 some locales. It does not modify the decimal point used for input,
634 matching the behavior of nawk and BWK awk (prompted by request from
635 Yechiel Bardov for thousands-separator).
636 + add configure option --enable-init-srand to allow choice whether to
637 initialize random numbers automatically at startup or not. Not doing
638 this makes programs more predictable (Debian #63843, Original-Mawk
639 #3).
640 + add configure option --enable-builtin-srand, use that to deprecate
641 mawk's builtin srand/rand functions which generally are not as good
642 as the system-provided functions.
643 + extend --enable-trace configure option to show builtin functions.
644 + add systime and mktime functions
645 + when warning about unrecognized options, do not exit with error
646 on these gawk options:
647 --lint
648 --lint-old
649 --posix
650 --re-interval
651 --traditional
652 + integrate strftime function (patch by Dominic Letz, Original-Mawk #2).
653 + correct logic for "/dev/stdin" special device (GenToo #424137,
654 Original-Mawk #17).
655 + updates for configure script macros:
656 + modify configure script and makefile to support cross-compiles.
657 + remove Turbo C++ and Zortech C++ makefiles.
658 + remove obsolete function-checks: fmod, memcpy, strchr, strerror,
659 strtod, vfprintf.
660 + remove obsolete checks for some headers: math.h, stdarg.h,
661 stdlib.h, string.h time.h
662 + support --datarootdir option.
663 + add 3rd parameter to AC_DEFINE's to allow autoheader to run.
664 + remove unused macros.
665 + update config.guess and config.sub
666 + add icons for webpage artwork
667
668 20120627
669 + add "/dev/stdin" name for stdin for consistency with other
670 implementations of awk (suggested by Aharon Robbins).
671 + improve overflow check in check_strnum() (Ubuntu #485574).
672 + implement gawk extension "nextfile" (suggested by Aharon Robbins).
673 + updates for configure macros CF_ANSI_CC_CHECK, CF_ENABLE_TRACE,
674 CF_GCC_ATTRIBUTES, CF_GCC_WARNINGS, CF_MAKE_TAGS, CF_MSG_LOG,
675 CF_REGEX, CF_XOPEN_SOURCE.
676 + update config.guess and config.sub
677
678 20101210
679 + update copyright notices to reflect changes made starting 20080909.
680 This commit was made in May 2012, updates only copyright notices
681 needed for project registration on Savannah as discussed in Debian
682 #554167. However, since current policy on Savannah discriminates
683 against GPLv2, it will be hosted elsewhere. See
684 http://invisible-island.net/mawk/
685 http://github.com/ThomasDickey
686
687 20101207
688 + add configure --enable-trace, to consolidate various debugging
689 traces which were written to stderr. This writes to Trace.out.
690 + modify zmalloc.c to make it simpler to use the --disable-leaks
691 configure script option to analyze memory leaks. The memory pool
692 which interferes with analysis can be disabled by defining
693 DEBUG_ZMALLOC.
694 + (IN-PROGRESS) convert gsub() function from recursive, to
695 non-recursive to lessen use of program stack (Debian #158481).
696 + escape some dashes in manpage, to work with groff.
697 + change section for Debian package to "interpreters" (Debian #442071).
698 + fix printable token value for SC_MATCH in scan.c (report by Heiner
699 Marxen).
700
701 20100625
702 + correct translation of octal and hex escapes for system regular
703 expression library.
704 + modify configure script to support --program-suffix, etc.
705 + add Debian package scripts, for "mawk-cur".
706 + add RPM spec-file.
707 + move release- and patch-level values from version.c to patchlev.h
708 to simplify packaging scripts.
709
710 20100618
711 + correct translation of "^{" pattern for system regular expression
712 library (report by Elias Pipping).
713 + fix sentence fragment in README (report by Elias Pipping).
714
715 20100507
716 + cleanup gcc warnings for 64-bit platform, e.g., use size_t rather
717 than unsigned, etc.
718 + fix warnings from clang --analyze
719 + update/improve configure script
720 + modify CF_GCC_VERSION to ignore stderr, e.g., from c89 alias
721 + modify CF_GCC_WARNINGS, moving -W and -Wall into the list to check,
722 since c89 alias for gcc complains about these options.
723 + add --disable-leaks and related options, for testing.
724 + add lint rule to makefile.
725 + add configure-check for ctags to work with pkgsrc.
726 + amend change of array.w, fixes a regression in "delete" (report by
727 Heiner Marxen).
728
729 20100419
730 + modify split() to handle embedded nulls in the string to split, e.g.,
731 BEGIN{s="a\0b"; print length(s); n = split(s,f,""); print n}
732 (report by Morris Lee).
733
734 + modify array.w to update table pointers in the special case where
735 an array is known to have string-indices, but is later indexed via
736 integers. The problem occurs when the array grows large enough to
737 rehash it, e.g.,
738 BEGIN{a["n"];for(i=1;i<1000;++i)printf "%d\n", a[i]; }
739 (report by Morris Lee).
740
741 + increase size of reference-count for strings to unsigned. It was an
742 unsigned short, which prevented using arrays larger than 64k, e.g.,
743 BEGIN{for(i = 1; i <= 65550; ++i){if(i >= 65534 && i<= 65537) print i; s[i] = "a"}; delete s;}
744 (report by Morris Lee).
745
746 + add special case for Solaris 10 (and up) to configure check
747 CF_XOPEN_SOURCE
748
749 + refactored configure check CF_REGEX
750
751 20100224
752 + add a configure check for large files (report by Sean Kumar).
753
754 + modify check in collect_RE() to show the actual limit value, e.g.,
755 MIN_SPRINTF-2 used for built-in regular expressions.
756
757 + increase MIN_SPRINTF, used as limit on regular-expression size, to
758 match the MAX_SPLIT value, i.e., slightly more than doubling the size
759 (report by Markus Gnam).
760
761 + further modify makefile to build outside the source-tree.
762
763 + modify makefile and mawktest to use relative path again, since the
764 existing script did not work with openSUSE's build (patch by Guido
765 Berhoerster).
766
767 + fix makefile's .c.i rule, which lacked CPP definition.
768
769 + update mawktest.bat script to more/less correspond with mawktest,
770 for Win32 console except where echo command does not handle the
771 required quoting syntax.
772
773 + add vs6.mak, for Visual Studio 6.
774
775 + modify mawktest script to report results from all tests, rather than
776 halting on the first failure.
777
778 + add limit-check after processing match(test, "[^0-9A-Za-z]") to
779 ensure the internal trailing null of the test-string is not mistaken
780 for part of the string, i.e., RSTART, RLENGTH are computed correctly
781 (report by Markus Gnam).
782
783 + modify parsing of -W option to use comma-separated values, e.g.,
784 "-Wi,e" for "-Winteractive" and "-Werror".
785
786 + add timestamp to scancode.c, to help manage revisions.
787
788 + improve configure macro CF_XOPEN_SOURCE, making it remove possibly
789 conflicting definitions before adding new ones.
790
791 + update config.guess and config.sub
792
793 > patches by Jan Psota:
794
795 + improve buffering for -Winteractive option.
796
797 + allow multiple single-character flags after -W, e.g., "-Wie" for
798 "-Winteractive" and "-Werror" to permit these to be passed on a
799 "#"-line of a shell script, e.g.,
800 #!/usr/bin/mawk -Wie
801
802 > patches by Jonathan Nieder:
803
804 + add new M_SAVE_POS and M_2JC operation codes (states) to the
805 built-in regular expression engine. Use these to reimplement
806 m* (closure), to provide a way to avoid infinite looping on
807 matches against empty strings. This change requires reimplementing
808 the workaround for gawk's noloop1 testcase from 20090726.
809
810 + improve buffer-overflow check for string_buff.
811
812 + fix collect_RE to treat "[^]]" as a character class (meaning "not a
813 closing bracket") but "[^^]]" not as one. This also requires
814 initializing the local "start of character class" variable to NULL
815 rather than the beginning of the string, to avoid an invalid array
816 access when collecting expressions such as "^text".
817
818 + within a character class and not followed by a :, ., or ~, a "[" is
819 just like any other character. This way, you can tell mawk to scan
820 for a literal [ character with "mawk /[[]/", and you can scan for a [
821 or ] with "mawk /[][]/". Also clean up the relevant loop in
822 do_class() to make it a bit more readable.
823
824 + outside a character class, a "]" is just like any other character.
825
826 + prevent do_class() from scanning past the end, e.g., if the
827 terminating zero byte was escaped.
828
829 + fix regular-expression parsing when a right parenthesis ")" is
830 found without a preceding left parenthesis.
831
832 + fix resetting of position stack when backtracking.
833
834 + modify regular-expression engine to avoid exponential running time
835 for some regular expression matches in which the first match mawk
836 finds extends to the end of the string. This is a new fix for the
837 gawk noloop2 test, added here for regression testing.
838
839 20091220
840 + bump version to 1.3.4
841
842 + update INSTALL and README files.
843
844 + improve configure checks for math library.
845
846 + change test for NaN to use sqrt() rather than log() to work around
847 cygwin's partly broken math functions.
848
849 + add/use isnanf() to work around other breakage in cygwin math
850 functions.
851
852 + add configure check for _XOPEN_SOURCE, etc., needed to define
853 proper function pointer for sigaction, e.g., on Tru64.
854
855 + add check for sigaction function pointer, whose POSIX form is
856 absent from the cygwin header.
857
858 + extend MAWKBINMODE, adding a third bit which when set will suppress
859 the change for RS or ORS to use CR/LF rather than LF. This is used
860 for MinGW to make the "check" rule in a build work, for instance.
861
862 + add configure check for functions used for pipe/system calls, e.g.,
863 for MinGW where these are absent.
864
865 + add runtime check for floating-point underflow exceptions
866
867 + fix an old 1.3.3 bug in re_split(), which did not check properly for
868 the end of buffer; this broke on Tru64.
869
870 + drop obsolete config-user, v7 and atarist subdirectories
871
872 + improve configure checks for sigaction, making the definitions used
873 in fpe_check.c consistent with matherr.c
874
875 + build fixes for AIX, Tru64.
876
877 + add configure check for 'environ'.
878
879 + remove redundant setlocale() calls; only LC_CTYPE and LC_NUMERIC
880 are used.
881
882 20091213
883 + add makedeps.sh script to aid in updating object dependencies in
884 Makefile.in
885
886 + use "mkdir -p" rather than mkdirs.sh (suggested by Aleksey Cheusov).
887
888 + reformatted this file, to simplify extraction of contributor names.
889
890 + update config.guess and config.sub
891
892 > patches by Jonathan Nieder:
893
894 + modify CF_DISABLE_ECHO autoconf macro to ensure that command lines
895 in Makefile.in begin with a tab.
896
897 + the makefile does not use $(MAKE); remove the SET_MAKE substitution.
898
899 + add some files to the "make clean" rule, in case make gets
900 interrupted in the middle of a rule.
901
902 + add a maintainer-clean rule to the makefile, to remove files which
903 could be regenerated.
904
905 + fix an unescaped "-" in man/mawk.1
906
907 + remove an unneeded cast in bi_funct.c
908
909 + fix an unused parameter warning in matherr.c
910
911 + drop unused line_no parameter from compile_error() and its callers.
912
913 + convert makescan.c to ANSI C, do further cleanup of that file.
914
915 + split-out scancode.h from scan.h
916
917 20090920
918 + improve hash function by using FNV-1 algorithm (patch/analysis by
919 Jim Mellander). This greatly improves speed for accessing arrays
920 with a large number of distinct keys; however the unsorted order in
921 "for" loops will differ.
922
923 + add "internal regex" or "external regex" string to version message to
924 allow scripting based on support for embedded nulls.
925
926 + drop obsolete CF_MAWK_PROG_GCC and CF_MAWK_PROG_YACC macros from
927 configure script (report by Mike Frysinger).
928
929 + fixes to allow build outside source-tree (report by Mike Frysinger).
930
931 + correct logic in scan.c to handle expression "[[]" (report by Aleksey
932 Cheusov).
933
934 + add MAWK_LONG_OPTIONS feature to allow mawk to ignore long options
935 which are not implemented.
936
937 + two changes for embedded nulls, allows FS to be either a null or
938 contain a character class with null, e.g., '\000' or '[ \000]':
939
940 + modify built-in regular expression functions to accept embedded
941 nulls.
942
943 + modify input reader FINgets() to accept embedded nulls in data read
944 from files. Data read from standard input is line-buffered, and is
945 still null-terminated.
946
947 + update config.guess and config.sub
948
949 20090820
950 + minor portability/standards fixes for examples/hical
951
952 + add WHINY_USERS sorted-array feature, for compatibility with gawk
953 (patch by Aharon Robbins).
954
955 + correct lower-limit for d_to_U() function, which broke conversion of
956 zero in "%x" format, added in fix for Debian #303825 (report by
957 Masami Hiramatsu).
958
959 + modify "%s" and "%c" formatting in printf/sprintf commands to ensure
960 that "%02s" does not do zero-padding, for standards conformance
961 (discussion with Aharon Robbins, Mike Brennan, prompted by Debian
962 #339799).
963
964 20090728
965 + add fallback definitions for GCC_NORETURN and GCC_UNUSED to build
966 with non-gcc compilers (report by Jan Wells).
967
968 20090727
969 + add check/fix to prevent gsub from recurring to modify on a substring
970 of the current line when the regular expression is anchored to the
971 beginning of the line; fixes gawk's anchgsub testcase.
972
973 + add check for implicit concatenation mistaken for exponent; fixes
974 gawk's hex testcase.
975
976 + add character-classes to built-in regular expressions.
977
978 + add 8-bit locale support
979
980 20090726
981 + improve configure checks for MAX__UINT.
982
983 + add a check for infinite loop in REmatch(), to work with gawk's
984 noloop1 testcase.
985
986 + modify logic to allow setting RS to an explicit null character, e.g.,
987 RS="\0"
988 (Ubuntu #400409).
989
990 + modify workaround for (incorrect) scripts which use a zero-parameter
991 for substr to ensure the overall length of the result stays the same.
992 For example, from makewhatis:
993 filename_no_gz = substr(filename, 0, RSTART - 1);
994
995 + move regular-expression files into main directory to simplify
996 building using configure --srcdir and VPATH.
997
998 + modify internal functions for gsub() to handle a case from makewhatis
999 script from man 1.6f which substitutes embedded zero bytes to a
1000 different value (report by Gabor Z Papp).
1001
1002 + change default for configure --with-builtin-regex to prefer the
1003 builtin regular expressions. They are incomplete, but POSIX regular
1004 expressions cannot match nulls embedded in strings.
1005
1006 + require standard C compiler; converted to ANSI C.
1007
1008 + rename #define'd SV_SIGINFO to MAWK_SV_SIGINFO to avoid predefined
1009 name on Mac OS X (report on comp.lang.awk).
1010
1011 + revise configure script to use conventional scheme for generating
1012 config.h
1013
1014 20090721
1015 + port to cygwin, modifying test-script to work with executable-suffix
1016 and fp-exception code to allow const in declaration.
1017
1018 20090712
1019 + bump patch-date.
1020
1021 + fix Debian #127293 "mawk does not understand unescaped '/' in
1022 character classes", noting that gawk 3.1.6 also has problems with
1023 this area.
1024
1025 + drop support for varargs; use stdarg only.
1026
1027 + add tags rule to makefile.
1028
1029 + rename configure option "--with-local-regexp" to
1030 "--with-builtin-regex"
1031
1032 + add build-fix from NetBSD port: enable vax FP support when
1033 defined(__vax__) as well as BSD43_VAX. from ragge.
1034
1035 + add configure --disable-echo option
1036
1037 + identify updated files with "MawkId" keywords, retaining old log
1038 comments for reference. Ongoing changes are recorded here.
1039
1040 + change maintainer email address to my own.
1041
1042 20090711
1043 + use conventional install/uninstall rules in makefile.
1044
1045 + add install-sh script, mkdirs.sh, config.guess and config.sub
1046
1047 + add $DESTDIR support to makefile
1048
1049 + add uninstall make-target
1050
1051 + add configure --enable-warnings option (fixed some warnings...)
1052
1053 + change configure script to autoconf 2.52 to permit cross-compiles.
1054
1055 + drop config.user file; replace with conventional autoconf --prefix,
1056 etc.
1057
1058 + fill-in CA_REC.type in two places in parse.y which weren't
1059 initialized.
1060
1061 + fix Debian #38353 (absent expression on last part of "for" statement
1062 caused core-dump).
1063
1064 + fix Debian #303825 (printf %x clamps numbers to signed range rather
1065 than unsigned range).
1066
1067 + apply fix from Debian #355966 (null-pointer check in
1068 is_string_split())
1069
1070 + apply fix from Debian #391051 (limit-check in scan.c)
1071
1072 20090709
1073 + add support for external regexp libraries (patch by Aleksey Cheusov)
1074 (originally comp.lang.awk June 15 2005, also cited in Debian #355442
1075 March 6, 2006).
1076
1077 20090705
1078 + fixes to build on BeOS (if LIBS is set to -lroot), and QNX
1079 (redefinition of setmode).
1080
1081 20080909
1082 + fix gcc 4.3.1 -Wall warnings
1083
1084 + transform mawk.ac.m4 to aclocal.m4, renaming macros to use "CF_" or
1085 "CF_MAWK_" prefixes depending on their reusability. Modified macros
1086 to use quoting consistent with recent autoconf versions.
1087
1088 + regenerate configure with autoconf version 2.13.20030927
1089
1090 + regenerate parse.c with byacc - 1.9 20080827
1091
1092 + ifdef'd prototypes in nstd.h which belong to stdlib.h, string.h to
1093 use standard C by default.
1094
1095 + source-in Debian patches 01-08 (see below). Changes for 20080909 fix
1096 Debian #496980 as well.
1097
1098 -------------------------------------------------------------------------------
1099 Debian patches:
1100
1101 (Peter Eisentraut <[email protected]> Sat, 05 Apr 2008 17:11:11 +0200)
1102
1103 08_fix-for-gcc3.3
1104 Debian #195371
1105
1106 (James Troup <[email protected]> Fri, 30 May 2003 15:24:50 +0100)
1107
1108 07_mawktest-check-devfull
1109 Debian #51875
1110
1111 06_parse.y-semicolons
1112 Debian #170973
1113
1114 05_-Wall-fixes
1115
1116 04_mawk.1-fix-pi
1117 Debian #103699
1118
1119 03_read-and-close-redefinition
1120 Debian #104124
1121
1122 02_fix-examples
1123 Debian #36011
1124
1125 01_error-on-full-fs
1126 Debian #28249
1127 Debian #4293
1128
1129 -------------------------------------------------------------------------------
1130 1.3.1 -> 1.3.2 Sep 1996
1131
1132 1) Numeric but not integer indices caused core dump in new array scheme.
1133 Fixed bug and fired test division.
1134
1135 2) Added ferror() checks on writes.
1136
1137 3) Added some static storage specs to array.c to keep non-ansi
1138 compilers happy.
1139
1140 1.3 -> 1.3.1 Sep 1996
1141 Release to new ftp site ftp://ftp.whidbey.net.
1142
1143 1) Workaround for overflow exception in strtod, sunos5.5 solaris.
1144
1145 2) []...] and [^]...] put ] in a class (or not in a class) without
1146 having to use back-slash escape.
1147
1148 1.2.2 -> 1.3 Jul 1996
1149 Extensive redesign of array data structures to support large arrays and
1150 fast access to arrays created with split. Many of the ideas in the
1151 new design were inspired by reading "The Design and Implementation of
1152 Dynamic Hashing Sets and Tables in Icon" by William Griswold and
1153 Gregg Townsend, SPE 23,351-367.
1154
1155 1.2.1 -> 1.2.2 Jan 1996
1156
1157 1) Improved autoconfig, in particular, fpe tests. This is far from
1158 perfect and never will be until C standardizes an interface to ieee754.
1159
1160 2) Removed automatic error message on open failure for getline.
1161
1162 3) Flush all output before system(). Previous behavior was to only
1163 flush std{out,err}.
1164
1165 4) Explicitly fclose() all output on exit to work around AIX4.1 bug.
1166
1167 5) Fixed random number generator to work with longs larger than
1168 32bits.
1169
1170 6) Added a type Int which is int on real machines and long on dos machines.
1171 Believe that all implicit assumptions that int=32bits are now gone.
1172
1173 -------------------------------------------------------------------------------
1174 Changes from version 1.1.4 to 1.2:
1175
1176 1) Limit on code size set by #define in sizes.h is gone.
1177
1178 2) A number of obscure bugs have been fixed such as,
1179 you can now make a recursive function call inside a for( i in A) loop.
1180 Function calls with array parameters in loop expressions sometimes
1181 generated erroneous internal code.
1182
1183 See RCS log comments in code for details.
1184
1185 Reported bugs are fixed.
1186
1187 3) new -W options
1188
1189
1190 -We file : reads commands from file and next argument, regardless
1191 of form, is ARGV[1]. Useful for passing -v , -f etc to
1192 an awk program started with #!/.../mawk
1193
1194
1195 #!/usr/local/bin/mawk -We
1196
1197 myprogram -v works, while
1198
1199 #!/usr/local/bin/mawk -f
1200
1201 myprogram -v gives error message
1202 mawk: option -v lacks argument
1203
1204 This is really a posix bozo. Posix says you end arguments with
1205 "--" , but this doesn't work with the "#!" convention.
1206
1207 -W interactive : forces stdout to be unbuffered and stdin to
1208 be line buffered. Records from stdin are lines regardless of
1209 the value of RS. Useful for interaction with a mawk on a pipe.
1210
1211 -W dump, -Wd : disassembles internal code to stdout (used to be
1212 stderr) and exits 0.
1213
1214 4) FS = "" causes each record to be broken into characters and placed
1215 into $1,$2 ...
1216
1217 same with split(x,A,"") and split(x,A,//)
1218
1219 5) print > "/dev/stdout" writes to stdout, exactly the same as
1220 print
1221
1222 This is useful for passing stdout to
1223
1224 function my_special_output_routine(s, file)
1225 {
1226 # do something fancy with s
1227 print s > file
1228 }
1229
1230 6) New built-in function fflush() -- copied from the lastest att awk.
1231
1232 fflush() : flushes stdout and returns 0
1233 fflush(file) flushes file and returns 0; if file was not an
1234 open output file then returns -1.
1235
1236 7) delete A ; -- removes all elements of the array A
1237
1238 intended to replace:
1239
1240 for( i in A) delete A[i]
1241
1242 8) mawk errors such as compilation failure, file open failure, etc.
1243 now exit 2 which reserves exit 1 for the user.
1244
1245 9) No program now silently exits 0, prior behavior was to exit 2 with
1246 an error message