1*9a7741deSElliott Hughes/**************************************************************** 2*9a7741deSElliott HughesCopyright (C) Lucent Technologies 1997 3*9a7741deSElliott HughesAll Rights Reserved 4*9a7741deSElliott Hughes 5*9a7741deSElliott HughesPermission to use, copy, modify, and distribute this software and 6*9a7741deSElliott Hughesits documentation for any purpose and without fee is hereby 7*9a7741deSElliott Hughesgranted, provided that the above copyright notice appear in all 8*9a7741deSElliott Hughescopies and that both that the copyright notice and this 9*9a7741deSElliott Hughespermission notice and warranty disclaimer appear in supporting 10*9a7741deSElliott Hughesdocumentation, and that the name Lucent Technologies or any of 11*9a7741deSElliott Hughesits entities not be used in advertising or publicity pertaining 12*9a7741deSElliott Hughesto distribution of the software without specific, written prior 13*9a7741deSElliott Hughespermission. 14*9a7741deSElliott Hughes 15*9a7741deSElliott HughesLUCENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, 16*9a7741deSElliott HughesINCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. 17*9a7741deSElliott HughesIN NO EVENT SHALL LUCENT OR ANY OF ITS ENTITIES BE LIABLE FOR ANY 18*9a7741deSElliott HughesSPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 19*9a7741deSElliott HughesWHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER 20*9a7741deSElliott HughesIN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, 21*9a7741deSElliott HughesARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF 22*9a7741deSElliott HughesTHIS SOFTWARE. 23*9a7741deSElliott Hughes****************************************************************/ 24*9a7741deSElliott Hughes 25*9a7741deSElliott HughesThis file lists all bug fixes, changes, etc., made since the AWK book 26*9a7741deSElliott Hugheswas sent to the printers in August 1987. 27*9a7741deSElliott Hughes 28*9a7741deSElliott HughesSep 06, 2023: 29*9a7741deSElliott Hughes Fix edge case where FS is changed on commandline. Thanks to 30*9a7741deSElliott Hughes Gordon Shephard and Miguel Pineiro Jr. 31*9a7741deSElliott Hughes 32*9a7741deSElliott Hughes Fix regular expression clobbering in the lexer, where lexer does 33*9a7741deSElliott Hughes not make a copy of regexp literals. also makedfa memory leaks have 34*9a7741deSElliott Hughes been plugged. Thanks to Miguel Pineiro Jr. 35*9a7741deSElliott Hughes 36*9a7741deSElliott HughesDec 15, 2022: 37*9a7741deSElliott Hughes Force hex escapes in strings to be no more than two characters, 38*9a7741deSElliott Hughes as they already are in regular expressions. This brings internal 39*9a7741deSElliott Hughes consistency, as well as consistency with gawk. Thanks to 40*9a7741deSElliott Hughes Arnold Robbins. 41*9a7741deSElliott Hughes 42*9a7741deSElliott HughesSep 12, 2022: 43*9a7741deSElliott Hughes adjbuf minlen error (cannot be 0) in cat, resulting in NULL pbuf. 44*9a7741deSElliott Hughes discovered by todd miller. also use-after-free issue with 45*9a7741deSElliott Hughes tempfree in cat, thanks to Miguel Pineiro Jr and valgrind. 46*9a7741deSElliott Hughes 47*9a7741deSElliott HughesAug 30, 2022: 48*9a7741deSElliott Hughes Various leaks and use-after-free issues plugged/fixed. 49*9a7741deSElliott Hughes Thanks to Miguel Pineiro Jr. <[email protected]>. 50*9a7741deSElliott Hughes 51*9a7741deSElliott HughesMay 23, 2022: 52*9a7741deSElliott Hughes Memory leak when assigning a string to some of the built-in 53*9a7741deSElliott Hughes variables. allocated string erroneously marked DONTFREE. 54*9a7741deSElliott Hughes Thanks to Miguel Pineiro Jr. <[email protected]>. 55*9a7741deSElliott Hughes 56*9a7741deSElliott HughesMar 14, 2022: 57*9a7741deSElliott Hughes Historic bug: command-line "name=value" assignment had been 58*9a7741deSElliott Hughes truncating its entry in ARGV. (circa 1989) Thanks to 59*9a7741deSElliott Hughes Miguel Pineiro Jr. <[email protected]>. 60*9a7741deSElliott Hughes 61*9a7741deSElliott HughesMar 3, 2022: 62*9a7741deSElliott Hughes Fixed file management memory leak that appears to have been 63*9a7741deSElliott Hughes there since the files array was first initialized with stdin, 64*9a7741deSElliott Hughes stdout, and stderr (circa 1992). Thanks to Miguel Pineiro Jr. 65*9a7741deSElliott Hughes <[email protected]>. 66*9a7741deSElliott Hughes 67*9a7741deSElliott HughesDecember 8, 2021: 68*9a7741deSElliott Hughes The error handling in closefile and closeall was mangled. Long 69*9a7741deSElliott Hughes standing warnings had been made fatal and some fatal errors went 70*9a7741deSElliott Hughes undetected. Thanks to Miguel Pineiro Jr. <[email protected]>. 71*9a7741deSElliott Hughes 72*9a7741deSElliott HughesNov 03, 2021: 73*9a7741deSElliott Hughes getline accesses uninitialized data after getrec() 74*9a7741deSElliott Hughes returns 0 on EOF and leaves the contents of buf unchanged. 75*9a7741deSElliott Hughes Thanks to Volodymyr Gubarkov, and Todd C Miller. 76*9a7741deSElliott Hughes 77*9a7741deSElliott HughesOct 12, 2021: 78*9a7741deSElliott Hughes The fix for #83 changed the code to insert 2 chars, but the 79*9a7741deSElliott Hughes call to adjbuf just above it only allows for 1 char. This can 80*9a7741deSElliott Hughes cause a heap buffer overflow. 81*9a7741deSElliott Hughes 82*9a7741deSElliott HughesJuly 27, 2021: 83*9a7741deSElliott Hughes As per IEEE Std 1003.1-2008, -F "str" is now consistent with 84*9a7741deSElliott Hughes -v FS="str" when str is null. Thanks to Warner Losh. 85*9a7741deSElliott Hughes 86*9a7741deSElliott HughesJuly 24, 2021: 87*9a7741deSElliott Hughes Fix readrec's definition of a record. This fixes an issue 88*9a7741deSElliott Hughes with NetBSD's RS regular expression support that can cause 89*9a7741deSElliott Hughes an infinite read loop. Thanks to Miguel Pineiro Jr. 90*9a7741deSElliott Hughes 91*9a7741deSElliott Hughes Fix regular expression RS ^-anchoring. RS ^-anchoring needs to 92*9a7741deSElliott Hughes know if it is reading the first record of a file. This change 93*9a7741deSElliott Hughes restores a missing line that was overlooked when porting NetBSD's 94*9a7741deSElliott Hughes RS regex functionality. Thanks to Miguel Pineiro Jr. 95*9a7741deSElliott Hughes 96*9a7741deSElliott Hughes Fix size computation in replace_repeat() for special case 97*9a7741deSElliott Hughes REPEAT_WITH_Q. Thanks to Todd C. Miller. 98*9a7741deSElliott Hughes 99*9a7741deSElliott HughesFebruary 15, 2021: 100*9a7741deSElliott Hughes Small fix so that awk will compile again with g++. Thanks to 101*9a7741deSElliott Hughes Arnold Robbins. 102*9a7741deSElliott Hughes 103*9a7741deSElliott HughesJanuary 06, 2021: 104*9a7741deSElliott Hughes Fix a decision bug with trailing stuff in lib.c:is_valid_number 105*9a7741deSElliott Hughes after recent changes. Thanks to Ozan Yigit. 106*9a7741deSElliott Hughes 107*9a7741deSElliott HughesDecember 18, 2020: 108*9a7741deSElliott Hughes Fix problems converting inf and NaN values in lib.c:is_valid_number. 109*9a7741deSElliott Hughes Enhance number to string conversion to do the right thing for 110*9a7741deSElliott Hughes NaN and inf values. Things are now pretty much the same as in 111*9a7741deSElliott Hughes gawk. (Found a gawk bug while we're at it.) Added a torture 112*9a7741deSElliott Hughes test for these values. Thanks to Arnold Robbins. Allows closing 113*9a7741deSElliott Hughes of PR #101. 114*9a7741deSElliott Hughes 115*9a7741deSElliott HughesDecember 15, 2020: 116*9a7741deSElliott Hughes Merge PR #99, which gets the right header for strcasecmp. 117*9a7741deSElliott Hughes Thanks to GitHub user michaelforney. 118*9a7741deSElliott Hughes 119*9a7741deSElliott HughesDecember 8, 2020: 120*9a7741deSElliott Hughes Merge PR #98: Disallow hex data. Allow only +nan, -nan, 121*9a7741deSElliott Hughes +inf, -inf (case independent) to give NaN and infinity values. 122*9a7741deSElliott Hughes Improve things so that string to double conversion is only 123*9a7741deSElliott Hughes done once, yielding something of a speedup. This obviate 124*9a7741deSElliott Hughes PR #95. Thanks to Arnold Robbins. 125*9a7741deSElliott Hughes 126*9a7741deSElliott HughesDecember 3, 2020: 127*9a7741deSElliott Hughes Fix to argument parsing to avoid printing spurious newlines. 128*9a7741deSElliott Hughes Thanks to Todd Miller. Merges PR #97. 129*9a7741deSElliott Hughes 130*9a7741deSElliott HughesOctober 13, 2020: 131*9a7741deSElliott Hughes Add casts before all the calls to malloc/calloc/realloc in order 132*9a7741deSElliott Hughes to get it to compile with g++. Thanks to Arnold Robbins. 133*9a7741deSElliott Hughes 134*9a7741deSElliott HughesAugust 16, 2020: 135*9a7741deSElliott Hughes Additional fixes for DJGPP. Thanks to Eli Zaretskii for 136*9a7741deSElliott Hughes the testing. 137*9a7741deSElliott Hughes 138*9a7741deSElliott HughesAugust 7, 2020: 139*9a7741deSElliott Hughes Merge PR #93, which adds casts to (void*) for debug prints 140*9a7741deSElliott Hughes using the %p format specifier. Thanks to GitHub user YongHaoWu 141*9a7741deSElliott Hughes ("Chris") for the fixes. 142*9a7741deSElliott Hughes 143*9a7741deSElliott HughesAugust 4, 2020: 144*9a7741deSElliott Hughes In run.c, use non-restartable multibyte routines to attain 145*9a7741deSElliott Hughes portability to DJGPP. Should fix Issue 92. Thanks to Albert Wik 146*9a7741deSElliott Hughes for the report and to Todd Miller for the suggested fix. 147*9a7741deSElliott Hughes 148*9a7741deSElliott HughesJuly 30, 2020: 149*9a7741deSElliott Hughes Merge PRs 88-91 which fix small bugs. Thanks to Todd Miller and 150*9a7741deSElliott Hughes Tim van der Molen for the fixes. 151*9a7741deSElliott Hughes 152*9a7741deSElliott Hughes In order to make life easier, we move exclusively to bison 153*9a7741deSElliott Hughes as the parser generator. 154*9a7741deSElliott Hughes 155*9a7741deSElliott HughesJuly 2, 2020: 156*9a7741deSElliott Hughes Merge PRs 85 and 86 which fix regressions. Thanks to 157*9a7741deSElliott Hughes Tim van der Molen for the fixes. 158*9a7741deSElliott Hughes 159*9a7741deSElliott HughesJune 25, 2020: 160*9a7741deSElliott Hughes Merge PRs 82 and 84. The latter fixes issue #83. Thanks to 161*9a7741deSElliott Hughes Todd Miller and awkfan77. 162*9a7741deSElliott Hughes 163*9a7741deSElliott HughesJune 12, 2020: 164*9a7741deSElliott Hughes Clear errno before calling errcheck to avoid any spurious errors 165*9a7741deSElliott Hughes left over from previous calls that may have set it. Thanks to 166*9a7741deSElliott Hughes Todd Miller for the fix, from PR #80. 167*9a7741deSElliott Hughes 168*9a7741deSElliott Hughes Fix Issue #78 by allowing \r to follow floating point numbers in 169*9a7741deSElliott Hughes lib.c:is_number. Thanks to GitHub user ajcarr for the report 170*9a7741deSElliott Hughes and to Arnold Robbins for the fix. 171*9a7741deSElliott Hughes 172*9a7741deSElliott HughesJune 5, 2020: 173*9a7741deSElliott Hughes In fldbld(), make sure that inputFS is set before trying to 174*9a7741deSElliott Hughes use it. Thanks to Steffen Nurpmeso <[email protected]> 175*9a7741deSElliott Hughes for the report. 176*9a7741deSElliott Hughes 177*9a7741deSElliott HughesMay 5, 2020: 178*9a7741deSElliott Hughes Fix checks for compilers that can handle noreturn. Thanks to 179*9a7741deSElliott Hughes GitHub user enh-google for pointing it out. Closes Issue #79. 180*9a7741deSElliott Hughes 181*9a7741deSElliott HughesApril 16, 2020: 182*9a7741deSElliott Hughes Handle old compilers that don't support C11 (for noreturn). 183*9a7741deSElliott Hughes Thanks to Arnold Robbins. 184*9a7741deSElliott Hughes 185*9a7741deSElliott HughesApril 5, 2020: 186*9a7741deSElliott Hughes Use <stdnoreturn.h> and noreturn instead of GCC attributes. 187*9a7741deSElliott Hughes Thanks to GitHub user awkfan77. Closes PR #77. 188*9a7741deSElliott Hughes 189*9a7741deSElliott HughesFebruary 28, 2020: 190*9a7741deSElliott Hughes More cleanups from Christos Zoulas: notably backslash continuation 191*9a7741deSElliott Hughes inside strings removes the newline and a fix for RS = "^a". 192*9a7741deSElliott Hughes Fix for address sanitizer-found problem. Thanks to GitHub user 193*9a7741deSElliott Hughes enh-google. 194*9a7741deSElliott Hughes 195*9a7741deSElliott HughesFebruary 19, 2020: 196*9a7741deSElliott Hughes More small cleanups from Christos Zoulas. 197*9a7741deSElliott Hughes 198*9a7741deSElliott HughesFebruary 18, 2020: 199*9a7741deSElliott Hughes Additional cleanups from Christos Zoulas. It's no longer necessary 200*9a7741deSElliott Hughes to use the -y flag to bison. 201*9a7741deSElliott Hughes 202*9a7741deSElliott HughesFebruary 6, 2020: 203*9a7741deSElliott Hughes Additional small cleanups from Christos Zoulas. awk is now 204*9a7741deSElliott Hughes a little more robust about reporting I/O errors upon exit. 205*9a7741deSElliott Hughes 206*9a7741deSElliott HughesJanuary 31, 2020: 207*9a7741deSElliott Hughes Merge PR #70, which avoids use of variable length arrays. Thanks 208*9a7741deSElliott Hughes to GitHub user michaelforney. Fix issue #60 ({0} in interval 209*9a7741deSElliott Hughes expressions doesn't work). Also get all tests working again. 210*9a7741deSElliott Hughes Thanks to Arnold Robbins. 211*9a7741deSElliott Hughes 212*9a7741deSElliott HughesJanuary 24, 2020: 213*9a7741deSElliott Hughes A number of small cleanups from Christos Zoulas. Add the close 214*9a7741deSElliott Hughes on exec flag to files/pipes opened for redirection; courtesy of 215*9a7741deSElliott Hughes Arnold Robbins. 216*9a7741deSElliott Hughes 217*9a7741deSElliott HughesJanuary 19, 2020: 218*9a7741deSElliott Hughes If POSIXLY_CORRECT is set in the environment, then sub and gsub 219*9a7741deSElliott Hughes use POSIX rules for multiple backslashes. This fixes Issue #66, 220*9a7741deSElliott Hughes while maintaining backwards compatibility. 221*9a7741deSElliott Hughes 222*9a7741deSElliott HughesJanuary 9, 2020: 223*9a7741deSElliott Hughes Input/output errors on closing files are now fatal instead of 224*9a7741deSElliott Hughes mere warnings. Thanks to Martijn Dekker <[email protected]>. 225*9a7741deSElliott Hughes 226*9a7741deSElliott HughesJanuary 5, 2020: 227*9a7741deSElliott Hughes Fix a bug in the concatenation of two string constants into 228*9a7741deSElliott Hughes one done in the grammar. Fixes GitHub issue #61. Thanks 229*9a7741deSElliott Hughes to GitHub user awkfan77 for pointing out the direction for 230*9a7741deSElliott Hughes the fix. New test T.concat added to the test suite. 231*9a7741deSElliott Hughes Fix a few memory leaks reported by valgrind, as well. 232*9a7741deSElliott Hughes 233*9a7741deSElliott HughesDecember 27, 2019: 234*9a7741deSElliott Hughes Fix a bug whereby a{0,3} could match four a's. Thanks to 235*9a7741deSElliott Hughes "Anonymous AWK fan" for the report. 236*9a7741deSElliott Hughes 237*9a7741deSElliott HughesDecember 11, 2019: 238*9a7741deSElliott Hughes Further printf-related fixes for 32 bit systems. 239*9a7741deSElliott Hughes Thanks again to Christos Zoulas. 240*9a7741deSElliott Hughes 241*9a7741deSElliott HughesDecember 8, 2019: 242*9a7741deSElliott Hughes Fix the return value of sprintf("%d") on 32 bit systems. 243*9a7741deSElliott Hughes Thanks to Jim Lowe for the report and to Christos Zoulas 244*9a7741deSElliott Hughes for the fix. 245*9a7741deSElliott Hughes 246*9a7741deSElliott HughesNovember 10, 2019: 247*9a7741deSElliott Hughes Convert a number of Boolean integer variables into 248*9a7741deSElliott Hughes actual bools. Convert compile_time variable into an 249*9a7741deSElliott Hughes enum and simplify some of the related code. Thanks 250*9a7741deSElliott Hughes to Arnold Robbins. 251*9a7741deSElliott Hughes 252*9a7741deSElliott HughesNovember 8, 2019: 253*9a7741deSElliott Hughes Fix from Ori Bernstein to get UTF-8 characters instead of 254*9a7741deSElliott Hughes bytes when FS = "". This is currently the only bit of 255*9a7741deSElliott Hughes the One True Awk that understands multibyte characters. 256*9a7741deSElliott Hughes From Arnold Robbins, apply some cleanups in the test suite. 257*9a7741deSElliott Hughes 258*9a7741deSElliott HughesOctober 25, 2019: 259*9a7741deSElliott Hughes More fixes and cleanups from NetBSD, courtesy of Christos 260*9a7741deSElliott Hughes Zoulas. Merges PRs 54 and 55. 261*9a7741deSElliott Hughes 262*9a7741deSElliott HughesOctober 24, 2019: 263*9a7741deSElliott Hughes Import second round of code cleanups from NetBSD. Much thanks 264*9a7741deSElliott Hughes to Christos Zoulas (GitHub user zoulasc). Merges PR 53. 265*9a7741deSElliott Hughes Add an optimization for string concatenation, also from 266*9a7741deSElliott Hughes Christos. 267*9a7741deSElliott Hughes 268*9a7741deSElliott HughesOctober 17, 2019: 269*9a7741deSElliott Hughes Import code cleanups from NetBSD. Much thanks to Christos 270*9a7741deSElliott Hughes Zoulas (GitHub user zoulasc). Merges PR 51. 271*9a7741deSElliott Hughes 272*9a7741deSElliott HughesOctober 6, 2019: 273*9a7741deSElliott Hughes Import code from NetBSD awk that implements RS as a regular 274*9a7741deSElliott Hughes expression. 275*9a7741deSElliott Hughes 276*9a7741deSElliott HughesSeptember 10, 2019: 277*9a7741deSElliott Hughes Fixes for various array / memory overruns found via gcc's 278*9a7741deSElliott Hughes -fsanitize=unknown. Thanks to Alexander Richardson (GitHub 279*9a7741deSElliott Hughes user arichardson). Merges PRs 47 and 48. 280*9a7741deSElliott Hughes 281*9a7741deSElliott HughesJuly 28, 2019: 282*9a7741deSElliott Hughes Import grammar optimization from NetBSD: Two string constants 283*9a7741deSElliott Hughes concatenated together get turned into a single string. 284*9a7741deSElliott Hughes 285*9a7741deSElliott HughesJuly 26, 2019: 286*9a7741deSElliott Hughes Support POSIX-specified C-style escape sequences "\a" (alarm) 287*9a7741deSElliott Hughes and "\v" (vertical tab) in command line arguments and regular 288*9a7741deSElliott Hughes expressions, further to the support for them in strings added on 289*9a7741deSElliott Hughes Apr 9, 1989. These now no longer match as literal "a" and "v" 290*9a7741deSElliott Hughes characters (as they don't on other awk implementations). 291*9a7741deSElliott Hughes Thanks to Martijn Dekker. 292*9a7741deSElliott Hughes 293*9a7741deSElliott HughesJuly 17, 2019: 294*9a7741deSElliott Hughes Pull in a number of code cleanups and minor fixes from 295*9a7741deSElliott Hughes Warner Losh's bsd-ota branch. The only user visible change 296*9a7741deSElliott Hughes is the use of random(3) as the random number generator. 297*9a7741deSElliott Hughes Thanks to Warner Losh for collecting all these fixes in 298*9a7741deSElliott Hughes one easy place to get them from. 299*9a7741deSElliott Hughes 300*9a7741deSElliott HughesJuly 16, 2019: 301*9a7741deSElliott Hughes Fix field splitting to use FS value as of the time a record 302*9a7741deSElliott Hughes was read or assigned to. Thanks to GitHub user Cody Mello (melloc) 303*9a7741deSElliott Hughes for the fix. (Merged from his branch, via PR #42.) Updated 304*9a7741deSElliott Hughes testdir/T.split per said PR as well. 305*9a7741deSElliott Hughes 306*9a7741deSElliott HughesJune 24, 2019: 307*9a7741deSElliott Hughes Extract awktest.tar into testdir directory. Add some very 308*9a7741deSElliott Hughes simple mechanics to the makefile for running the tests and 309*9a7741deSElliott Hughes for cleaning up. No changes to awk itself. 310*9a7741deSElliott Hughes 311*9a7741deSElliott HughesJune 17, 2019: 312*9a7741deSElliott Hughes Disallow deleting SYMTAB and its elements, which creates 313*9a7741deSElliott Hughes use-after-free bugs. Thanks to GitHub user Cody Mello (melloc) 314*9a7741deSElliott Hughes for the fix. (Merged from PR #43.) 315*9a7741deSElliott Hughes 316*9a7741deSElliott HughesJune 5, 2019: 317*9a7741deSElliott Hughes Allow unmatched right parenthesis in a regular expression to 318*9a7741deSElliott Hughes be treated literally. Fixes Issue #40. Thanks to GitHub user 319*9a7741deSElliott Hughes Warner Losh (bsdimp) for the report. Thanks to Arnold Robbins 320*9a7741deSElliott Hughes for the fix. 321*9a7741deSElliott Hughes 322*9a7741deSElliott HughesMay 29,2019: 323*9a7741deSElliott Hughes Fix check for command line arguments to no longer require that 324*9a7741deSElliott Hughes first character after '=' not be another '='. Reverts change of 325*9a7741deSElliott Hughes August 11, 1989. Thanks to GitHub user Jamie Landeg Jones for 326*9a7741deSElliott Hughes pointing out the issue; from Issue #38. 327*9a7741deSElliott Hughes 328*9a7741deSElliott HughesApr 7, 2019: 329*9a7741deSElliott Hughes Update awktest.tar(p.50) to use modern options to sort. Needed 330*9a7741deSElliott Hughes for Android development. Thanks to GitHub user mohd-akram (Mohamed 331*9a7741deSElliott Hughes Akram). From Issue #33. 332*9a7741deSElliott Hughes 333*9a7741deSElliott HughesMar 12, 2019: 334*9a7741deSElliott Hughes Added very simplistic support for cross-compiling in the 335*9a7741deSElliott Hughes makefile. We are NOT going to go in the direction of the 336*9a7741deSElliott Hughes autotools, though. Thanks to GitHub user nee-san for 337*9a7741deSElliott Hughes the basic change. (Merged from PR #34.) 338*9a7741deSElliott Hughes 339*9a7741deSElliott HughesMar 5, 2019: 340*9a7741deSElliott Hughes Added support for POSIX-standard interval expressions (a.k.a. 341*9a7741deSElliott Hughes bounds, a.k.a. repetition expressions) in regular expressions, 342*9a7741deSElliott Hughes backported (via NetBSD) from Apple awk-24 (20070501). 343*9a7741deSElliott Hughes Thanks to Martijn Dekker <[email protected]> for the port. 344*9a7741deSElliott Hughes (Merged from PR #30.) 345*9a7741deSElliott Hughes 346*9a7741deSElliott HughesMar 3, 2019: 347*9a7741deSElliott Hughes Merge PRs as follows: 348*9a7741deSElliott Hughes #12: Avoid undefined behaviour when using ctype(3) functions in 349*9a7741deSElliott Hughes relex(). Thanks to GitHub user iamleot. 350*9a7741deSElliott Hughes #31: Make getline handle numeric strings, and update FIXES. Thanks 351*9a7741deSElliott Hughes to GitHub user Arnold Robbins (arnoldrobbins) 352*9a7741deSElliott Hughes #32: maketab: support build systems with read-only source. Thanks 353*9a7741deSElliott Hughes to GitHub user enh. 354*9a7741deSElliott Hughes 355*9a7741deSElliott HughesJan 25, 2019: 356*9a7741deSElliott Hughes Make getline handle numeric strings properly in all cases. 357*9a7741deSElliott Hughes (Thanks, Arnold.) 358*9a7741deSElliott Hughes 359*9a7741deSElliott HughesJan 21, 2019: 360*9a7741deSElliott Hughes Merged a number of small fixes from GitHub pull requests. 361*9a7741deSElliott Hughes Thanks to GitHub users Arnold Robbins (arnoldrobbins), 362*9a7741deSElliott Hughes Cody Mello (melloc) and Christoph Junghans (junghans). 363*9a7741deSElliott Hughes PR numbers: 13-21, 23, 24, 27. 364*9a7741deSElliott Hughes 365*9a7741deSElliott HughesOct 25, 2018: 366*9a7741deSElliott Hughes Added test in maketab.c to prevent generating a proctab entry 367*9a7741deSElliott Hughes for YYSTYPE_IS_DEFINED. It was harmless but some gcc settings 368*9a7741deSElliott Hughes generated a warning message. Thanks to Nan Xiao for report. 369*9a7741deSElliott Hughes 370*9a7741deSElliott HughesAug 27, 2018: 371*9a7741deSElliott Hughes Disallow '$' in printf formats; arguments evaluated in order 372*9a7741deSElliott Hughes and printed in order. 373*9a7741deSElliott Hughes 374*9a7741deSElliott Hughes Added some casts to silence warnings on debugging printfs. 375*9a7741deSElliott Hughes (Thanks, Arnold.) 376*9a7741deSElliott Hughes 377*9a7741deSElliott HughesAug 23, 2018: 378*9a7741deSElliott Hughes A long list of fixes courtesy of Arnold Robbins, 379*9a7741deSElliott Hughes to whom profound thanks. 380*9a7741deSElliott Hughes 381*9a7741deSElliott Hughes 1. ofs-rebuild: OFS value used to rebuild the record was incorrect. 382*9a7741deSElliott Hughes Fixed August 19, 2014. Revised fix August 2018. 383*9a7741deSElliott Hughes 384*9a7741deSElliott Hughes 2. system-status: Instead of a floating-point division by 256, use 385*9a7741deSElliott Hughes the wait(2) macros to create a reasonable exit status. 386*9a7741deSElliott Hughes Fixed March 12, 2016. 387*9a7741deSElliott Hughes 388*9a7741deSElliott Hughes 3. space: Use provided xisblank() function instead of ispace() for 389*9a7741deSElliott Hughes matching [[:blank:]]. 390*9a7741deSElliott Hughes 391*9a7741deSElliott Hughes 4. a-format: Add POSIX standard %a and %A to supported formats. Check 392*9a7741deSElliott Hughes at runtime that this format is available. 393*9a7741deSElliott Hughes 394*9a7741deSElliott Hughes 5. decr-NF: Decrementing NF did not change $0. This is a decades-old 395*9a7741deSElliott Hughes bug. There are interactions with the old and new value of OFS as well. 396*9a7741deSElliott Hughes Most of the fix came from the NetBSD awk. 397*9a7741deSElliott Hughes 398*9a7741deSElliott Hughes 6. string-conv: String conversions of scalars were sticky. Once a 399*9a7741deSElliott Hughes conversion to string happened, even with OFMT, that value was used until 400*9a7741deSElliott Hughes a new numeric value was assigned, even if OFMT differed from CONVFMT, 401*9a7741deSElliott Hughes and also if CONVFMT changed. 402*9a7741deSElliott Hughes 403*9a7741deSElliott Hughes 7. unary-plus: Unary plus on a string constant returned the string. 404*9a7741deSElliott Hughes Instead, it should convert the value to numeric and give that value. 405*9a7741deSElliott Hughes 406*9a7741deSElliott Hughes Also added Arnold's tests for these to awktest.tar as T.arnold. 407*9a7741deSElliott Hughes 408*9a7741deSElliott HughesAug 15, 2018: 409*9a7741deSElliott Hughes fixed mangled awktest.tar (thanks, Arnold), posted all 410*9a7741deSElliott Hughes current (very minor) fixes to github / onetrueawk 411*9a7741deSElliott Hughes 412*9a7741deSElliott HughesJun 7, 2018: 413*9a7741deSElliott Hughes (yes, a long layoff) 414*9a7741deSElliott Hughes Updated some broken tests (beebe.tar, T.lilly) 415*9a7741deSElliott Hughes [thanks to Arnold Robbins] 416*9a7741deSElliott Hughes 417*9a7741deSElliott HughesMar 26, 2015: 418*9a7741deSElliott Hughes buffer overflow in error reporting; thanks to tobias ulmer 419*9a7741deSElliott Hughes and john-mark gurney for spotting it and the fix. 420*9a7741deSElliott Hughes 421*9a7741deSElliott HughesFeb 4, 2013: 422*9a7741deSElliott Hughes cleaned up a handful of tests that didn't seem to actually 423*9a7741deSElliott Hughes test for correct behavior: T.latin1, T.gawk. 424*9a7741deSElliott Hughes 425*9a7741deSElliott HughesJan 5, 2013: 426*9a7741deSElliott Hughes added ,NULL initializer to static Cells in run.c; not really 427*9a7741deSElliott Hughes needed but cleaner. Thanks to Michael Bombardieri. 428*9a7741deSElliott Hughes 429*9a7741deSElliott HughesDec 20, 2012: 430*9a7741deSElliott Hughes fiddled makefile to get correct yacc and bison flags. pick yacc 431*9a7741deSElliott Hughes (linux) or bison (mac) as necessary. 432*9a7741deSElliott Hughes 433*9a7741deSElliott Hughes added __attribute__((__noreturn__)) to a couple of lines in 434*9a7741deSElliott Hughes proto.h, to silence someone's enthusiastic checker. 435*9a7741deSElliott Hughes 436*9a7741deSElliott Hughes fixed obscure call by value bug in split(a[1],a) reported on 437*9a7741deSElliott Hughes 9fans. the management of temporary values is just a mess; i 438*9a7741deSElliott Hughes took a shortcut by making an extra string copy. thanks 439*9a7741deSElliott Hughes to paul patience and arnold robbins for passing it on and for 440*9a7741deSElliott Hughes proposed patches. 441*9a7741deSElliott Hughes 442*9a7741deSElliott Hughes tiny fiddle in setfval to eliminate -0 results in T.expr, which 443*9a7741deSElliott Hughes has irritated me for 20+ years. 444*9a7741deSElliott Hughes 445*9a7741deSElliott HughesAug 10, 2011: 446*9a7741deSElliott Hughes another fix to avoid core dump with delete(ARGV); again, many thanks 447*9a7741deSElliott Hughes to ruslan ermilov. 448*9a7741deSElliott Hughes 449*9a7741deSElliott HughesAug 7, 2011: 450*9a7741deSElliott Hughes split(s, a, //) now behaves the same as split(s, a, "") 451*9a7741deSElliott Hughes 452*9a7741deSElliott HughesJun 12, 2011: 453*9a7741deSElliott Hughes /pat/, \n /pat/ {...} is now legal, though bad style to use. 454*9a7741deSElliott Hughes 455*9a7741deSElliott Hughes added checks to new -v code that permits -vnospace; thanks to 456*9a7741deSElliott Hughes ruslan ermilov for spotting this and providing the patch. 457*9a7741deSElliott Hughes 458*9a7741deSElliott Hughes removed fixed limit on number of open files; thanks to aleksey 459*9a7741deSElliott Hughes cheusov and christos zoulos. 460*9a7741deSElliott Hughes 461*9a7741deSElliott Hughes fixed day 1 bug that resurrected deleted elements of ARGV when 462*9a7741deSElliott Hughes used as filenames (in lib.c). 463*9a7741deSElliott Hughes 464*9a7741deSElliott Hughes minor type fiddles to make gcc -Wall -pedantic happier (but not 465*9a7741deSElliott Hughes totally so); turned on -fno-strict-aliasing in makefile. 466*9a7741deSElliott Hughes 467*9a7741deSElliott HughesMay 6, 2011: 468*9a7741deSElliott Hughes added #ifdef for isblank. 469*9a7741deSElliott Hughes now allows -ffoo as well as -f foo arguments. 470*9a7741deSElliott Hughes (thanks, ruslan) 471*9a7741deSElliott Hughes 472*9a7741deSElliott HughesMay 1, 2011: 473*9a7741deSElliott Hughes after advice from todd miller, kevin lo, ruslan ermilov, 474*9a7741deSElliott Hughes and arnold robbins, changed srand() to return the previous 475*9a7741deSElliott Hughes seed (which is 1 on the first call of srand). the seed is 476*9a7741deSElliott Hughes an Awkfloat internally though converted to unsigned int to 477*9a7741deSElliott Hughes pass to the library srand(). thanks, everyone. 478*9a7741deSElliott Hughes 479*9a7741deSElliott Hughes fixed a subtle (and i hope low-probability) overflow error 480*9a7741deSElliott Hughes in fldbld, by adding space for one extra \0. thanks to 481*9a7741deSElliott Hughes robert bassett for spotting this one and providing a fix. 482*9a7741deSElliott Hughes 483*9a7741deSElliott Hughes removed the files related to compilation on windows. i no 484*9a7741deSElliott Hughes longer have anything like a current windows environment, so 485*9a7741deSElliott Hughes i can't test any of it. 486*9a7741deSElliott Hughes 487*9a7741deSElliott HughesMay 23, 2010: 488*9a7741deSElliott Hughes fixed long-standing overflow bug in run.c; many thanks to 489*9a7741deSElliott Hughes nelson beebe for spotting it and providing the fix. 490*9a7741deSElliott Hughes 491*9a7741deSElliott Hughes fixed bug that didn't parse -vd=1 properly; thanks to santiago 492*9a7741deSElliott Hughes vila for spotting it. 493*9a7741deSElliott Hughes 494*9a7741deSElliott HughesFeb 8, 2010: 495*9a7741deSElliott Hughes i give up. replaced isblank with isspace in b.c; there are 496*9a7741deSElliott Hughes no consistent header files. 497*9a7741deSElliott Hughes 498*9a7741deSElliott HughesNov 26, 2009: 499*9a7741deSElliott Hughes fixed a long-standing issue with when FS takes effect. a 500*9a7741deSElliott Hughes change to FS is now noticed immediately for subsequent splits. 501*9a7741deSElliott Hughes 502*9a7741deSElliott Hughes changed the name getline() to awkgetline() to avoid yet another 503*9a7741deSElliott Hughes name conflict somewhere. 504*9a7741deSElliott Hughes 505*9a7741deSElliott HughesFeb 11, 2009: 506*9a7741deSElliott Hughes temporarily for now defined HAS_ISBLANK, since that seems to 507*9a7741deSElliott Hughes be the best way through the thicket. isblank arrived in C99, 508*9a7741deSElliott Hughes but seems to be arriving at different systems at different 509*9a7741deSElliott Hughes times. 510*9a7741deSElliott Hughes 511*9a7741deSElliott HughesOct 8, 2008: 512*9a7741deSElliott Hughes fixed typo in b.c that set tmpvec wrongly. no one had ever 513*9a7741deSElliott Hughes run into the problem, apparently. thanks to alistair crooks. 514*9a7741deSElliott Hughes 515*9a7741deSElliott HughesOct 23, 2007: 516*9a7741deSElliott Hughes minor fix in lib.c: increase inputFS to 100, change malloc 517*9a7741deSElliott Hughes for fields to n+1. 518*9a7741deSElliott Hughes 519*9a7741deSElliott Hughes fixed memory fault caused by out of order test in setsval. 520*9a7741deSElliott Hughes 521*9a7741deSElliott Hughes thanks to david o'brien, freebsd, for both fixes. 522*9a7741deSElliott Hughes 523*9a7741deSElliott HughesMay 1, 2007: 524*9a7741deSElliott Hughes fiddle in makefile to fix for BSD make; thanks to igor sobrado. 525*9a7741deSElliott Hughes 526*9a7741deSElliott HughesMar 31, 2007: 527*9a7741deSElliott Hughes fixed some null pointer refs calling adjbuf. 528*9a7741deSElliott Hughes 529*9a7741deSElliott HughesFeb 21, 2007: 530*9a7741deSElliott Hughes fixed a bug in matching the null RE in sub and gsub. thanks to al aho 531*9a7741deSElliott Hughes who actually did the fix (in b.c), and to wolfgang seeberg for finding 532*9a7741deSElliott Hughes it and providing a very compact test case. 533*9a7741deSElliott Hughes 534*9a7741deSElliott Hughes fixed quotation in b.c; thanks to Hal Pratt and the Princeton Dante 535*9a7741deSElliott Hughes Project. 536*9a7741deSElliott Hughes 537*9a7741deSElliott Hughes removed some no-effect asserts in run.c. 538*9a7741deSElliott Hughes 539*9a7741deSElliott Hughes fiddled maketab.c to not complain about bison-generated values. 540*9a7741deSElliott Hughes 541*9a7741deSElliott Hughes removed the obsolete -V argument; fixed --version to print the 542*9a7741deSElliott Hughes version and exit. 543*9a7741deSElliott Hughes 544*9a7741deSElliott Hughes fixed wording and an outright error in the usage message; thanks to igor 545*9a7741deSElliott Hughes sobrado and jason mcintyre. 546*9a7741deSElliott Hughes 547*9a7741deSElliott Hughes fixed a bug in -d that caused core dump if no program followed. 548*9a7741deSElliott Hughes 549*9a7741deSElliott HughesJan 1, 2007: 550*9a7741deSElliott Hughes dropped mac.code from makefile; there are few non-MacOSX 551*9a7741deSElliott Hughes mac's these days. 552*9a7741deSElliott Hughes 553*9a7741deSElliott HughesJan 17, 2006: 554*9a7741deSElliott Hughes system() not flagged as unsafe in the unadvertised -safe option. 555*9a7741deSElliott Hughes found it while enhancing tests before shipping the ;login: article. 556*9a7741deSElliott Hughes practice what you preach. 557*9a7741deSElliott Hughes 558*9a7741deSElliott Hughes removed the 9-years-obsolete -mr and -mf flags. 559*9a7741deSElliott Hughes 560*9a7741deSElliott Hughes added -version and --version options. 561*9a7741deSElliott Hughes 562*9a7741deSElliott Hughes core dump on linux with BEGIN {nextfile}, now fixed. 563*9a7741deSElliott Hughes 564*9a7741deSElliott Hughes removed some #ifdef's in run.c and lex.c that appear to no 565*9a7741deSElliott Hughes longer be necessary. 566*9a7741deSElliott Hughes 567*9a7741deSElliott HughesApr 24, 2005: 568*9a7741deSElliott Hughes modified lib.c so that values of $0 et al are preserved in the END 569*9a7741deSElliott Hughes block, apparently as required by posix. thanks to havard eidnes 570*9a7741deSElliott Hughes for the report and code. 571*9a7741deSElliott Hughes 572*9a7741deSElliott HughesJan 14, 2005: 573*9a7741deSElliott Hughes fixed infinite loop in parsing, originally found by brian tsang. 574*9a7741deSElliott Hughes thanks to arnold robbins for a suggestion that started me 575*9a7741deSElliott Hughes rethinking it. 576*9a7741deSElliott Hughes 577*9a7741deSElliott HughesDec 31, 2004: 578*9a7741deSElliott Hughes prevent overflow of -f array in main, head off potential error in 579*9a7741deSElliott Hughes call of SYNTAX(), test malloc return in lib.c, all with thanks to 580*9a7741deSElliott Hughes todd miller. 581*9a7741deSElliott Hughes 582*9a7741deSElliott HughesDec 22, 2004: 583*9a7741deSElliott Hughes cranked up size of NCHARS; coverity thinks it can be overrun with 584*9a7741deSElliott Hughes smaller size, and i think that's right. added some assertions to b.c 585*9a7741deSElliott Hughes to catch places where it might overrun. the RE code is still fragile. 586*9a7741deSElliott Hughes 587*9a7741deSElliott HughesDec 5, 2004: 588*9a7741deSElliott Hughes fixed a couple of overflow problems with ridiculous field numbers: 589*9a7741deSElliott Hughes e.g., print $(2^32-1). thanks to ruslan ermilov, giorgos keramidas 590*9a7741deSElliott Hughes and david o'brien at freebsd.org for patches. this really should 591*9a7741deSElliott Hughes be re-done from scratch. 592*9a7741deSElliott Hughes 593*9a7741deSElliott HughesNov 21, 2004: 594*9a7741deSElliott Hughes fixed another 25-year-old RE bug, in split. it's another failure 595*9a7741deSElliott Hughes to (re-)initialize. thanks to steve fisher for spotting this and 596*9a7741deSElliott Hughes providing a good test case. 597*9a7741deSElliott Hughes 598*9a7741deSElliott HughesNov 22, 2003: 599*9a7741deSElliott Hughes fixed a bug in regular expressions that dates (so help me) from 1977; 600*9a7741deSElliott Hughes it's been there from the beginning. an anchored longest match that 601*9a7741deSElliott Hughes was longer than the number of states triggered a failure to initialize 602*9a7741deSElliott Hughes the machine properly. many thanks to moinak ghosh for not only finding 603*9a7741deSElliott Hughes this one but for providing a fix, in some of the most mysterious 604*9a7741deSElliott Hughes code known to man. 605*9a7741deSElliott Hughes 606*9a7741deSElliott Hughes fixed a storage leak in call() that appears to have been there since 607*9a7741deSElliott Hughes 1983 or so -- a function without an explicit return that assigns a 608*9a7741deSElliott Hughes string to a parameter leaked a Cell. thanks to moinak ghosh for 609*9a7741deSElliott Hughes spotting this very subtle one. 610*9a7741deSElliott Hughes 611*9a7741deSElliott HughesJul 31, 2003: 612*9a7741deSElliott Hughes fixed, thanks to andrey chernov and ruslan ermilov, a bug in lex.c 613*9a7741deSElliott Hughes that mis-handled the character 255 in input. (it was being compared 614*9a7741deSElliott Hughes to EOF with a signed comparison.) 615*9a7741deSElliott Hughes 616*9a7741deSElliott HughesJul 29, 2003: 617*9a7741deSElliott Hughes fixed (i think) the long-standing botch that included the beginning of 618*9a7741deSElliott Hughes line state ^ for RE's in the set of valid characters; this led to a 619*9a7741deSElliott Hughes variety of odd problems, including failure to properly match certain 620*9a7741deSElliott Hughes regular expressions in non-US locales. thanks to ruslan for keeping 621*9a7741deSElliott Hughes at this one. 622*9a7741deSElliott Hughes 623*9a7741deSElliott HughesJul 28, 2003: 624*9a7741deSElliott Hughes n-th try at getting internationalization right, with thanks to volker 625*9a7741deSElliott Hughes kiefel, arnold robbins and ruslan ermilov for advice, though they 626*9a7741deSElliott Hughes should not be blamed for the outcome. according to posix, "." is the 627*9a7741deSElliott Hughes radix character in programs and command line arguments regardless of 628*9a7741deSElliott Hughes the locale; otherwise, the locale should prevail for input and output 629*9a7741deSElliott Hughes of numbers. so it's intended to work that way. 630*9a7741deSElliott Hughes 631*9a7741deSElliott Hughes i have rescinded the attempt to use strcoll in expanding shorthands in 632*9a7741deSElliott Hughes regular expressions (cclenter). its properties are much too 633*9a7741deSElliott Hughes surprising; for example [a-c] matches aAbBc in locale en_US but abBcC 634*9a7741deSElliott Hughes in locale fr_CA. i can see how this might arise by implementation 635*9a7741deSElliott Hughes but i cannot explain it to a human user. (this behavior can be seen 636*9a7741deSElliott Hughes in gawk as well; we're leaning on the same library.) 637*9a7741deSElliott Hughes 638*9a7741deSElliott Hughes the issue appears to be that strcoll is meant for sorting, where 639*9a7741deSElliott Hughes merging upper and lower case may make sense (though note that unix 640*9a7741deSElliott Hughes sort does not do this by default either). it is not appropriate 641*9a7741deSElliott Hughes for regular expressions, where the goal is to match specific 642*9a7741deSElliott Hughes patterns of characters. in any case, the notations [:lower:], etc., 643*9a7741deSElliott Hughes are available in awk, and they are more likely to work correctly in 644*9a7741deSElliott Hughes most locales. 645*9a7741deSElliott Hughes 646*9a7741deSElliott Hughes a moratorium is hereby declared on internationalization changes. 647*9a7741deSElliott Hughes i apologize to friends and colleagues in other parts of the world. 648*9a7741deSElliott Hughes i would truly like to get this "right", but i don't know what 649*9a7741deSElliott Hughes that is, and i do not want to keep making changes until it's clear. 650*9a7741deSElliott Hughes 651*9a7741deSElliott HughesJul 4, 2003: 652*9a7741deSElliott Hughes fixed bug that permitted non-terminated RE, as in "awk /x". 653*9a7741deSElliott Hughes 654*9a7741deSElliott HughesJun 1, 2003: 655*9a7741deSElliott Hughes subtle change to split: if source is empty, number of elems 656*9a7741deSElliott Hughes is always 0 and the array is not set. 657*9a7741deSElliott Hughes 658*9a7741deSElliott HughesMar 21, 2003: 659*9a7741deSElliott Hughes added some parens to isblank, in another attempt to make things 660*9a7741deSElliott Hughes internationally portable. 661*9a7741deSElliott Hughes 662*9a7741deSElliott HughesMar 14, 2003: 663*9a7741deSElliott Hughes the internationalization changes, somewhat modified, are now 664*9a7741deSElliott Hughes reinstated. in theory awk will now do character comparisons 665*9a7741deSElliott Hughes and case conversions in national language, but "." will always 666*9a7741deSElliott Hughes be the decimal point separator on input and output regardless 667*9a7741deSElliott Hughes of national language. isblank(){} has an #ifndef. 668*9a7741deSElliott Hughes 669*9a7741deSElliott Hughes this no longer compiles on windows: LC_MESSAGES isn't defined 670*9a7741deSElliott Hughes in vc6++. 671*9a7741deSElliott Hughes 672*9a7741deSElliott Hughes fixed subtle behavior in field and record splitting: if FS is 673*9a7741deSElliott Hughes a single character and RS is not empty, \n is NOT a separator. 674*9a7741deSElliott Hughes this tortuous reading is found in the awk book; behavior now 675*9a7741deSElliott Hughes matches gawk and mawk. 676*9a7741deSElliott Hughes 677*9a7741deSElliott HughesDec 13, 2002: 678*9a7741deSElliott Hughes for the moment, the internationalization changes of nov 29 are 679*9a7741deSElliott Hughes rolled back -- programs like x = 1.2 don't work in some locales, 680*9a7741deSElliott Hughes because the parser is expecting x = 1,2. until i understand this 681*9a7741deSElliott Hughes better, this will have to wait. 682*9a7741deSElliott Hughes 683*9a7741deSElliott HughesNov 29, 2002: 684*9a7741deSElliott Hughes modified b.c (with tiny changes in main and run) to support 685*9a7741deSElliott Hughes locales, using strcoll and iswhatever tests for posix character 686*9a7741deSElliott Hughes classes. thanks to ruslan ermilov ([email protected]) for code. 687*9a7741deSElliott Hughes the function isblank doesn't seem to have propagated to any 688*9a7741deSElliott Hughes header file near me, so it's there explicitly. not properly 689*9a7741deSElliott Hughes tested on non-ascii character sets by me. 690*9a7741deSElliott Hughes 691*9a7741deSElliott HughesJun 28, 2002: 692*9a7741deSElliott Hughes modified run/format() and tran/getsval() to do a slightly better 693*9a7741deSElliott Hughes job on using OFMT for output from print and CONVFMT for other 694*9a7741deSElliott Hughes number->string conversions, as promised by posix and done by 695*9a7741deSElliott Hughes gawk and mawk. there are still places where it doesn't work 696*9a7741deSElliott Hughes right if CONVFMT is changed; by then the STR attribute of the 697*9a7741deSElliott Hughes variable has been irrevocably set. thanks to arnold robbins for 698*9a7741deSElliott Hughes code and examples. 699*9a7741deSElliott Hughes 700*9a7741deSElliott Hughes fixed subtle bug in format that could get core dump. thanks to 701*9a7741deSElliott Hughes Jaromir Dolecek <[email protected]> for finding and fixing. 702*9a7741deSElliott Hughes minor cleanup in run.c / format() at the same time. 703*9a7741deSElliott Hughes 704*9a7741deSElliott Hughes added some tests for null pointers to debugging printf's, which 705*9a7741deSElliott Hughes were never intended for external consumption. thanks to dave 706*9a7741deSElliott Hughes kerns ([email protected]) for pointing this out. 707*9a7741deSElliott Hughes 708*9a7741deSElliott Hughes GNU compatibility: an empty regexp matches anything (thanks to 709*9a7741deSElliott Hughes dag-erling smorgrav, [email protected]). subject to reversion if 710*9a7741deSElliott Hughes this does more harm than good. 711*9a7741deSElliott Hughes 712*9a7741deSElliott Hughes pervasive small changes to make things more const-correct, as 713*9a7741deSElliott Hughes reported by gcc's -Wwrite-strings. as it says in the gcc manual, 714*9a7741deSElliott Hughes this may be more nuisance than useful. provoked by a suggestion 715*9a7741deSElliott Hughes and code from arnaud desitter, [email protected] 716*9a7741deSElliott Hughes 717*9a7741deSElliott Hughes minor documentation changes to note that this now compiles out 718*9a7741deSElliott Hughes of the box on Mac OS X. 719*9a7741deSElliott Hughes 720*9a7741deSElliott HughesFeb 10, 2002: 721*9a7741deSElliott Hughes changed types in posix chars structure to quiet solaris cc. 722*9a7741deSElliott Hughes 723*9a7741deSElliott HughesJan 1, 2002: 724*9a7741deSElliott Hughes fflush() or fflush("") flushes all files and pipes. 725*9a7741deSElliott Hughes 726*9a7741deSElliott Hughes length(arrayname) returns number of elements; thanks to 727*9a7741deSElliott Hughes arnold robbins for suggestion. 728*9a7741deSElliott Hughes 729*9a7741deSElliott Hughes added a makefile.win to make it easier to build on windows. 730*9a7741deSElliott Hughes based on dan allen's buildwin.bat. 731*9a7741deSElliott Hughes 732*9a7741deSElliott HughesNov 16, 2001: 733*9a7741deSElliott Hughes added support for posix character class names like [:digit:], 734*9a7741deSElliott Hughes which are not exactly shorter than [0-9] and perhaps no more 735*9a7741deSElliott Hughes portable. thanks to dag-erling smorgrav for code. 736*9a7741deSElliott Hughes 737*9a7741deSElliott HughesFeb 16, 2001: 738*9a7741deSElliott Hughes removed -m option; no longer needed, and it was actually 739*9a7741deSElliott Hughes broken (noted thanks to volker kiefel). 740*9a7741deSElliott Hughes 741*9a7741deSElliott HughesFeb 10, 2001: 742*9a7741deSElliott Hughes fixed an appalling bug in gettok: any sequence of digits, +,-, E, e, 743*9a7741deSElliott Hughes and period was accepted as a valid number if it started with a period. 744*9a7741deSElliott Hughes this would never have happened with the lex version. 745*9a7741deSElliott Hughes 746*9a7741deSElliott Hughes other 1-character botches, now fixed, include a bare $ and a 747*9a7741deSElliott Hughes bare " at the end of the input. 748*9a7741deSElliott Hughes 749*9a7741deSElliott HughesFeb 7, 2001: 750*9a7741deSElliott Hughes more (const char *) casts in b.c and tran.c to silence warnings. 751*9a7741deSElliott Hughes 752*9a7741deSElliott HughesNov 15, 2000: 753*9a7741deSElliott Hughes fixed a bug introduced in august 1997 that caused expressions 754*9a7741deSElliott Hughes like $f[1] to be syntax errors. thanks to arnold robbins for 755*9a7741deSElliott Hughes noticing this and providing a fix. 756*9a7741deSElliott Hughes 757*9a7741deSElliott HughesOct 30, 2000: 758*9a7741deSElliott Hughes fixed some nextfile bugs: not handling all cases. thanks to 759*9a7741deSElliott Hughes arnold robbins for pointing this out. new regressions added. 760*9a7741deSElliott Hughes 761*9a7741deSElliott Hughes close() is now a function. it returns whatever the library 762*9a7741deSElliott Hughes fclose returns, and -1 for closing a file or pipe that wasn't 763*9a7741deSElliott Hughes opened. 764*9a7741deSElliott Hughes 765*9a7741deSElliott HughesSep 24, 2000: 766*9a7741deSElliott Hughes permit \n explicitly in character classes; won't work right 767*9a7741deSElliott Hughes if comes in as "[\n]" but ok as /[\n]/, because of multiple 768*9a7741deSElliott Hughes processing of \'s. thanks to arnold robbins. 769*9a7741deSElliott Hughes 770*9a7741deSElliott HughesJuly 5, 2000: 771*9a7741deSElliott Hughes minor fiddles in tran.c to keep compilers happy about uschar. 772*9a7741deSElliott Hughes thanks to norman wilson. 773*9a7741deSElliott Hughes 774*9a7741deSElliott HughesMay 25, 2000: 775*9a7741deSElliott Hughes yet another attempt at making 8-bit input work, with another 776*9a7741deSElliott Hughes band-aid in b.c (member()), and some (uschar) casts to head 777*9a7741deSElliott Hughes off potential errors in subscripts (like isdigit). also 778*9a7741deSElliott Hughes changed HAT to NCHARS-2. thanks again to santiago vila. 779*9a7741deSElliott Hughes 780*9a7741deSElliott Hughes changed maketab.c to ignore apparently out of range definitions 781*9a7741deSElliott Hughes instead of halting; new freeBSD generates one. thanks to 782*9a7741deSElliott Hughes jon snader <[email protected]> for pointing out the problem. 783*9a7741deSElliott Hughes 784*9a7741deSElliott HughesMay 2, 2000: 785*9a7741deSElliott Hughes fixed an 8-bit problem in b.c by making several char*'s into 786*9a7741deSElliott Hughes unsigned char*'s. not clear i have them all yet. thanks to 787*9a7741deSElliott Hughes Santiago Vila <[email protected]> for the bug report. 788*9a7741deSElliott Hughes 789*9a7741deSElliott HughesApr 21, 2000: 790*9a7741deSElliott Hughes finally found and fixed a memory leak in function call; it's 791*9a7741deSElliott Hughes been there since functions were added ~1983. thanks to 792*9a7741deSElliott Hughes jon bentley for the test case that found it. 793*9a7741deSElliott Hughes 794*9a7741deSElliott Hughes added test in envinit to catch environment "variables" with 795*9a7741deSElliott Hughes names beginning with '='; thanks to Berend Hasselman. 796*9a7741deSElliott Hughes 797*9a7741deSElliott HughesJul 28, 1999: 798*9a7741deSElliott Hughes added test in defn() to catch function foo(foo), which 799*9a7741deSElliott Hughes otherwise recurses until core dump. thanks to arnold 800*9a7741deSElliott Hughes robbins for noticing this. 801*9a7741deSElliott Hughes 802*9a7741deSElliott HughesJun 20, 1999: 803*9a7741deSElliott Hughes added *bp in gettok in lex.c; appears possible to exit function 804*9a7741deSElliott Hughes without terminating the string. thanks to russ cox. 805*9a7741deSElliott Hughes 806*9a7741deSElliott HughesJun 2, 1999: 807*9a7741deSElliott Hughes added function stdinit() to run to initialize files[] array, 808*9a7741deSElliott Hughes in case stdin, etc., are not constants; some compilers care. 809*9a7741deSElliott Hughes 810*9a7741deSElliott HughesMay 10, 1999: 811*9a7741deSElliott Hughes replaced the ERROR ... FATAL, etc., macros with functions 812*9a7741deSElliott Hughes based on vprintf, to avoid problems caused by overrunning 813*9a7741deSElliott Hughes fixed-size errbuf array. thanks to ralph corderoy for the 814*9a7741deSElliott Hughes impetus, and for pointing out a string termination bug in 815*9a7741deSElliott Hughes qstring as well. 816*9a7741deSElliott Hughes 817*9a7741deSElliott HughesApr 21, 1999: 818*9a7741deSElliott Hughes fixed bug that caused occasional core dumps with commandline 819*9a7741deSElliott Hughes variable with value ending in \. (thanks to nelson beebe for 820*9a7741deSElliott Hughes the test case.) 821*9a7741deSElliott Hughes 822*9a7741deSElliott HughesApr 16, 1999: 823*9a7741deSElliott Hughes with code kindly provided by Bruce Lilly, awk now parses 824*9a7741deSElliott Hughes /=/ and similar constructs more sensibly in more places. 825*9a7741deSElliott Hughes Bruce also provided some helpful test cases. 826*9a7741deSElliott Hughes 827*9a7741deSElliott HughesApr 5, 1999: 828*9a7741deSElliott Hughes changed true/false to True/False in run.c to make it 829*9a7741deSElliott Hughes easier to compile with C++. Added some casts on malloc 830*9a7741deSElliott Hughes and realloc to be honest about casts; ditto. changed 831*9a7741deSElliott Hughes ltype int to long in struct rrow to reduce some 64-bit 832*9a7741deSElliott Hughes complaints; other changes scattered throughout for the 833*9a7741deSElliott Hughes same purpose. thanks to Nelson Beebe for these portability 834*9a7741deSElliott Hughes improvements. 835*9a7741deSElliott Hughes 836*9a7741deSElliott Hughes removed some horrible pointer-int casting in b.c and elsewhere 837*9a7741deSElliott Hughes by adding ptoi and itonp to localize the casts, which are 838*9a7741deSElliott Hughes all benign. fixed one incipient bug that showed up on sgi 839*9a7741deSElliott Hughes in 64-bit mode. 840*9a7741deSElliott Hughes 841*9a7741deSElliott Hughes reset lineno for new source file; include filename in error 842*9a7741deSElliott Hughes message. also fixed line number error in continuation lines. 843*9a7741deSElliott Hughes (thanks to Nelson Beebe for both of these.) 844*9a7741deSElliott Hughes 845*9a7741deSElliott HughesMar 24, 1999: 846*9a7741deSElliott Hughes Nelson Beebe notes that irix 5.3 yacc dies with a bogus 847*9a7741deSElliott Hughes error; use a newer version or switch to bison, since sgi 848*9a7741deSElliott Hughes is unlikely to fix it. 849*9a7741deSElliott Hughes 850*9a7741deSElliott HughesMar 5, 1999: 851*9a7741deSElliott Hughes changed isnumber to is_number to avoid the problem caused by 852*9a7741deSElliott Hughes versions of ctype.h that include the name isnumber. 853*9a7741deSElliott Hughes 854*9a7741deSElliott Hughes distribution now includes a script for building on a Mac, 855*9a7741deSElliott Hughes thanks to Dan Allen. 856*9a7741deSElliott Hughes 857*9a7741deSElliott HughesFeb 20, 1999: 858*9a7741deSElliott Hughes fixed memory leaks in run.c (call) and tran.c (setfval). 859*9a7741deSElliott Hughes thanks to Stephen Nutt for finding these and providing the fixes. 860*9a7741deSElliott Hughes 861*9a7741deSElliott HughesJan 13, 1999: 862*9a7741deSElliott Hughes replaced srand argument by (unsigned int) in run.c; 863*9a7741deSElliott Hughes avoids problem on Mac and potentially on Unix & Windows. 864*9a7741deSElliott Hughes thanks to Dan Allen. 865*9a7741deSElliott Hughes 866*9a7741deSElliott Hughes added a few (int) casts to silence useless compiler warnings. 867*9a7741deSElliott Hughes e.g., errorflag= in run.c jump(). 868*9a7741deSElliott Hughes 869*9a7741deSElliott Hughes added proctab.c to the bundle output; one less thing 870*9a7741deSElliott Hughes to have to compile out of the box. 871*9a7741deSElliott Hughes 872*9a7741deSElliott Hughes added calls to _popen and _pclose to the win95 stub for 873*9a7741deSElliott Hughes pipes (thanks to Steve Adams for this helpful suggestion). 874*9a7741deSElliott Hughes seems to work, though properties are not well understood 875*9a7741deSElliott Hughes by me, and it appears that under some circumstances the 876*9a7741deSElliott Hughes pipe output is truncated. Be careful. 877*9a7741deSElliott Hughes 878*9a7741deSElliott HughesOct 19, 1998: 879*9a7741deSElliott Hughes fixed a couple of bugs in getrec: could fail to update $0 880*9a7741deSElliott Hughes after a getline var; because inputFS wasn't initialized, 881*9a7741deSElliott Hughes could split $0 on every character, a misleading diversion. 882*9a7741deSElliott Hughes 883*9a7741deSElliott Hughes fixed caching bug in makedfa: LRU was actually removing 884*9a7741deSElliott Hughes least often used. 885*9a7741deSElliott Hughes 886*9a7741deSElliott Hughes thanks to ross ridge for finding these, and for providing 887*9a7741deSElliott Hughes great bug reports. 888*9a7741deSElliott Hughes 889*9a7741deSElliott HughesMay 12, 1998: 890*9a7741deSElliott Hughes fixed potential bug in readrec: might fail to update record 891*9a7741deSElliott Hughes pointer after growing. thanks to dan levy for spotting this 892*9a7741deSElliott Hughes and suggesting the fix. 893*9a7741deSElliott Hughes 894*9a7741deSElliott HughesMar 12, 1998: 895*9a7741deSElliott Hughes added -V to print version number and die. 896*9a7741deSElliott Hughes 897*9a7741deSElliott Hughes[notify dave kerns, [email protected]] 898*9a7741deSElliott Hughes 899*9a7741deSElliott HughesFeb 11, 1998: 900*9a7741deSElliott Hughes subtle silent bug in lex.c: if the program ended with a number 901*9a7741deSElliott Hughes longer than 1 digit, part of the input would be pushed back and 902*9a7741deSElliott Hughes parsed again because token buffer wasn't terminated right. 903*9a7741deSElliott Hughes example: awk 'length($0) > 10'. blush. at least i found it 904*9a7741deSElliott Hughes myself. 905*9a7741deSElliott Hughes 906*9a7741deSElliott HughesAug 31, 1997: 907*9a7741deSElliott Hughes s/adelete/awkdelete/: SGI uses this in malloc.h. 908*9a7741deSElliott Hughes thanks to nelson beebe for pointing this one out. 909*9a7741deSElliott Hughes 910*9a7741deSElliott HughesAug 21, 1997: 911*9a7741deSElliott Hughes fixed some bugs in sub and gsub when replacement includes \\. 912*9a7741deSElliott Hughes this is a dark, horrible corner, but at least now i believe that 913*9a7741deSElliott Hughes the behavior is the same as gawk and the intended posix standard. 914*9a7741deSElliott Hughes thanks to arnold robbins for advice here. 915*9a7741deSElliott Hughes 916*9a7741deSElliott HughesAug 9, 1997: 917*9a7741deSElliott Hughes somewhat regretfully, replaced the ancient lex-based lexical 918*9a7741deSElliott Hughes analyzer with one written in C. it's longer, generates less code, 919*9a7741deSElliott Hughes and more portable; the old one depended too much on mysterious 920*9a7741deSElliott Hughes properties of lex that were not preserved in other environments. 921*9a7741deSElliott Hughes in theory these recognize the same language. 922*9a7741deSElliott Hughes 923*9a7741deSElliott Hughes now using strtod to test whether a string is a number, instead of 924*9a7741deSElliott Hughes the convoluted original function. should be more portable and 925*9a7741deSElliott Hughes reliable if strtod is implemented right. 926*9a7741deSElliott Hughes 927*9a7741deSElliott Hughes removed now-pointless optimization in makefile that tries to avoid 928*9a7741deSElliott Hughes recompilation when awkgram.y is changed but symbols are not. 929*9a7741deSElliott Hughes 930*9a7741deSElliott Hughes removed most fixed-size arrays, though a handful remain, some 931*9a7741deSElliott Hughes of which are unchecked. you have been warned. 932*9a7741deSElliott Hughes 933*9a7741deSElliott HughesAug 4, 1997: 934*9a7741deSElliott Hughes with some trepidation, replaced the ancient code that managed 935*9a7741deSElliott Hughes fields and $0 in fixed-size arrays with arrays that grow on 936*9a7741deSElliott Hughes demand. there is still some tension between trying to make this 937*9a7741deSElliott Hughes run fast and making it clean; not sure it's right yet. 938*9a7741deSElliott Hughes 939*9a7741deSElliott Hughes the ill-conceived -mr and -mf arguments are now useful only 940*9a7741deSElliott Hughes for debugging. previous dynamic string code removed. 941*9a7741deSElliott Hughes 942*9a7741deSElliott Hughes numerous other minor cleanups along the way. 943*9a7741deSElliott Hughes 944*9a7741deSElliott HughesJul 30, 1997: 945*9a7741deSElliott Hughes using code provided by dan levy (to whom profuse thanks), replaced 946*9a7741deSElliott Hughes fixed-size arrays and awkward kludges by a fairly uniform mechanism 947*9a7741deSElliott Hughes to grow arrays as needed for printf, sub, gsub, etc. 948*9a7741deSElliott Hughes 949*9a7741deSElliott HughesJul 23, 1997: 950*9a7741deSElliott Hughes falling off the end of a function returns "" and 0, not 0. 951*9a7741deSElliott Hughes thanks to arnold robbins. 952*9a7741deSElliott Hughes 953*9a7741deSElliott HughesJun 17, 1997: 954*9a7741deSElliott Hughes replaced several fixed-size arrays by dynamically-created ones 955*9a7741deSElliott Hughes in run.c; added overflow tests to some previously unchecked cases. 956*9a7741deSElliott Hughes getline, toupper, tolower. 957*9a7741deSElliott Hughes 958*9a7741deSElliott Hughes getline code is still broken in that recursive calls may wind 959*9a7741deSElliott Hughes up using the same space. [fixed later] 960*9a7741deSElliott Hughes 961*9a7741deSElliott Hughes increased RECSIZE to 8192 to push problems further over the horizon. 962*9a7741deSElliott Hughes 963*9a7741deSElliott Hughes added \r to \n as input line separator for programs, not data. 964*9a7741deSElliott Hughes damn CRLFs. 965*9a7741deSElliott Hughes 966*9a7741deSElliott Hughes modified format() to permit explicit printf("%c", 0) to include 967*9a7741deSElliott Hughes a null byte in output. thanks to ken stailey for the fix. 968*9a7741deSElliott Hughes 969*9a7741deSElliott Hughes added a "-safe" argument that disables file output (print >, 970*9a7741deSElliott Hughes print >>), process creation (cmd|getline, print |, system), and 971*9a7741deSElliott Hughes access to the environment (ENVIRON). this is a first approximation 972*9a7741deSElliott Hughes to a "safe" version of awk, but don't rely on it too much. thanks 973*9a7741deSElliott Hughes to joan feigenbaum and matt blaze for the inspiration long ago. 974*9a7741deSElliott Hughes 975*9a7741deSElliott HughesJul 8, 1996: 976*9a7741deSElliott Hughes fixed long-standing bug in sub, gsub(/a/, "\\\\&"); thanks to 977*9a7741deSElliott Hughes ralph corderoy. 978*9a7741deSElliott Hughes 979*9a7741deSElliott HughesJun 29, 1996: 980*9a7741deSElliott Hughes fixed awful bug in new field splitting; didn't get all the places 981*9a7741deSElliott Hughes where input was done. 982*9a7741deSElliott Hughes 983*9a7741deSElliott HughesJun 28, 1996: 984*9a7741deSElliott Hughes changed field-splitting to conform to posix definition: fields are 985*9a7741deSElliott Hughes split using the value of FS at the time of input; it used to be 986*9a7741deSElliott Hughes the value when the field or NF was first referred to, a much less 987*9a7741deSElliott Hughes predictable definition. thanks to arnold robbins for encouragement 988*9a7741deSElliott Hughes to do the right thing. 989*9a7741deSElliott Hughes 990*9a7741deSElliott HughesMay 28, 1996: 991*9a7741deSElliott Hughes fixed appalling but apparently unimportant bug in parsing octal 992*9a7741deSElliott Hughes numbers in reg exprs. 993*9a7741deSElliott Hughes 994*9a7741deSElliott Hughes explicit hex in reg exprs now limited to 2 chars: \xa, \xaa. 995*9a7741deSElliott Hughes 996*9a7741deSElliott HughesMay 27, 1996: 997*9a7741deSElliott Hughes cleaned up some declarations so gcc -Wall is now almost silent. 998*9a7741deSElliott Hughes 999*9a7741deSElliott Hughes makefile now includes backup copies of ytab.c and lexyy.c in case 1000*9a7741deSElliott Hughes one makes before looking; it also avoids recreating lexyy.c unless 1001*9a7741deSElliott Hughes really needed. 1002*9a7741deSElliott Hughes 1003*9a7741deSElliott Hughes s/aprintf/awkprint, s/asprintf/awksprintf/ to avoid some name clashes 1004*9a7741deSElliott Hughes with unwisely-written header files. 1005*9a7741deSElliott Hughes 1006*9a7741deSElliott Hughes thanks to jeffrey friedl for several of these. 1007*9a7741deSElliott Hughes 1008*9a7741deSElliott HughesMay 26, 1996: 1009*9a7741deSElliott Hughes an attempt to rationalize the (unsigned) char issue. almost all 1010*9a7741deSElliott Hughes instances of unsigned char have been removed; the handful of places 1011*9a7741deSElliott Hughes in b.c where chars are used as table indices have been hand-crafted. 1012*9a7741deSElliott Hughes added some latin-1 tests to the regression, but i'm not confident; 1013*9a7741deSElliott Hughes none of my compilers seem to care much. thanks to nelson beebe for 1014*9a7741deSElliott Hughes pointing out some others that do care. 1015*9a7741deSElliott Hughes 1016*9a7741deSElliott HughesMay 2, 1996: 1017*9a7741deSElliott Hughes removed all register declarations. 1018*9a7741deSElliott Hughes 1019*9a7741deSElliott Hughes enhanced split(), as in gawk, etc: split(s, a, "") splits s into 1020*9a7741deSElliott Hughes a[1]...a[length(s)] with each character a single element. 1021*9a7741deSElliott Hughes 1022*9a7741deSElliott Hughes made the same changes for field-splitting if FS is "". 1023*9a7741deSElliott Hughes 1024*9a7741deSElliott Hughes added nextfile, as in gawk: causes immediate advance to next 1025*9a7741deSElliott Hughes input file. (thanks to arnold robbins for inspiration and code). 1026*9a7741deSElliott Hughes 1027*9a7741deSElliott Hughes small fixes to regexpr code: can now handle []], [[], and 1028*9a7741deSElliott Hughes variants; [] is now a syntax error, rather than matching 1029*9a7741deSElliott Hughes everything; [z-a] is now empty, not z. far from complete 1030*9a7741deSElliott Hughes or correct, however. (thanks to jeffrey friedl for pointing out 1031*9a7741deSElliott Hughes some awful behaviors.) 1032*9a7741deSElliott Hughes 1033*9a7741deSElliott HughesApr 29, 1996: 1034*9a7741deSElliott Hughes replaced uchar by uschar everywhere; apparently some compilers 1035*9a7741deSElliott Hughes usurp this name and this causes conflicts. 1036*9a7741deSElliott Hughes 1037*9a7741deSElliott Hughes fixed call to time in run.c (bltin); arg is time_t *. 1038*9a7741deSElliott Hughes 1039*9a7741deSElliott Hughes replaced horrible pointer/long punning in b.c by a legitimate 1040*9a7741deSElliott Hughes union. should be safer on 64-bit machines and cleaner everywhere. 1041*9a7741deSElliott Hughes (thanks to nelson beebe for pointing out some of these problems.) 1042*9a7741deSElliott Hughes 1043*9a7741deSElliott Hughes replaced nested comments by #if 0...#endif in run.c, lib.c. 1044*9a7741deSElliott Hughes 1045*9a7741deSElliott Hughes removed getsval, setsval, execute macros from run.c and lib.c. 1046*9a7741deSElliott Hughes machines are 100x faster than they were when these macros were 1047*9a7741deSElliott Hughes first used. 1048*9a7741deSElliott Hughes 1049*9a7741deSElliott Hughes revised filenames: awk.g.y => awkgram.y, awk.lx.l => awklex.l, 1050*9a7741deSElliott Hughes y.tab.[ch] => ytab.[ch], lex.yy.c => lexyy.c, all in the aid of 1051*9a7741deSElliott Hughes portability to nameless systems. 1052*9a7741deSElliott Hughes 1053*9a7741deSElliott Hughes "make bundle" now includes yacc and lex output files for recipients 1054*9a7741deSElliott Hughes who don't have yacc or lex. 1055*9a7741deSElliott Hughes 1056*9a7741deSElliott HughesAug 15, 1995: 1057*9a7741deSElliott Hughes initialized Cells in setsymtab more carefully; some fields 1058*9a7741deSElliott Hughes were not set. (thanks to purify, all of whose complaints i 1059*9a7741deSElliott Hughes think i now understand.) 1060*9a7741deSElliott Hughes 1061*9a7741deSElliott Hughes fixed at least one error in gsub that looked at -1-th element 1062*9a7741deSElliott Hughes of an array when substituting for a null match (e.g., $). 1063*9a7741deSElliott Hughes 1064*9a7741deSElliott Hughes delete arrayname is now legal; it clears the elements but leaves 1065*9a7741deSElliott Hughes the array, which may not be the right behavior. 1066*9a7741deSElliott Hughes 1067*9a7741deSElliott Hughes modified makefile: my current make can't cope with the test used 1068*9a7741deSElliott Hughes to avoid unnecessary yacc invocations. 1069*9a7741deSElliott Hughes 1070*9a7741deSElliott HughesJul 17, 1995: 1071*9a7741deSElliott Hughes added dynamically growing strings to awk.lx.l and b.c 1072*9a7741deSElliott Hughes to permit regular expressions to be much bigger. 1073*9a7741deSElliott Hughes the state arrays can still overflow. 1074*9a7741deSElliott Hughes 1075*9a7741deSElliott HughesAug 24, 1994: 1076*9a7741deSElliott Hughes detect duplicate arguments in function definitions (mdm). 1077*9a7741deSElliott Hughes 1078*9a7741deSElliott HughesMay 11, 1994: 1079*9a7741deSElliott Hughes trivial fix to printf to limit string size in sub(). 1080*9a7741deSElliott Hughes 1081*9a7741deSElliott HughesApr 22, 1994: 1082*9a7741deSElliott Hughes fixed yet another subtle self-assignment problem: 1083*9a7741deSElliott Hughes $1 = $2; $1 = $1 clobbered $1. 1084*9a7741deSElliott Hughes 1085*9a7741deSElliott Hughes Regression tests now use private echo, to avoid quoting problems. 1086*9a7741deSElliott Hughes 1087*9a7741deSElliott HughesFeb 2, 1994: 1088*9a7741deSElliott Hughes changed error() to print line number as %d, not %g. 1089*9a7741deSElliott Hughes 1090*9a7741deSElliott HughesJul 23, 1993: 1091*9a7741deSElliott Hughes cosmetic changes: increased sizes of some arrays, 1092*9a7741deSElliott Hughes reworded some error messages. 1093*9a7741deSElliott Hughes 1094*9a7741deSElliott Hughes added CONVFMT as in posix (just replaced OFMT in getsval) 1095*9a7741deSElliott Hughes 1096*9a7741deSElliott Hughes FILENAME is now "" until the first thing that causes a file 1097*9a7741deSElliott Hughes to be opened. 1098*9a7741deSElliott Hughes 1099*9a7741deSElliott HughesNov 28, 1992: 1100*9a7741deSElliott Hughes deleted yyunput and yyoutput from proto.h; 1101*9a7741deSElliott Hughes different versions of lex give these different declarations. 1102*9a7741deSElliott Hughes 1103*9a7741deSElliott HughesMay 31, 1992: 1104*9a7741deSElliott Hughes added -mr N and -mf N options: more record and fields. 1105*9a7741deSElliott Hughes these really ought to adjust automatically. 1106*9a7741deSElliott Hughes 1107*9a7741deSElliott Hughes cleaned up some error messages; "out of space" now means 1108*9a7741deSElliott Hughes malloc returned NULL in all cases. 1109*9a7741deSElliott Hughes 1110*9a7741deSElliott Hughes changed rehash so that if it runs out, it just returns; 1111*9a7741deSElliott Hughes things will continue to run slow, but maybe a bit longer. 1112*9a7741deSElliott Hughes 1113*9a7741deSElliott HughesApr 24, 1992: 1114*9a7741deSElliott Hughes remove redundant close of stdin when using -f -. 1115*9a7741deSElliott Hughes 1116*9a7741deSElliott Hughes got rid of core dump with -d; awk -d just prints date. 1117*9a7741deSElliott Hughes 1118*9a7741deSElliott HughesApr 12, 1992: 1119*9a7741deSElliott Hughes added explicit check for /dev/std(in,out,err) in redirection. 1120*9a7741deSElliott Hughes unlike gawk, no /dev/fd/n yet. 1121*9a7741deSElliott Hughes 1122*9a7741deSElliott Hughes added (file/pipe) builtin. hard to test satisfactorily. 1123*9a7741deSElliott Hughes not posix. 1124*9a7741deSElliott Hughes 1125*9a7741deSElliott HughesFeb 20, 1992: 1126*9a7741deSElliott Hughes recompile after abortive changes; should be unchanged. 1127*9a7741deSElliott Hughes 1128*9a7741deSElliott HughesDec 2, 1991: 1129*9a7741deSElliott Hughes die-casting time: converted to ansi C, installed that. 1130*9a7741deSElliott Hughes 1131*9a7741deSElliott HughesNov 30, 1991: 1132*9a7741deSElliott Hughes fixed storage leak in freefa, failing to recover [N]CCL. 1133*9a7741deSElliott Hughes thanks to Bill Jones ([email protected]) 1134*9a7741deSElliott Hughes 1135*9a7741deSElliott HughesNov 19, 1991: 1136*9a7741deSElliott Hughes use RAND_MAX instead of literal in builtin(). 1137*9a7741deSElliott Hughes 1138*9a7741deSElliott HughesNov 12, 1991: 1139*9a7741deSElliott Hughes cranked up some fixed-size arrays in b.c, and added a test for 1140*9a7741deSElliott Hughes overflow in penter. thanks to mark larsen. 1141*9a7741deSElliott Hughes 1142*9a7741deSElliott HughesSep 24, 1991: 1143*9a7741deSElliott Hughes increased buffer in gsub. a very crude fix to a general problem. 1144*9a7741deSElliott Hughes and again on Sep 26. 1145*9a7741deSElliott Hughes 1146*9a7741deSElliott HughesAug 18, 1991: 1147*9a7741deSElliott Hughes enforce variable name syntax for commandline variables: has to 1148*9a7741deSElliott Hughes start with letter or _. 1149*9a7741deSElliott Hughes 1150*9a7741deSElliott HughesJul 27, 1991: 1151*9a7741deSElliott Hughes allow newline after ; in for statements. 1152*9a7741deSElliott Hughes 1153*9a7741deSElliott HughesJul 21, 1991: 1154*9a7741deSElliott Hughes fixed so that in self-assignment like $1=$1, side effects 1155*9a7741deSElliott Hughes like recomputing $0 take place. (this is getting subtle.) 1156*9a7741deSElliott Hughes 1157*9a7741deSElliott HughesJun 30, 1991: 1158*9a7741deSElliott Hughes better test for detecting too-long output record. 1159*9a7741deSElliott Hughes 1160*9a7741deSElliott HughesJun 2, 1991: 1161*9a7741deSElliott Hughes better defense against very long printf strings. 1162*9a7741deSElliott Hughes made break and continue illegal outside of loops. 1163*9a7741deSElliott Hughes 1164*9a7741deSElliott HughesMay 13, 1991: 1165*9a7741deSElliott Hughes removed extra arg on gettemp, tempfree. minor error message rewording. 1166*9a7741deSElliott Hughes 1167*9a7741deSElliott HughesMay 6, 1991: 1168*9a7741deSElliott Hughes fixed silly bug in hex parsing in hexstr(). 1169*9a7741deSElliott Hughes removed an apparently unnecessary test in isnumber(). 1170*9a7741deSElliott Hughes warn about weird printf conversions. 1171*9a7741deSElliott Hughes fixed unchecked array overwrite in relex(). 1172*9a7741deSElliott Hughes 1173*9a7741deSElliott Hughes changed for (i in array) to access elements in sorted order. 1174*9a7741deSElliott Hughes then unchanged it -- it really does run slower in too many cases. 1175*9a7741deSElliott Hughes left the code in place, commented out. 1176*9a7741deSElliott Hughes 1177*9a7741deSElliott HughesFeb 10, 1991: 1178*9a7741deSElliott Hughes check error status on all writes, to avoid banging on full disks. 1179*9a7741deSElliott Hughes 1180*9a7741deSElliott HughesJan 28, 1991: 1181*9a7741deSElliott Hughes awk -f - reads the program from stdin. 1182*9a7741deSElliott Hughes 1183*9a7741deSElliott HughesJan 11, 1991: 1184*9a7741deSElliott Hughes failed to set numeric state on $0 in cmd|getline context in run.c. 1185*9a7741deSElliott Hughes 1186*9a7741deSElliott HughesNov 2, 1990: 1187*9a7741deSElliott Hughes fixed sleazy test for integrality in getsval; use modf. 1188*9a7741deSElliott Hughes 1189*9a7741deSElliott HughesOct 29, 1990: 1190*9a7741deSElliott Hughes fixed sleazy buggy code in lib.c that looked (incorrectly) for 1191*9a7741deSElliott Hughes too long input lines. 1192*9a7741deSElliott Hughes 1193*9a7741deSElliott HughesOct 14, 1990: 1194*9a7741deSElliott Hughes fixed the bug on p. 198 in which it couldn't deduce that an 1195*9a7741deSElliott Hughes argument was an array in some contexts. replaced the error 1196*9a7741deSElliott Hughes message in intest() by code that damn well makes it an array. 1197*9a7741deSElliott Hughes 1198*9a7741deSElliott HughesOct 8, 1990: 1199*9a7741deSElliott Hughes fixed horrible bug: types and values were not preserved in 1200*9a7741deSElliott Hughes some kinds of self-assignment. (in assign().) 1201*9a7741deSElliott Hughes 1202*9a7741deSElliott HughesAug 24, 1990: 1203*9a7741deSElliott Hughes changed NCHARS to 256 to handle 8-bit characters in strings 1204*9a7741deSElliott Hughes presented to match(), etc. 1205*9a7741deSElliott Hughes 1206*9a7741deSElliott HughesJun 26, 1990: 1207*9a7741deSElliott Hughes changed struct rrow (awk.h) to use long instead of int for lval, 1208*9a7741deSElliott Hughes since cfoll() stores a pointer in it. now works better when int's 1209*9a7741deSElliott Hughes are smaller than pointers! 1210*9a7741deSElliott Hughes 1211*9a7741deSElliott HughesMay 6, 1990: 1212*9a7741deSElliott Hughes AVA fixed the grammar so that ! is uniformly of the same precedence as 1213*9a7741deSElliott Hughes unary + and -. This renders illegal some constructs like !x=y, which 1214*9a7741deSElliott Hughes now has to be parenthesized as !(x=y), and makes others work properly: 1215*9a7741deSElliott Hughes !x+y is (!x)+y, and x!y is x !y, not two pattern-action statements. 1216*9a7741deSElliott Hughes (These problems were pointed out by Bob Lenk of Posix.) 1217*9a7741deSElliott Hughes 1218*9a7741deSElliott Hughes Added \x to regular expressions (already in strings). 1219*9a7741deSElliott Hughes Limited octal to octal digits; \8 and \9 are not octal. 1220*9a7741deSElliott Hughes Centralized the code for parsing escapes in regular expressions. 1221*9a7741deSElliott Hughes Added a bunch of tests to T.re and T.sub to verify some of this. 1222*9a7741deSElliott Hughes 1223*9a7741deSElliott HughesFeb 9, 1990: 1224*9a7741deSElliott Hughes fixed null pointer dereference bug in main.c: -F[nothing]. sigh. 1225*9a7741deSElliott Hughes 1226*9a7741deSElliott Hughes restored srand behavior: it returns the current seed. 1227*9a7741deSElliott Hughes 1228*9a7741deSElliott HughesJan 18, 1990: 1229*9a7741deSElliott Hughes srand now returns previous seed value (0 to start). 1230*9a7741deSElliott Hughes 1231*9a7741deSElliott HughesJan 5, 1990: 1232*9a7741deSElliott Hughes fix potential problem in tran.c -- something was freed, 1233*9a7741deSElliott Hughes then used in freesymtab. 1234*9a7741deSElliott Hughes 1235*9a7741deSElliott HughesOct 18, 1989: 1236*9a7741deSElliott Hughes another try to get the max number of open files set with 1237*9a7741deSElliott Hughes relatively machine-independent code. 1238*9a7741deSElliott Hughes 1239*9a7741deSElliott Hughes small fix to input() in case of multiple reads after EOF. 1240*9a7741deSElliott Hughes 1241*9a7741deSElliott HughesOct 11, 1989: 1242*9a7741deSElliott Hughes FILENAME is now defined in the BEGIN block -- too many old 1243*9a7741deSElliott Hughes programs broke. 1244*9a7741deSElliott Hughes 1245*9a7741deSElliott Hughes "-" means stdin in getline as well as on the commandline. 1246*9a7741deSElliott Hughes 1247*9a7741deSElliott Hughes added a bunch of casts to the code to tell the truth about 1248*9a7741deSElliott Hughes char * vs. unsigned char *, a right royal pain. added a 1249*9a7741deSElliott Hughes setlocale call to the front of main, though probably no one 1250*9a7741deSElliott Hughes has it usefully implemented yet. 1251*9a7741deSElliott Hughes 1252*9a7741deSElliott HughesAug 24, 1989: 1253*9a7741deSElliott Hughes removed redundant relational tests against nullnode if parse 1254*9a7741deSElliott Hughes tree already had a relational at that point. 1255*9a7741deSElliott Hughes 1256*9a7741deSElliott HughesAug 11, 1989: 1257*9a7741deSElliott Hughes fixed bug: commandline variable assignment has to look like 1258*9a7741deSElliott Hughes var=something. (consider the man page for =, in file =.1) 1259*9a7741deSElliott Hughes 1260*9a7741deSElliott Hughes changed number of arguments to functions to static arrays 1261*9a7741deSElliott Hughes to avoid repeated malloc calls. 1262*9a7741deSElliott Hughes 1263*9a7741deSElliott HughesAug 2, 1989: 1264*9a7741deSElliott Hughes restored -F (space) separator 1265*9a7741deSElliott Hughes 1266*9a7741deSElliott HughesJul 30, 1989: 1267*9a7741deSElliott Hughes added -v x=1 y=2 ... for immediate commandline variable assignment; 1268*9a7741deSElliott Hughes done before the BEGIN block for sure. they have to precede the 1269*9a7741deSElliott Hughes program if the program is on the commandline. 1270*9a7741deSElliott Hughes Modified Aug 2 to require a separate -v for each assignment. 1271*9a7741deSElliott Hughes 1272*9a7741deSElliott HughesJul 10, 1989: 1273*9a7741deSElliott Hughes fixed ref-thru-zero bug in environment code in tran.c 1274*9a7741deSElliott Hughes 1275*9a7741deSElliott HughesJun 23, 1989: 1276*9a7741deSElliott Hughes add newline to usage message. 1277*9a7741deSElliott Hughes 1278*9a7741deSElliott HughesJun 14, 1989: 1279*9a7741deSElliott Hughes added some missing ansi printf conversion letters: %i %X %E %G. 1280*9a7741deSElliott Hughes no sensible meaning for h or L, so they may not do what one expects. 1281*9a7741deSElliott Hughes 1282*9a7741deSElliott Hughes made %* conversions work. 1283*9a7741deSElliott Hughes 1284*9a7741deSElliott Hughes changed x^y so that if n is a positive integer, it's done 1285*9a7741deSElliott Hughes by explicit multiplication, thus achieving maximum accuracy. 1286*9a7741deSElliott Hughes (this should be done by pow() but it seems not to be locally.) 1287*9a7741deSElliott Hughes done to x ^= y as well. 1288*9a7741deSElliott Hughes 1289*9a7741deSElliott HughesJun 4, 1989: 1290*9a7741deSElliott Hughes ENVIRON array contains environment: if shell variable V=thing, 1291*9a7741deSElliott Hughes ENVIRON["V"] is "thing" 1292*9a7741deSElliott Hughes 1293*9a7741deSElliott Hughes multiple -f arguments permitted. error reporting is naive. 1294*9a7741deSElliott Hughes (they were permitted before, but only the last was used.) 1295*9a7741deSElliott Hughes 1296*9a7741deSElliott Hughes fixed a really stupid botch in the debugging macro dprintf 1297*9a7741deSElliott Hughes 1298*9a7741deSElliott Hughes fixed order of evaluation of commandline assignments to match 1299*9a7741deSElliott Hughes what the book claims: an argument of the form x=e is evaluated 1300*9a7741deSElliott Hughes at the time it would have been opened if it were a filename (p 63). 1301*9a7741deSElliott Hughes this invalidates the suggested answer to ex 4-1 (p 195). 1302*9a7741deSElliott Hughes 1303*9a7741deSElliott Hughes removed some code that permitted -F (space) fieldseparator, 1304*9a7741deSElliott Hughes since it didn't quite work right anyway. (restored aug 2) 1305*9a7741deSElliott Hughes 1306*9a7741deSElliott HughesApr 27, 1989: 1307*9a7741deSElliott Hughes Line number now accumulated correctly for comment lines. 1308*9a7741deSElliott Hughes 1309*9a7741deSElliott HughesApr 26, 1989: 1310*9a7741deSElliott Hughes Debugging output now includes a version date, 1311*9a7741deSElliott Hughes if one compiles it into the source each time. 1312*9a7741deSElliott Hughes 1313*9a7741deSElliott HughesApr 9, 1989: 1314*9a7741deSElliott Hughes Changed grammar to prohibit constants as 3rd arg of sub and gsub; 1315*9a7741deSElliott Hughes prevents class of overwriting-a-constant errors. (Last one?) 1316*9a7741deSElliott Hughes This invalidates the "banana" example on page 43 of the book. 1317*9a7741deSElliott Hughes 1318*9a7741deSElliott Hughes Added \a ("alert"), \v (vertical tab), \xhhh (hexadecimal), 1319*9a7741deSElliott Hughes as in ANSI, for strings. Rescinded the sloppiness that permitted 1320*9a7741deSElliott Hughes non-octal digits in \ooo. Warning: not all compilers and libraries 1321*9a7741deSElliott Hughes will be able to deal with \x correctly. 1322*9a7741deSElliott Hughes 1323*9a7741deSElliott HughesJan 9, 1989: 1324*9a7741deSElliott Hughes Fixed bug that caused tempcell list to contain a duplicate. 1325*9a7741deSElliott Hughes The fix is kludgy. 1326*9a7741deSElliott Hughes 1327*9a7741deSElliott HughesDec 17, 1988: 1328*9a7741deSElliott Hughes Catches some more commandline errors in main. 1329*9a7741deSElliott Hughes Removed redundant decl of modf in run.c (confuses some compilers). 1330*9a7741deSElliott Hughes Warning: there's no single declaration of malloc, etc., in awk.h 1331*9a7741deSElliott Hughes that seems to satisfy all compilers. 1332*9a7741deSElliott Hughes 1333*9a7741deSElliott HughesDec 7, 1988: 1334*9a7741deSElliott Hughes Added a bit of code to error printing to avoid printing nulls. 1335*9a7741deSElliott Hughes (Not clear that it actually would.) 1336*9a7741deSElliott Hughes 1337*9a7741deSElliott HughesNov 27, 1988: 1338*9a7741deSElliott Hughes With fear and trembling, modified the grammar to permit 1339*9a7741deSElliott Hughes multiple pattern-action statements on one line without 1340*9a7741deSElliott Hughes an explicit separator. By definition, this capitulation 1341*9a7741deSElliott Hughes to the ghost of ancient implementations remains undefined 1342*9a7741deSElliott Hughes and thus subject to change without notice or apology. 1343*9a7741deSElliott Hughes DO NOT COUNT ON IT. 1344*9a7741deSElliott Hughes 1345*9a7741deSElliott HughesOct 30, 1988: 1346*9a7741deSElliott Hughes Fixed bug in call() that failed to recover storage. 1347*9a7741deSElliott Hughes 1348*9a7741deSElliott Hughes A warning is now generated if there are more arguments 1349*9a7741deSElliott Hughes in the call than in the definition (in lieu of fixing 1350*9a7741deSElliott Hughes another storage leak). 1351*9a7741deSElliott Hughes 1352*9a7741deSElliott HughesOct 20, 1988: 1353*9a7741deSElliott Hughes Fixed %c: if expr is numeric, use numeric value; 1354*9a7741deSElliott Hughes otherwise print 1st char of string value. still 1355*9a7741deSElliott Hughes doesn't work if the value is 0 -- won't print \0. 1356*9a7741deSElliott Hughes 1357*9a7741deSElliott Hughes Added a few more checks for running out of malloc. 1358*9a7741deSElliott Hughes 1359*9a7741deSElliott HughesOct 12, 1988: 1360*9a7741deSElliott Hughes Fixed bug in call() that freed local arrays twice. 1361*9a7741deSElliott Hughes 1362*9a7741deSElliott Hughes Fixed to handle deletion of non-existent array right; 1363*9a7741deSElliott Hughes complains about attempt to delete non-array element. 1364*9a7741deSElliott Hughes 1365*9a7741deSElliott HughesSep 30, 1988: 1366*9a7741deSElliott Hughes Now guarantees to evaluate all arguments of built-in 1367*9a7741deSElliott Hughes functions, as in C; the appearance is that arguments 1368*9a7741deSElliott Hughes are evaluated before the function is called. Places 1369*9a7741deSElliott Hughes affected are sub (gsub was ok), substr, printf, and 1370*9a7741deSElliott Hughes all the built-in arithmetic functions in bltin(). 1371*9a7741deSElliott Hughes A warning is generated if a bltin() is called with 1372*9a7741deSElliott Hughes the wrong number of arguments. 1373*9a7741deSElliott Hughes 1374*9a7741deSElliott Hughes This requires changing makeprof on p167 of the book. 1375*9a7741deSElliott Hughes 1376*9a7741deSElliott HughesAug 23, 1988: 1377*9a7741deSElliott Hughes setting FILENAME in BEGIN caused core dump, apparently 1378*9a7741deSElliott Hughes because it was freeing space not allocated by malloc. 1379*9a7741deSElliott Hughes 1380*9a7741deSElliott HughesJuly 24, 1988: 1381*9a7741deSElliott Hughes fixed egregious error in toupper/tolower functions. 1382*9a7741deSElliott Hughes still subject to rescinding, however. 1383*9a7741deSElliott Hughes 1384*9a7741deSElliott HughesJuly 2, 1988: 1385*9a7741deSElliott Hughes flush stdout before opening file or pipe 1386*9a7741deSElliott Hughes 1387*9a7741deSElliott HughesJuly 2, 1988: 1388*9a7741deSElliott Hughes performance bug in b.c/cgoto(): not freeing some sets of states. 1389*9a7741deSElliott Hughes partial fix only right now, and the number of states increased 1390*9a7741deSElliott Hughes to make it less obvious. 1391*9a7741deSElliott Hughes 1392*9a7741deSElliott HughesJune 1, 1988: 1393*9a7741deSElliott Hughes check error status on close 1394*9a7741deSElliott Hughes 1395*9a7741deSElliott HughesMay 28, 1988: 1396*9a7741deSElliott Hughes srand returns seed value it's using. 1397*9a7741deSElliott Hughes see 1/18/90 1398*9a7741deSElliott Hughes 1399*9a7741deSElliott HughesMay 22, 1988: 1400*9a7741deSElliott Hughes Removed limit on depth of function calls. 1401*9a7741deSElliott Hughes 1402*9a7741deSElliott HughesMay 10, 1988: 1403*9a7741deSElliott Hughes Fixed lib.c to permit _ in commandline variable names. 1404*9a7741deSElliott Hughes 1405*9a7741deSElliott HughesMar 25, 1988: 1406*9a7741deSElliott Hughes main.c fixed to recognize -- as terminator of command- 1407*9a7741deSElliott Hughes line options. Illegal options flagged. 1408*9a7741deSElliott Hughes Error reporting slightly cleaned up. 1409*9a7741deSElliott Hughes 1410*9a7741deSElliott HughesDec 2, 1987: 1411*9a7741deSElliott Hughes Newer C compilers apply a strict scope rule to extern 1412*9a7741deSElliott Hughes declarations within functions. Two extern declarations in 1413*9a7741deSElliott Hughes lib.c and tran.c have been moved to obviate this problem. 1414*9a7741deSElliott Hughes 1415*9a7741deSElliott HughesOct xx, 1987: 1416*9a7741deSElliott Hughes Reluctantly added toupper and tolower functions. 1417*9a7741deSElliott Hughes Subject to rescinding without notice. 1418*9a7741deSElliott Hughes 1419*9a7741deSElliott HughesSep 17, 1987: 1420*9a7741deSElliott Hughes Error-message printer had printf(s) instead of 1421*9a7741deSElliott Hughes printf("%s",s); got core dumps when the message 1422*9a7741deSElliott Hughes included a %. 1423*9a7741deSElliott Hughes 1424*9a7741deSElliott HughesSep 12, 1987: 1425*9a7741deSElliott Hughes Very long printf strings caused core dump; 1426*9a7741deSElliott Hughes fixed aprintf, asprintf, format to catch them. 1427*9a7741deSElliott Hughes Can still get a core dump in printf itself. 1428*9a7741deSElliott Hughes 1429*9a7741deSElliott Hughes 1430