Annotation of researchv10no/cmd/awk/FIXES, revision 1.1.1.1

1.1       root        1: Sep 12, 1987:
                      2:        Very long printf strings caused core dump;
                      3:        fixed aprintf, asprintf, format to catch them.
                      4:        Can still get a core dump in printf itself.
                      5: 
                      6: Sep 17, 1987:
                      7:        Error-message printer had printf(s) instead of
                      8:        printf("%s",s);  got core dumps when the message
                      9:        included a %.
                     10: 
                     11: Oct xx, 1987:
                     12:        Reluctantly added toupper and tolower functions.
                     13:        Subject to rescinding without notice.
                     14: 
                     15: Dec 2, 1987:
                     16:        Newer C compilers apply a strict scope rule to extern
                     17:        declarations within functions.  Two extern declarations in
                     18:        lib.c and tran.c have been moved to obviate this problem.
                     19: 
                     20: Mar 25, 1988:
                     21:        main.c fixed to recognize -- as terminator of command-
                     22:        line options.  Illegal options flagged.
                     23:        Error reporting slightly cleaned up.
                     24: 
                     25: May 10, 1988:
                     26:        Fixed lib.c to permit _ in commandline variable names.
                     27: 
                     28: May 22, 1988:
                     29:        Removed limit on depth of function calls.
                     30: 
                     31: May 28, 1988:
                     32:        srand returns seed value it's using.
                     33:        see 1/18/90
                     34: 
                     35: June 1, 1988:
                     36:        check error status on close
                     37: 
                     38: July 2, 1988:
                     39:        performance bug in b.c/cgoto(): not freeing some sets of states.
                     40:        partial fix only right now, and the number of states increased
                     41:        to make it less obvious.
                     42: 
                     43: July 2, 1988:
                     44:        flush stdout before opening file or pipe
                     45: 
                     46: July 24, 1988:
                     47:        fixed egregious error in toupper/tolower functions.
                     48:        still subject to rescinding, however.
                     49: 
                     50: Aug 23, 1988:
                     51:        setting FILENAME in BEGIN caused core dump, apparently
                     52:        because it was freeing space not allocated by malloc.
                     53: 
                     54: Sep 30, 1988:
                     55:        Now guarantees to evaluate all arguments of built-in
                     56:        functions, as in C;  the appearance is that arguments
                     57:        are evaluated before the function is called.  Places
                     58:        affected are sub (gsub was ok), substr, printf, and
                     59:        all the built-in arithmetic functions in bltin().
                     60:        A warning is generated if a bltin() is called with
                     61:        the wrong number of arguments.
                     62: 
                     63:        This requires changing makeprof on p167 of the book.
                     64: 
                     65: Oct 12, 1988:
                     66:        Fixed bug in call() that freed local arrays twice.
                     67: 
                     68:        Fixed to handle deletion of non-existent array right;
                     69:        complains about attempt to delete non-array element.
                     70: 
                     71: Oct 20, 1988:
                     72:        Fixed %c:  if expr is numeric, use numeric value;
                     73:        otherwise print 1st char of string value.
                     74: 
                     75:        Added a few more checks for running out of malloc.
                     76: 
                     77: Oct 30, 1988:
                     78:        Fixed bug in call() that failed to recover storage.
                     79: 
                     80:        A warning is now generated if there are more arguments
                     81:        in the call than in the definition (in lieu of fixing
                     82:        another storage leak).
                     83: 
                     84: Nov 27, 1988:
                     85:        With fear and trembling, modified the grammar to permit
                     86:        multiple pattern-action statements on one line without
                     87:        an explicit separator.  By definition, this capitulation
                     88:        to the ghost of ancient implementations remains undefined
                     89:        and thus subject to change without notice or apology.
                     90:        DO NOT COUNT ON IT.
                     91: 
                     92: Dec 7, 1988:
                     93:        Added a bit of code to error printing to avoid printing nulls.
                     94:        (Not clear that it actually would.)
                     95: 
                     96: Dec 17, 1988:
                     97:        Catches some more commandline errors in main.
                     98:        Removed redundant decl of modf in run.c (confuses some compilers).
                     99:        Warning:  there's no single declaration of malloc, etc., in awk.h
                    100:        that seems to satisfy all compilers.
                    101: 
                    102: Jan 9, 1989:
                    103:        Fixed bug that caused tempcell list to contain a duplicate.
                    104:        The fix is kludgy.
                    105: 
                    106: Apr 9, 1989:
                    107:        Changed grammar to prohibit constants as 3rd arg of sub and gsub;
                    108:        prevents class of overwriting-a-constant errors.  (Last one?)
                    109:        This invalidates the "banana" example on page 43 of the book.
                    110: 
                    111:        Added \a ("alert"), \v (vertical tab), \xhhh (hexadecimal),
                    112:        as in ANSI, for strings.  Rescinded the sloppiness that permitted
                    113:        non-octal digits in \ooo.  Warning:  not all compilers and libraries
                    114:        will be able to deal with \x correctly.
                    115: 
                    116: Apr 26, 1989:
                    117:        Debugging output now includes a version date,
                    118:        if one compiles it into the source each time.
                    119: 
                    120: Apr 27, 1989:
                    121:        Line number now accumulated correctly for comment lines.
                    122: 
                    123: Jun 4, 1989:
                    124:        ENVIRON array contains environment: if shell variable V=thing,
                    125:                ENVIRON["V"] is "thing"
                    126: 
                    127:        multiple -f arguments permitted.  error reporting is naive.
                    128:        (they were permitted before, but only the last was used.)
                    129: 
                    130:        fixed a really stupid botch in the debugging macro dprintf
                    131: 
                    132:        fixed order of evaluation of commandline assignments to match
                    133:        what the book claims:  an argument of the form x=e is evaluated
                    134:        at the time it would have been opened if it were a filename (p 63).
                    135:        this invalidates the suggested answer to ex 4-1 (p 195).
                    136: 
                    137:        removed some code that permitted -F (space) fieldseparator,
                    138:        since it didn't quite work right anyway.  (restored aug 2)
                    139: 
                    140: Jun 14, 1989:
                    141:        added some missing ansi printf conversion letters: %i %X %E %G.
                    142:        no sensible meaning for h or L, so they may not do what one expects.
                    143: 
                    144:        made %* conversions work.
                    145: 
                    146:        changed x^y so that if n is a positive integer, it's done
                    147:        by explicit multiplication, thus achieving maximum accuracy.
                    148:        (this should be done by pow() but it seems not to be locally.)
                    149:        done to x ^= y as well.
                    150: 
                    151: Jun 23, 1989:
                    152:        add newline to usage message.
                    153: 
                    154: Jul 10, 1989:
                    155:        fixed ref-thru-zero bug in environment code in tran.c
                    156: 
                    157: Jul 30, 1989:
                    158:        added -v x=1 y=2 ... for immediate commandline variable assignment;
                    159:        done before the BEGIN block for sure.  they have to precede the
                    160:        program if the program is on the commandline.
                    161:        Modified Aug 2 to require a separate -v for each assignment.
                    162: 
                    163: Aug 2, 1989:
                    164:        restored -F (space) separator
                    165: 
                    166: Aug 11, 1989:
                    167:        fixed bug:  commandline variable assignment has to look like
                    168:        var=something.  (consider the man page for =, in file =.1)
                    169: 
                    170:        changed number of arguments to functions to static arrays
                    171:        to avoid repeated malloc calls.
                    172: 
                    173: Aug 24, 1989:
                    174:        removed redundant relational tests against nullnode if parse
                    175:        tree already had a relational at that point.
                    176: 
                    177: Oct 11, 1989:
                    178:        FILENAME is now defined in the BEGIN block -- too many old
                    179:        programs broke.
                    180: 
                    181:        "-" means stdin in getline as well as on the commandline.
                    182: 
                    183:        added a bunch of casts to the code to tell the truth about
                    184:        char * vs. unsigned char *, a right royal pain.  added a
                    185:        setlocale call to the front of main, though probably no one
                    186:        has it usefully implemented yet.
                    187: 
                    188: Oct 18, 1989:
                    189:        another try to get the max number of open files set with
                    190:        relatively machine-independent code.
                    191: 
                    192:        small fix to input() in case of multiple reads after EOF.
                    193: 
                    194: Jan 5, 1990:
                    195:        fix potential problem in tran.c -- something was freed,
                    196:        then used in freesymtab.
                    197: 
                    198: Jan 18, 1990:
                    199:        srand now returns previous seed value (0 to start).
                    200: 
                    201: Feb 9, 1990:
                    202:        fixed null pointer dereference bug in main.c:  -F[nothing].  sigh.
                    203: 
                    204:        restored srand behavior:  it returns the current seed.
                    205: 
                    206: May 6, 1990:
                    207:        AVA fixed the grammar so that ! is uniformly of the same precedence as
                    208:        unary + and -.  This renders illegal some constructs like !x=y, which
                    209:        now has to be parenthesized as !(x=y), and makes others work properly:
                    210:        !x+y is (!x)+y, and x!y is x !y, not two pattern-action statements.
                    211:        (These problems were pointed out by Bob Lenk of Posix.)
                    212: 
                    213:        Added \x to regular expressions (already in strings).
                    214:        Limited octal to octal digits; \8 and \9 are not octal.
                    215:        Centralized the code for parsing escapes in regular expressions.
                    216:        Added a bunch of tests to T.re and T.sub to verify some of this.
                    217: 
                    218: Jun 26, 1990:
                    219:        changed struct rrow (awk.h) to use long instead of int for lval,
                    220:        since cfoll() stores a pointer in it.  now works better when int's
                    221:        are smaller than pointers!
                    222: 
                    223: Aug 24, 1990:
                    224:        changed NCHARS to 256 to handle 8-bit characters in strings
                    225:        presented to match(), etc.
                    226: 
                    227: Oct 8, 1990:
                    228:        fixed horrible bug:  types and values were not preserved in
                    229:        some kinds of self-assignment. (in assign().)
                    230: 
                    231: Oct 14, 1990:
                    232:        fixed the bug on p. 198 in which it couldn't deduce that an
                    233:        argument was an array in some contexts.  replaced the error
                    234:        message in intest() by code that damn well makes it an array.
                    235: 
                    236: Oct 29, 1990:
                    237:        fixed sleazy buggy code in lib.c that looked (incorrectly) for
                    238:        too long input lines.
                    239: 
                    240: Nov 2, 1990:
                    241:        fixed sleazy test for integrality in getsval;  use modf.
                    242: 
                    243: Jan 11, 1991:
                    244:        failed to set numeric state on $0 in cmd|getline context in run.c.
                    245: 
                    246: Jan 28, 1991:
                    247:        awk -f - reads the program from stdin.
                    248: 
                    249: Feb 10, 1991:
                    250:        check error status on all writes, to avoid banging on full disks.
                    251: 
                    252: May 6, 1991:
                    253:        fixed silly bug in hex parsing in hexstr().
                    254:        removed an apparently unnecessary test in isnumber().
                    255:        warn about weird printf conversions.
                    256:        fixed unchecked array overwrite in relex().
                    257: 
                    258:        changed for (i in array) to access elements in sorted order.
                    259:        then unchanged it -- it really does run slower in too many cases.
                    260:        left the code in place, commented out.
                    261: 
                    262: May 13, 1991:
                    263:        removed extra arg on gettemp, tempfree.  minor error message rewording.
                    264: 
                    265: Jun 2, 1991:
                    266:        better defense against very long printf strings.
                    267:        made break and continue illegal outside of loops.
                    268: 
                    269: Jun 30, 1991:
                    270:        better test for detecting too-long output record.
                    271: 
                    272: Jul 21, 1991:
                    273:        fixed so that in self-assignment like $1=$1, side effects
                    274:        like recomputing $0 take place.  (this is getting subtle.)
                    275: 
                    276: Jul 27, 1991:
                    277:        allow newline after ; in for statements.
                    278: 
                    279: Aug 18, 1991:
                    280:        enforce variable name syntax for commandline variables: has to
                    281:        start with letter or _.
                    282: 
                    283: Sep 24, 1991:
                    284:        increased buffer in gsub.  a very crude fix to a general problem.
                    285:        and again on Sep 26.
                    286: 
                    287: Nov 12, 1991:
                    288:        cranked up some fixed-size arrays in b.c, and added a test for
                    289:        overflow in penter.  thanks to mark larsen.
                    290: 
                    291: Nov 19, 1991:
                    292:        use RAND_MAX instead of literal in builtin().
                    293: 
                    294: Nov 30, 1991:
                    295:        fixed storage leak in freefa, failing to recover [N]CCL.
                    296:        thanks to Bill Jones ([email protected])
                    297: 
                    298: Dec 2, 1991:
                    299:        die-casting time:  converted to ansi C, installed that.
                    300: 
                    301: Feb 20, 1992:
                    302:        recompile after abortive changes;  should be unchanged.
                    303: 
                    304: Apr 12, 1992:
                    305:        added explicit check for /dev/std(in,out,err) in redirection.
                    306:        unlike gawk, no /dev/fd/n yet.
                    307: 
                    308:        added fflush(file/pipe) builtin.  hard to test satisfactorily.
                    309:        not posix.
                    310: 
                    311: Apr 24, 1992:
                    312:        remove redundant close of stdin when using -f -.
                    313: 
                    314:        got rid of core dump with -d; awk -d just prints date.
                    315: 
                    316: May 31, 1992:
                    317:        added -mr N and -mf N options: more record and fields.
                    318:        these really ought to adjust automatically.
                    319: 
                    320:        cleaned up some error messages; "out of space" now means
                    321:        malloc returned NULL in all cases.
                    322: 
                    323:        changed rehash so that if it runs out, it just returns;
                    324:        things will continue to run slow, but maybe a bit longer.

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.