summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2010-07-16 12:59:03 +0300
committerArnold D. Robbins <arnold@skeeve.com>2010-07-16 12:59:03 +0300
commitb9e4a1fd4c8c8753ab8a9887bab55f03efe1e3e2 (patch)
treee6f86edd2f661aff2cd81eb4d4a54fa86fd4fe60
parent3ca7f0b16d0a5c105380b284a81c6a1b2c210908 (diff)
downloadgawk-b9e4a1fd4c8c8753ab8a9887bab55f03efe1e3e2.tar.gz
Move to gawk-3.0.6.gawk-3.0.6
-rw-r--r--ChangeLog59
-rw-r--r--NEWS23
-rw-r--r--README2
-rw-r--r--README_d/README.beos30
-rw-r--r--array.c104
-rw-r--r--atari/ChangeLog4
-rw-r--r--awk.h2
-rw-r--r--awk.y35
-rw-r--r--awklib/ChangeLog4
-rw-r--r--awktab.c527
-rw-r--r--builtin.c3
-rw-r--r--doc/ChangeLog4
-rw-r--r--doc/awkcard.in2
-rw-r--r--doc/gawk.17
-rw-r--r--doc/gawk.info61
-rw-r--r--doc/gawk.texi25
-rw-r--r--eval.c80
-rw-r--r--io.c7
-rw-r--r--missing/strncasecmp.c39
-rw-r--r--patchlevel.h2
-rw-r--r--pc/ChangeLog4
-rwxr-xr-xpc/Makefile.tst12
-rw-r--r--posix/ChangeLog4
-rw-r--r--regex.c32
-rw-r--r--test/ChangeLog19
-rw-r--r--test/Makefile.in14
-rw-r--r--test/arysubnm.awk1
-rw-r--r--test/arysubnm.ok1
-rw-r--r--test/fnparydl.awk31
-rw-r--r--test/fnparydl.ok10
-rw-r--r--test/nlstrina.awk77
-rw-r--r--test/nlstrina.ok3
-rw-r--r--vms/ChangeLog12
-rw-r--r--vms/descrip.mms2
-rw-r--r--vms/gawk.hlp4
-rw-r--r--vms/vmsbuild.com2
-rw-r--r--vms/vmstest.com102
37 files changed, 920 insertions, 430 deletions
diff --git a/ChangeLog b/ChangeLog
index 31ecec85..95f9aeae 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,62 @@
+Mon Aug 7 15:23:00 2000 Arnold D. Robbins <arnold@skeeve.com>
+
+ * Release 3.0.6: Release tar file made.
+
+Thu Aug 3 17:47:53 2000 Greg McGary <greg@mcgary.org>
+
+ * regex.c: patches for gcc bounded pointer handling.
+
+Thu Aug 3 13:09:09 2000 Arnold D. Robbins <arnold@skeeve.com>
+
+ * array.c (in_array, do_delete): fix tests for index equality
+ when searching through the array to work correctly when
+ index is "".
+
+Fri Jul 14 21:40:17 2000 Pat Rankin <rankin@eql.caltech.edu>
+
+ * builtin.c (format_tree): Workaround a DEC C V5.7 bug by
+ splitting `strcpy() + 3' into two expressions (the builtin
+ inline strcpy evidently has erroneous return type of void *
+ instead of char *; reputedly fixed in V6.1).
+
+ * eval.c (C): New macro.
+ [casetable]: Use it to add explicit casts for the character
+ values outside the range of 0 to 127.
+ * missing/strncasecmp.c [C, charmap]: Likewise.
+
+ * io.c (redirect): Add EIO check on failed open for VMS.
+
+Fri Jul 14 11:57:23 2000 Arnold D. Robbins <arnold@skeeve.com>
+
+ Efficiency hack: turn `for (iggy in foo) delete foo[iggy]'
+ into moral equivalent of `delete foo'.
+ * array.c (do_delete_loop): new routine.
+ * awk.h [NODETYPE]: new Node_K_delete_loop value.
+ Add declaration of do_delete_loop.
+ * awk.y [LEX_FOR]: Fix code to recognize special case.
+ * eval.c (nodetypes): new entry for Node_K_delete_loop.
+ (interpret): add case for Node_K_delete_loop, add more
+ diagnostic info in default (cant_happen) case.
+
+Tue Jul 11 22:15:10 2000 Pat Rankin <rankin@eql.caltech.edu>
+
+ * awk.y (nextc): Recast unsigned char values back to int to
+ prevent VAX C from truncating EOF to 255.
+
+Tue Jul 11 14:08:23 2000 Arnold D. Robbins <arnold@skeeve.com>
+
+ * array.c (do_delete): switch to string comparison, not
+ cmp_nodes.
+ (assoc_find): add call to force_string on subscript.
+ * eval.c (interpret): Case Node_K_arrayfor: check for
+ Node_array_ref and fetch original_array. Yowser.
+
+Fri Jun 30 21:57:00 2000 Arnold D. Robbins <arnold@skeeve.com>
+
+ * array.c (assoc_lookup): Don't force the subscript
+ to be a string. Not a good idea after the change
+ to using dupnode.
+
Sun Jun 25 15:08:19 2000 Arnold D. Robbins <arnold@skeeve.com>
* Release 3.0.5: Release tar file made.
diff --git a/NEWS b/NEWS
index 3463cb3f..fc8798ff 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,24 @@
+Changes from 3.0.5 to 3.0.6
+---------------------------
+
+This is a bug fix release only, pending further development on 3.1.0.
+
+Bugs fixed and changes made:
+
+1. Subscripting an array with a variable that is just a number no
+ longer magically converts the variable into a string.
+
+2. Similarly, running a `for (iggy in foo)' loop where `foo' is a
+ function parameter now works correctly.
+
+3. Similarly, `i = ""; v[i] = a; if (v in a) ...' now works again.
+
+4. Gawk now special cases `for (iggy in foo) delete foo[iggy]' and
+ treats it as the moral equivalent of `delete foo'. This should be
+ a major efficiency win when portably deleting large arrays.
+
+5. VMS port brought up to date.
+
Changes from 3.0.4 to 3.0.5
---------------------------
@@ -46,6 +67,8 @@ Bugs Fixed:
16. Global arrays passed to functions are now managed better. In particular,
test/arynocls.awk won't crash referencing freed memory.
+17. In obscure cases, `getline var' can no longer clobber $0.
+
Changes from 3.0.3 to 3.0.4
---------------------------
diff --git a/README b/README
index b5830ea3..bc36f4cf 100644
--- a/README
+++ b/README
@@ -1,6 +1,6 @@
README:
-This is GNU Awk 3.0.5. It should be upwardly compatible with the Bell
+This is GNU Awk 3.0.6. It should be upwardly compatible with the Bell
Labs research version of awk. It is almost completely compliant with
the 1993 POSIX 1003.2 standard for awk. (See the note below about POSIX.)
diff --git a/README_d/README.beos b/README_d/README.beos
new file mode 100644
index 00000000..be0540d5
--- /dev/null
+++ b/README_d/README.beos
@@ -0,0 +1,30 @@
+From mc@whoever.com Sun Jul 23 17:06:38 2000
+Date: Sun, 23 Jul 2000 07:23:49 +0100
+Subject: Re: gawk-3.0.5 results on BeOS
+From: Martin C Brown <mc@whoever.com>
+To: Aharon Robbins <arnold@skeeve.com>, <haible@ilog.fr>
+
+Arnold/Bruno,
+
+> This is a known BeOS problem. I am cc'ing the BeOS port person.
+> Sorry I don't have a fix.
+
+This problem is directly related to the FOPEN_MAX/OPEN_MAX parameter used in
+the stdio library by the BeOS. It seems that the BeOS strictly enforces this
+number to the point that opening the 128th file causes all previously opened
+files (except stdin/out/err) to be closed - hence the bad number.
+
+I've tried this outside of gawk and the same thing happens, so it's not a
+gawk problem.
+
+I've spent the past few days trying to find a suitable workaround, but it's
+obviously difficult trying to patch a kernel from the outside :))
+
+I'll be reporting this as a bug to Be shortly.
+
+MC
+
+--
+Martin 'MC' Brown, mc@mcslp.com http://www.mcwords.com
+Writer, Author, Consultant
+'Life is pain, anyone who says differently is selling something'
diff --git a/array.c b/array.c
index 2cbfae89..da1ac3ff 100644
--- a/array.c
+++ b/array.c
@@ -223,11 +223,14 @@ int hash1;
* Array indexes are strings; compare as such, always!
*/
s1 = bucket->ahname;
+ s1 = force_string(s1);
s2 = subs;
- if (s1->stlen == s2->stlen
- && STREQN(s1->stptr, s2->stptr, s1->stlen))
- return bucket;
+ if (s1->stlen == s2->stlen) {
+ if (s1->stlen == 0 /* "" is a valid index */
+ || STREQN(s1->stptr, s2->stptr, s1->stlen))
+ return bucket;
+ }
}
return NULL;
}
@@ -324,9 +327,6 @@ NODE *symbol, *subs;
bucket->ahname = dupnode(subs);
free_temp(subs);
- /* array subscripts are strings */
- bucket->ahname->flags &= ~NUMBER;
- bucket->ahname->flags |= STRING;
bucket->ahvalue = Nnull_string;
bucket->ahnext = symbol->var_array[hash1];
symbol->var_array[hash1] = bucket;
@@ -367,9 +367,24 @@ NODE *symbol, *tree;
last = NULL;
for (bucket = symbol->var_array[hash1]; bucket != NULL;
- last = bucket, bucket = bucket->ahnext)
- if (cmp_nodes(bucket->ahname, subs) == 0)
- break;
+ last = bucket, bucket = bucket->ahnext) {
+ /*
+ * This used to use cmp_nodes() here. That's wrong.
+ * Array indexes are strings; compare as such, always!
+ */
+ NODE *s1, *s2;
+
+ s1 = bucket->ahname;
+ s1 = force_string(s1);
+ s2 = subs;
+
+ if (s1->stlen == s2->stlen) {
+ if (s1->stlen == 0 /* "" is a valid index */
+ || STREQN(s1->stptr, s2->stptr, s1->stlen))
+ break;
+ }
+ }
+
if (bucket == NULL) {
if (do_lint)
warning("delete: index `%s' not in array `%s'",
@@ -396,6 +411,50 @@ NODE *symbol, *tree;
}
}
+/* do_delete_loop --- simulate ``for (iggy in foo) delete foo[iggy]'' */
+
+/*
+ * The primary hassle here is that `iggy' needs to have some arbitrary
+ * array index put in it before we can clear the array, we can't
+ * just replace the loop with `delete foo'.
+ */
+
+void
+do_delete_loop(symbol, tree)
+NODE *symbol, *tree;
+{
+ size_t i;
+ NODE *n, **lhs;
+ Func_ptr after_assign = NULL;
+
+ if (symbol->type == Node_param_list) {
+ symbol = stack_ptr[symbol->param_cnt];
+ if (symbol->type == Node_var)
+ return;
+ }
+ if (symbol->type == Node_array_ref)
+ symbol = symbol->orig_array;
+ if (symbol->type == Node_var_array) {
+ if (symbol->var_array == NULL)
+ return;
+ } else
+ fatal("delete: illegal use of variable `%s' as array",
+ symbol->vname);
+
+ /* get first index value */
+ for (i = 0; i < symbol->array_size; i++) {
+ if (symbol->var_array[i] != NULL) {
+ lhs = get_lhs(tree->lnode, & after_assign);
+ unref(*lhs);
+ *lhs = dupnode(symbol->var_array[i]->ahname);
+ break;
+ }
+ }
+
+ /* blast the array in one shot */
+ assoc_clear(symbol);
+}
+
/* assoc_scan --- start a ``for (iggy in foo)'' loop */
void
@@ -558,22 +617,31 @@ NODE *symbol;
NODE *bucket;
if (symbol->var_array == NULL) {
- printf("%s: empty\n", symbol->vname);
+ printf("%s: empty (null)\n", symbol->vname);
return tmp_number((AWKNUM) 0);
}
+ if (symbol->table_size == 0) {
+ printf("%s: empty (zero)\n", symbol->vname);
+ return tmp_number((AWKNUM) 0);
+ }
+
+ printf("%s: table_size = %d, array_size = %d\n", symbol->vname,
+ symbol->table_size, symbol->array_size);
+
for (i = 0; i < symbol->array_size; i++) {
for (bucket = symbol->var_array[i]; bucket != NULL;
bucket = bucket->ahnext) {
- printf("%s: i: (%p, %ld, %s) %.*s, v: ",
+ printf("%s: I: [(%p, %ld, %s) len %d <%.*s>] V: [",
symbol->vname,
bucket->ahname,
bucket->ahname->stref,
flags2str(bucket->ahname->flags),
(int) bucket->ahname->stlen,
+ (int) bucket->ahname->stlen,
bucket->ahname->stptr);
pr_node(bucket->ahvalue);
- printf("\n");
+ printf("]\n");
}
}
@@ -589,6 +657,18 @@ NODE *tree;
NODE *r, *a;
a = tree->lnode;
+
+ if (a->type == Node_param_list) {
+ printf("%s: is paramater\n", a->vname);
+ a = stack_ptr[a->param_cnt];
+ }
+
+ if (a->type == Node_array_ref) {
+ printf("%s: array_ref to %s\n", a->vname,
+ a->orig_array->vname);
+ a = a->orig_array;
+ }
+
r = assoc_dump(a);
return r;
diff --git a/atari/ChangeLog b/atari/ChangeLog
index 555c9803..0e2de7af 100644
--- a/atari/ChangeLog
+++ b/atari/ChangeLog
@@ -1,3 +1,7 @@
+Mon Aug 7 15:23:00 2000 Arnold D. Robbins <arnold@skeeve.com>
+
+ * Release 3.0.6: Release tar file made.
+
Sun Jun 25 15:08:19 2000 Arnold D. Robbins <arnold@skeeve.com>
* Release 3.0.5: Release tar file made.
diff --git a/awk.h b/awk.h
index e6c3be86..246c6ef5 100644
--- a/awk.h
+++ b/awk.h
@@ -293,6 +293,7 @@ typedef enum nodevals {
Node_K_do, /* lnode is conditional, rnode stuff to run */
Node_K_return, /* lnode is return value */
Node_K_delete, /* lnode is array, rnode is subscript */
+ Node_K_delete_loop, /* lnode is array, rnode is subscript */
Node_K_getline, /* lnode is opt var, rnode is redirection */
Node_K_function, /* lnode is statement list, rnode is params */
Node_K_nextfile, /* no subs */
@@ -718,6 +719,7 @@ extern unsigned int hash P((const char *s, size_t len, unsigned long hsize));
extern int in_array P((NODE *symbol, NODE *subs));
extern NODE **assoc_lookup P((NODE *symbol, NODE *subs));
extern void do_delete P((NODE *symbol, NODE *tree));
+extern void do_delete_loop P((NODE *symbol, NODE *tree));
extern void assoc_scan P((NODE *symbol, struct search *lookat));
extern void assoc_next P((struct search *lookat));
extern NODE *assoc_dump P((NODE *symbol));
diff --git a/awk.y b/awk.y
index dedb9730..f6fdfcc5 100644
--- a/awk.y
+++ b/awk.y
@@ -385,9 +385,30 @@ statement
{ $$ = node($6, Node_K_do, $3); }
| LEX_FOR '(' NAME LEX_IN NAME r_paren opt_nls statement
{
- $$ = node($8, Node_K_arrayfor,
- make_for_loop(variable($3, CAN_FREE, Node_var),
- (NODE *) NULL, variable($5, CAN_FREE, Node_var_array)));
+ /*
+ * Efficiency hack. Recognize the special case of
+ *
+ * for (iggy in foo)
+ * delete foo[iggy]
+ *
+ * and treat it as if it were
+ *
+ * delete foo
+ *
+ * Check that the body is a `delete a[i]' statement,
+ * and that both the loop var and array names match.
+ */
+ if ($8->type == Node_K_delete
+ && $8->rnode != NULL
+ && strcmp($3, $8->rnode->var_value->vname) == 0
+ && strcmp($5, $8->lnode->vname) == 0) {
+ $8->type = Node_K_delete_loop;
+ $$ = $8;
+ } else {
+ $$ = node($8, Node_K_arrayfor,
+ make_for_loop(variable($3, CAN_FREE, Node_var),
+ (NODE *) NULL, variable($5, CAN_FREE, Node_var_array)));
+ }
}
| LEX_FOR '(' opt_exp semi exp semi opt_exp r_paren opt_nls statement
{
@@ -1216,9 +1237,9 @@ nextc()
int c;
if (lexptr && lexptr < lexend)
- c = (unsigned char) *lexptr++;
+ c = (int) (unsigned char) *lexptr++;
else if (get_src_buf())
- c = (unsigned char) *lexptr++;
+ c = (int) (unsigned char) *lexptr++;
else
c = EOF;
@@ -1226,8 +1247,8 @@ nextc()
}
#else
#define nextc() ((lexptr && lexptr < lexend) ? \
- ((unsigned char) *lexptr++) : \
- (get_src_buf() ? ((unsigned char) *lexptr++) : EOF) \
+ ((int) (unsigned char) *lexptr++) : \
+ (get_src_buf() ? ((int) (unsigned char) *lexptr++) : EOF) \
)
#endif
diff --git a/awklib/ChangeLog b/awklib/ChangeLog
index 021f5542..1ec88a5f 100644
--- a/awklib/ChangeLog
+++ b/awklib/ChangeLog
@@ -1,3 +1,7 @@
+Mon Aug 7 15:23:00 2000 Arnold D. Robbins <arnold@skeeve.com>
+
+ * Release 3.0.6: Release tar file made.
+
Sun Jun 25 15:08:19 2000 Arnold D. Robbins <arnold@skeeve.com>
* Release 3.0.5: Release tar file made.
diff --git a/awktab.c b/awktab.c
index 2f801ce6..23aa4fb3 100644
--- a/awktab.c
+++ b/awktab.c
@@ -1,47 +1,48 @@
/* A Bison parser, made from ./awk.y
- by GNU Bison version 1.28 */
+ by GNU Bison version 1.25
+ */
#define YYBISON 1 /* Identify Bison output. */
-#define FUNC_CALL 257
-#define NAME 258
-#define REGEXP 259
-#define ERROR 260
-#define YNUMBER 261
-#define YSTRING 262
-#define RELOP 263
-#define APPEND_OP 264
-#define ASSIGNOP 265
-#define MATCHOP 266
-#define NEWLINE 267
-#define CONCAT_OP 268
-#define LEX_BEGIN 269
-#define LEX_END 270
-#define LEX_IF 271
-#define LEX_ELSE 272
-#define LEX_RETURN 273
-#define LEX_DELETE 274
-#define LEX_WHILE 275
-#define LEX_DO 276
-#define LEX_FOR 277
-#define LEX_BREAK 278
-#define LEX_CONTINUE 279
-#define LEX_PRINT 280
-#define LEX_PRINTF 281
-#define LEX_NEXT 282
-#define LEX_EXIT 283
-#define LEX_FUNCTION 284
-#define LEX_GETLINE 285
-#define LEX_NEXTFILE 286
-#define LEX_IN 287
-#define LEX_AND 288
-#define LEX_OR 289
-#define INCREMENT 290
-#define DECREMENT 291
-#define LEX_BUILTIN 292
-#define LEX_LENGTH 293
-#define UNARY 294
+#define FUNC_CALL 258
+#define NAME 259
+#define REGEXP 260
+#define ERROR 261
+#define YNUMBER 262
+#define YSTRING 263
+#define RELOP 264
+#define APPEND_OP 265
+#define ASSIGNOP 266
+#define MATCHOP 267
+#define NEWLINE 268
+#define CONCAT_OP 269
+#define LEX_BEGIN 270
+#define LEX_END 271
+#define LEX_IF 272
+#define LEX_ELSE 273
+#define LEX_RETURN 274
+#define LEX_DELETE 275
+#define LEX_WHILE 276
+#define LEX_DO 277
+#define LEX_FOR 278
+#define LEX_BREAK 279
+#define LEX_CONTINUE 280
+#define LEX_PRINT 281
+#define LEX_PRINTF 282
+#define LEX_NEXT 283
+#define LEX_EXIT 284
+#define LEX_FUNCTION 285
+#define LEX_GETLINE 286
+#define LEX_NEXTFILE 287
+#define LEX_IN 288
+#define LEX_AND 289
+#define LEX_OR 290
+#define INCREMENT 291
+#define DECREMENT 292
+#define LEX_BUILTIN 293
+#define LEX_LENGTH 294
+#define UNARY 295
#line 26 "./awk.y"
@@ -129,7 +130,7 @@ typedef union {
#define YYFLAG -32768
#define YYNTBASE 62
-#define YYTRANSLATE(x) ((unsigned)(x) <= 294 ? yytranslate[x] : 107)
+#define YYTRANSLATE(x) ((unsigned)(x) <= 295 ? yytranslate[x] : 107)
static const char yytranslate[] = { 0,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
@@ -157,11 +158,11 @@ static const char yytranslate[] = { 0,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 1, 3, 4, 5, 6,
- 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
- 17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
- 27, 28, 29, 30, 31, 32, 33, 34, 35, 36,
- 37, 38, 39, 52
+ 2, 2, 2, 2, 2, 1, 2, 3, 4, 5,
+ 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
+ 16, 17, 18, 19, 20, 21, 22, 23, 24, 25,
+ 26, 27, 28, 29, 30, 31, 32, 33, 34, 35,
+ 36, 37, 38, 39, 52
};
#if YYDEBUG != 0
@@ -250,19 +251,19 @@ static const short yyrline[] = { 0,
220, 226, 232, 234, 236, 249, 258, 260, 262, 272,
273, 277, 281, 296, 301, 310, 312, 321, 323, 341,
343, 348, 354, 362, 364, 369, 370, 374, 376, 378,
- 380, 382, 384, 386, 392, 396, 401, 404, 407, 409,
- 429, 468, 487, 489, 494, 496, 498, 512, 517, 519,
- 524, 529, 536, 538, 542, 543, 547, 549, 554, 556,
- 558, 560, 565, 567, 572, 574, 576, 578, 580, 586,
- 588, 593, 595, 600, 602, 608, 610, 612, 614, 619,
- 621, 626, 628, 634, 636, 638, 640, 645, 648, 653,
- 655, 660, 666, 668, 670, 676, 686, 694, 696, 702,
- 704, 706, 708, 710, 715, 718, 719, 721, 723, 729,
- 731, 733, 735, 737, 739, 741, 743, 748, 750, 752,
- 754, 756, 758, 760, 762, 764, 769, 771, 773, 776,
- 778, 786, 793, 794, 796, 798, 800, 803, 811, 822,
- 824, 829, 831, 841, 846, 850, 854, 858, 859, 863,
- 866
+ 380, 382, 384, 386, 413, 417, 422, 425, 428, 430,
+ 450, 489, 508, 510, 515, 517, 519, 533, 538, 540,
+ 545, 550, 557, 559, 563, 564, 568, 570, 575, 577,
+ 579, 581, 586, 588, 593, 595, 597, 599, 601, 607,
+ 609, 614, 616, 621, 623, 629, 631, 633, 635, 640,
+ 642, 647, 649, 655, 657, 659, 661, 666, 669, 674,
+ 676, 681, 687, 689, 691, 697, 707, 715, 717, 723,
+ 725, 727, 729, 731, 736, 739, 740, 742, 744, 750,
+ 752, 754, 756, 758, 760, 762, 764, 769, 771, 773,
+ 775, 777, 779, 781, 783, 785, 790, 792, 794, 797,
+ 799, 807, 814, 815, 817, 819, 821, 824, 832, 843,
+ 845, 850, 852, 862, 867, 871, 875, 879, 880, 884,
+ 887
};
#endif
@@ -780,8 +781,7 @@ static const short yycheck[] = { 3,
46, 47, -1, -1, -1, 51, -1, -1, 54, 55
};
/* -*-C-*- Note some compilers choke on comments on `#line' lines. */
-#line 3 "/usr/lib/bison.simple"
-/* This file comes from bison-1.28. */
+#line 3 "/usr/share/bison.simple"
/* Skeleton output parser for bison,
Copyright (C) 1984, 1989, 1990 Free Software Foundation, Inc.
@@ -798,66 +798,46 @@ static const short yycheck[] = { 3,
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
/* As a special exception, when this file is copied by Bison into a
Bison output file, you may use that output file without restriction.
This special exception was added by the Free Software Foundation
in version 1.24 of Bison. */
-/* This is the parser code that is written into each bison parser
- when the %semantic_parser declaration is not specified in the grammar.
- It was written by Richard Stallman by simplifying the hairy parser
- used when %semantic_parser is specified. */
-
-#ifndef YYSTACK_USE_ALLOCA
-#ifdef alloca
-#define YYSTACK_USE_ALLOCA
-#else /* alloca not defined */
+#ifndef alloca
#ifdef __GNUC__
-#define YYSTACK_USE_ALLOCA
#define alloca __builtin_alloca
#else /* not GNU C. */
-#if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || defined (__sgi) || (defined (__sun) && defined (__i386))
-#define YYSTACK_USE_ALLOCA
+#if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || defined (__sgi)
#include <alloca.h>
#else /* not sparc */
-/* We think this test detects Watcom and Microsoft C. */
-/* This used to test MSDOS, but that is a bad idea
- since that symbol is in the user namespace. */
-#if (defined (_MSDOS) || defined (_MSDOS_)) && !defined (__TURBOC__)
-#if 0 /* No need for malloc.h, which pollutes the namespace;
- instead, just don't use alloca. */
+#if defined (MSDOS) && !defined (__TURBOC__)
#include <malloc.h>
-#endif
#else /* not MSDOS, or __TURBOC__ */
#if defined(_AIX)
-/* I don't know what this was needed for, but it pollutes the namespace.
- So I turned it off. rms, 2 May 1997. */
-/* #include <malloc.h> */
+#include <malloc.h>
#pragma alloca
-#define YYSTACK_USE_ALLOCA
-#else /* not MSDOS, or __TURBOC__, or _AIX */
-#if 0
-#ifdef __hpux /* haible@ilog.fr says this works for HPUX 9.05 and up,
- and on HPUX 10. Eventually we can turn this on. */
-#define YYSTACK_USE_ALLOCA
-#define alloca __builtin_alloca
+#else /* not MSDOS, __TURBOC__, or _AIX */
+#ifdef __hpux
+#ifdef __cplusplus
+extern "C" {
+void *alloca (unsigned int);
+};
+#else /* not __cplusplus */
+void *alloca ();
+#endif /* not __cplusplus */
#endif /* __hpux */
-#endif
#endif /* not _AIX */
#endif /* not MSDOS, or __TURBOC__ */
-#endif /* not sparc */
-#endif /* not GNU C */
-#endif /* alloca not defined */
-#endif /* YYSTACK_USE_ALLOCA not defined */
+#endif /* not sparc. */
+#endif /* not GNU C. */
+#endif /* alloca not defined. */
-#ifdef YYSTACK_USE_ALLOCA
-#define YYSTACK_ALLOC alloca
-#else
-#define YYSTACK_ALLOC malloc
-#endif
+/* This is the parser code that is written into each bison parser
+ when the %semantic_parser declaration is not specified in the grammar.
+ It was written by Richard Stallman by simplifying the hairy parser
+ used when %semantic_parser is specified. */
/* Note: there must be only one dollar sign in this file.
It is replaced by the list of actions, each action
@@ -867,8 +847,8 @@ static const short yycheck[] = { 3,
#define yyclearin (yychar = YYEMPTY)
#define YYEMPTY -2
#define YYEOF 0
-#define YYACCEPT goto yyacceptlab
-#define YYABORT goto yyabortlab
+#define YYACCEPT return(0)
+#define YYABORT return(1)
#define YYERROR goto yyerrlab1
/* Like YYERROR except do call yyerror.
This remains here temporarily to ease the
@@ -949,12 +929,16 @@ int yydebug; /* nonzero means print parse trace */
#ifndef YYMAXDEPTH
#define YYMAXDEPTH 10000
#endif
-
-/* Define __yy_memcpy. Note that the size argument
- should be passed with type unsigned int, because that is what the non-GCC
- definitions require. With GCC, __builtin_memcpy takes an arg
- of type size_t, but it can handle unsigned int. */
+#ifndef YYPARSE_RETURN_TYPE
+#define YYPARSE_RETURN_TYPE int
+#endif
+
+/* Prevent warning if -Wstrict-prototypes. */
+#ifdef __GNUC__
+YYPARSE_RETURN_TYPE yyparse (void);
+#endif
+
#if __GNUC__ > 1 /* GNU C and GNU C++ define this. */
#define __yy_memcpy(TO,FROM,COUNT) __builtin_memcpy(TO,FROM,COUNT)
#else /* not GNU C or C++ */
@@ -966,7 +950,7 @@ static void
__yy_memcpy (to, from, count)
char *to;
char *from;
- unsigned int count;
+ int count;
{
register char *f = from;
register char *t = to;
@@ -981,10 +965,10 @@ __yy_memcpy (to, from, count)
/* This is the most reliable way to avoid incompatibilities
in available built-in functions on various systems. */
static void
-__yy_memcpy (char *to, char *from, unsigned int count)
+__yy_memcpy (char *to, char *from, int count)
{
- register char *t = to;
register char *f = from;
+ register char *t = to;
register int i = count;
while (i-- > 0)
@@ -994,7 +978,7 @@ __yy_memcpy (char *to, char *from, unsigned int count)
#endif
#endif
-#line 217 "/usr/lib/bison.simple"
+#line 196 "/usr/share/bison.simple"
/* The user can define YYPARSE_PARAM as the name of an argument to be passed
into yyparse. The argument should have type void *.
@@ -1015,16 +999,7 @@ __yy_memcpy (char *to, char *from, unsigned int count)
#define YYPARSE_PARAM_DECL
#endif /* not YYPARSE_PARAM */
-/* Prevent warning if -Wstrict-prototypes. */
-#ifdef __GNUC__
-#ifdef YYPARSE_PARAM
-int yyparse (void *);
-#else
-int yyparse (void);
-#endif
-#endif
-
-int
+YYPARSE_RETURN_TYPE
yyparse(YYPARSE_PARAM_ARG)
YYPARSE_PARAM_DECL
{
@@ -1052,7 +1027,6 @@ yyparse(YYPARSE_PARAM_ARG)
#endif
int yystacksize = YYINITDEPTH;
- int yyfree_stacks = 0;
#ifdef YYPURE
int yychar;
@@ -1137,32 +1111,18 @@ yynewstate:
if (yystacksize >= YYMAXDEPTH)
{
yyerror("parser stack overflow");
- if (yyfree_stacks)
- {
- free (yyss);
- free (yyvs);
-#ifdef YYLSP_NEEDED
- free (yyls);
-#endif
- }
return 2;
}
yystacksize *= 2;
if (yystacksize > YYMAXDEPTH)
yystacksize = YYMAXDEPTH;
-#ifndef YYSTACK_USE_ALLOCA
- yyfree_stacks = 1;
-#endif
- yyss = (short *) YYSTACK_ALLOC (yystacksize * sizeof (*yyssp));
- __yy_memcpy ((char *)yyss, (char *)yyss1,
- size * (unsigned int) sizeof (*yyssp));
- yyvs = (YYSTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yyvsp));
- __yy_memcpy ((char *)yyvs, (char *)yyvs1,
- size * (unsigned int) sizeof (*yyvsp));
+ yyss = (short *) alloca (yystacksize * sizeof (*yyssp));
+ __yy_memcpy ((char *)yyss, (char *)yyss1, size * sizeof (*yyssp));
+ yyvs = (YYSTYPE *) alloca (yystacksize * sizeof (*yyvsp));
+ __yy_memcpy ((char *)yyvs, (char *)yyvs1, size * sizeof (*yyvsp));
#ifdef YYLSP_NEEDED
- yyls = (YYLTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yylsp));
- __yy_memcpy ((char *)yyls, (char *)yyls1,
- size * (unsigned int) sizeof (*yylsp));
+ yyls = (YYLTYPE *) alloca (yystacksize * sizeof (*yylsp));
+ __yy_memcpy ((char *)yyls, (char *)yyls1, size * sizeof (*yylsp));
#endif
#endif /* no yyoverflow */
@@ -1598,38 +1558,59 @@ case 43:
case 44:
#line 387 "./awk.y"
{
- yyval.nodeval = node(yyvsp[0].nodeval, Node_K_arrayfor,
- make_for_loop(variable(yyvsp[-5].sval, CAN_FREE, Node_var),
- (NODE *) NULL, variable(yyvsp[-3].sval, CAN_FREE, Node_var_array)));
+ /*
+ * Efficiency hack. Recognize the special case of
+ *
+ * for (iggy in foo)
+ * delete foo[iggy]
+ *
+ * and treat it as if it were
+ *
+ * delete foo
+ *
+ * Check that the body is a `delete a[i]' statement,
+ * and that both the loop var and array names match.
+ */
+ if (yyvsp[0].nodeval->type == Node_K_delete
+ && yyvsp[0].nodeval->rnode != NULL
+ && strcmp(yyvsp[-5].sval, yyvsp[0].nodeval->rnode->var_value->vname) == 0
+ && strcmp(yyvsp[-3].sval, yyvsp[0].nodeval->lnode->vname) == 0) {
+ yyvsp[0].nodeval->type = Node_K_delete_loop;
+ yyval.nodeval = yyvsp[0].nodeval;
+ } else {
+ yyval.nodeval = node(yyvsp[0].nodeval, Node_K_arrayfor,
+ make_for_loop(variable(yyvsp[-5].sval, CAN_FREE, Node_var),
+ (NODE *) NULL, variable(yyvsp[-3].sval, CAN_FREE, Node_var_array)));
+ }
;
break;}
case 45:
-#line 393 "./awk.y"
+#line 414 "./awk.y"
{
yyval.nodeval = node(yyvsp[0].nodeval, Node_K_for, (NODE *) make_for_loop(yyvsp[-7].nodeval, yyvsp[-5].nodeval, yyvsp[-3].nodeval));
;
break;}
case 46:
-#line 397 "./awk.y"
+#line 418 "./awk.y"
{
yyval.nodeval = node(yyvsp[0].nodeval, Node_K_for,
(NODE *) make_for_loop(yyvsp[-6].nodeval, (NODE *) NULL, yyvsp[-3].nodeval));
;
break;}
case 47:
-#line 403 "./awk.y"
+#line 424 "./awk.y"
{ yyval.nodeval = node((NODE *) NULL, Node_K_break, (NODE *) NULL); ;
break;}
case 48:
-#line 406 "./awk.y"
+#line 427 "./awk.y"
{ yyval.nodeval = node((NODE *) NULL, Node_K_continue, (NODE *) NULL); ;
break;}
case 49:
-#line 408 "./awk.y"
+#line 429 "./awk.y"
{ yyval.nodeval = node(yyvsp[-3].nodeval, yyvsp[-5].nodetypeval, yyvsp[-1].nodeval); ;
break;}
case 50:
-#line 410 "./awk.y"
+#line 431 "./awk.y"
{
if (yyvsp[-3].nodetypeval == Node_K_print && yyvsp[-2].nodeval == NULL) {
static int warned = FALSE;
@@ -1651,7 +1632,7 @@ case 50:
;
break;}
case 51:
-#line 430 "./awk.y"
+#line 451 "./awk.y"
{ NODETYPE type;
if (yyvsp[-1].nodeval) {
@@ -1692,7 +1673,7 @@ case 51:
;
break;}
case 52:
-#line 469 "./awk.y"
+#line 490 "./awk.y"
{
if (do_lint)
warning("`nextfile' is a gawk extension");
@@ -1713,26 +1694,26 @@ case 52:
;
break;}
case 53:
-#line 488 "./awk.y"
+#line 509 "./awk.y"
{ yyval.nodeval = node(yyvsp[-1].nodeval, Node_K_exit, (NODE *) NULL); ;
break;}
case 54:
-#line 490 "./awk.y"
+#line 511 "./awk.y"
{
if (! can_return)
yyerror("`return' used outside function context");
;
break;}
case 55:
-#line 495 "./awk.y"
+#line 516 "./awk.y"
{ yyval.nodeval = node(yyvsp[-1].nodeval, Node_K_return, (NODE *) NULL); ;
break;}
case 56:
-#line 497 "./awk.y"
+#line 518 "./awk.y"
{ yyval.nodeval = node(variable(yyvsp[-4].sval, CAN_FREE, Node_var_array), Node_K_delete, yyvsp[-2].nodeval); ;
break;}
case 57:
-#line 499 "./awk.y"
+#line 520 "./awk.y"
{
if (do_lint)
warning("`delete array' is a gawk extension");
@@ -1748,107 +1729,107 @@ case 57:
;
break;}
case 58:
-#line 513 "./awk.y"
+#line 534 "./awk.y"
{ yyval.nodeval = yyvsp[-1].nodeval; ;
break;}
case 59:
-#line 518 "./awk.y"
+#line 539 "./awk.y"
{ yyval.nodetypeval = yyvsp[0].nodetypeval; ;
break;}
case 60:
-#line 520 "./awk.y"
+#line 541 "./awk.y"
{ yyval.nodetypeval = yyvsp[0].nodetypeval; ;
break;}
case 61:
-#line 525 "./awk.y"
+#line 546 "./awk.y"
{
yyval.nodeval = node(yyvsp[-3].nodeval, Node_K_if,
node(yyvsp[0].nodeval, Node_if_branches, (NODE *) NULL));
;
break;}
case 62:
-#line 531 "./awk.y"
+#line 552 "./awk.y"
{ yyval.nodeval = node(yyvsp[-6].nodeval, Node_K_if,
node(yyvsp[-3].nodeval, Node_if_branches, yyvsp[0].nodeval)); ;
break;}
case 63:
-#line 537 "./awk.y"
+#line 558 "./awk.y"
{ want_assign = FALSE; ;
break;}
case 67:
-#line 548 "./awk.y"
+#line 569 "./awk.y"
{ yyval.nodeval = NULL; ;
break;}
case 68:
-#line 550 "./awk.y"
+#line 571 "./awk.y"
{ yyval.nodeval = node(yyvsp[0].nodeval, Node_redirect_input, (NODE *) NULL); ;
break;}
case 69:
-#line 555 "./awk.y"
+#line 576 "./awk.y"
{ yyval.nodeval = NULL; ;
break;}
case 70:
-#line 557 "./awk.y"
+#line 578 "./awk.y"
{ yyval.nodeval = node(yyvsp[0].nodeval, Node_redirect_output, (NODE *) NULL); ;
break;}
case 71:
-#line 559 "./awk.y"
+#line 580 "./awk.y"
{ yyval.nodeval = node(yyvsp[0].nodeval, Node_redirect_append, (NODE *) NULL); ;
break;}
case 72:
-#line 561 "./awk.y"
+#line 582 "./awk.y"
{ yyval.nodeval = node(yyvsp[0].nodeval, Node_redirect_pipe, (NODE *) NULL); ;
break;}
case 73:
-#line 566 "./awk.y"
+#line 587 "./awk.y"
{ yyval.nodeval = NULL; ;
break;}
case 74:
-#line 568 "./awk.y"
+#line 589 "./awk.y"
{ yyval.nodeval = yyvsp[0].nodeval; ;
break;}
case 75:
-#line 573 "./awk.y"
+#line 594 "./awk.y"
{ yyval.nodeval = make_param(yyvsp[0].sval); ;
break;}
case 76:
-#line 575 "./awk.y"
+#line 596 "./awk.y"
{ yyval.nodeval = append_right(yyvsp[-2].nodeval, make_param(yyvsp[0].sval)); yyerrok; ;
break;}
case 77:
-#line 577 "./awk.y"
+#line 598 "./awk.y"
{ yyval.nodeval = NULL; ;
break;}
case 78:
-#line 579 "./awk.y"
+#line 600 "./awk.y"
{ yyval.nodeval = NULL; ;
break;}
case 79:
-#line 581 "./awk.y"
+#line 602 "./awk.y"
{ yyval.nodeval = NULL; ;
break;}
case 80:
-#line 587 "./awk.y"
+#line 608 "./awk.y"
{ yyval.nodeval = NULL; ;
break;}
case 81:
-#line 589 "./awk.y"
+#line 610 "./awk.y"
{ yyval.nodeval = yyvsp[0].nodeval; ;
break;}
case 82:
-#line 594 "./awk.y"
+#line 615 "./awk.y"
{ yyval.nodeval = NULL; ;
break;}
case 83:
-#line 596 "./awk.y"
+#line 617 "./awk.y"
{ yyval.nodeval = yyvsp[0].nodeval; ;
break;}
case 84:
-#line 601 "./awk.y"
+#line 622 "./awk.y"
{ yyval.nodeval = node(yyvsp[0].nodeval, Node_expression_list, (NODE *) NULL); ;
break;}
case 85:
-#line 603 "./awk.y"
+#line 624 "./awk.y"
{
yyval.nodeval = append_right(yyvsp[-2].nodeval,
node(yyvsp[0].nodeval, Node_expression_list, (NODE *) NULL));
@@ -1856,35 +1837,35 @@ case 85:
;
break;}
case 86:
-#line 609 "./awk.y"
+#line 630 "./awk.y"
{ yyval.nodeval = NULL; ;
break;}
case 87:
-#line 611 "./awk.y"
+#line 632 "./awk.y"
{ yyval.nodeval = NULL; ;
break;}
case 88:
-#line 613 "./awk.y"
+#line 634 "./awk.y"
{ yyval.nodeval = NULL; ;
break;}
case 89:
-#line 615 "./awk.y"
+#line 636 "./awk.y"
{ yyval.nodeval = NULL; ;
break;}
case 90:
-#line 620 "./awk.y"
+#line 641 "./awk.y"
{ yyval.nodeval = NULL; ;
break;}
case 91:
-#line 622 "./awk.y"
+#line 643 "./awk.y"
{ yyval.nodeval = yyvsp[0].nodeval; ;
break;}
case 92:
-#line 627 "./awk.y"
+#line 648 "./awk.y"
{ yyval.nodeval = node(yyvsp[0].nodeval, Node_expression_list, (NODE *) NULL); ;
break;}
case 93:
-#line 629 "./awk.y"
+#line 650 "./awk.y"
{
yyval.nodeval = append_right(yyvsp[-2].nodeval,
node(yyvsp[0].nodeval, Node_expression_list, (NODE *) NULL));
@@ -1892,27 +1873,27 @@ case 93:
;
break;}
case 94:
-#line 635 "./awk.y"
+#line 656 "./awk.y"
{ yyval.nodeval = NULL; ;
break;}
case 95:
-#line 637 "./awk.y"
+#line 658 "./awk.y"
{ yyval.nodeval = NULL; ;
break;}
case 96:
-#line 639 "./awk.y"
+#line 660 "./awk.y"
{ yyval.nodeval = NULL; ;
break;}
case 97:
-#line 641 "./awk.y"
+#line 662 "./awk.y"
{ yyval.nodeval = NULL; ;
break;}
case 98:
-#line 646 "./awk.y"
+#line 667 "./awk.y"
{ want_assign = FALSE; ;
break;}
case 99:
-#line 648 "./awk.y"
+#line 669 "./awk.y"
{
if (do_lint && yyvsp[0].nodeval->type == Node_regex)
warning("Regular expression on left of assignment.");
@@ -1920,18 +1901,18 @@ case 99:
;
break;}
case 100:
-#line 654 "./awk.y"
+#line 675 "./awk.y"
{ yyval.nodeval = node(variable(yyvsp[0].sval, CAN_FREE, Node_var_array), Node_in_array, yyvsp[-3].nodeval); ;
break;}
case 101:
-#line 656 "./awk.y"
+#line 677 "./awk.y"
{
yyval.nodeval = node(yyvsp[0].nodeval, Node_K_getline,
node(yyvsp[-3].nodeval, Node_redirect_pipein, (NODE *) NULL));
;
break;}
case 102:
-#line 661 "./awk.y"
+#line 682 "./awk.y"
{
if (do_lint && ! io_allowed && yyvsp[0].nodeval == NULL)
warning("non-redirected getline undefined inside BEGIN or END action");
@@ -1939,15 +1920,15 @@ case 102:
;
break;}
case 103:
-#line 667 "./awk.y"
+#line 688 "./awk.y"
{ yyval.nodeval = node(yyvsp[-2].nodeval, Node_and, yyvsp[0].nodeval); ;
break;}
case 104:
-#line 669 "./awk.y"
+#line 690 "./awk.y"
{ yyval.nodeval = node(yyvsp[-2].nodeval, Node_or, yyvsp[0].nodeval); ;
break;}
case 105:
-#line 671 "./awk.y"
+#line 692 "./awk.y"
{
if (yyvsp[-2].nodeval->type == Node_regex)
warning("Regular expression on left of MATCH operator.");
@@ -1955,7 +1936,7 @@ case 105:
;
break;}
case 106:
-#line 677 "./awk.y"
+#line 698 "./awk.y"
{
yyval.nodeval = yyvsp[0].nodeval;
if (do_lint && tokstart[0] == '*') {
@@ -1967,7 +1948,7 @@ case 106:
;
break;}
case 107:
-#line 687 "./awk.y"
+#line 708 "./awk.y"
{
yyval.nodeval = node(node(make_number(0.0),
Node_field_spec,
@@ -1977,11 +1958,11 @@ case 107:
;
break;}
case 108:
-#line 695 "./awk.y"
+#line 716 "./awk.y"
{ yyval.nodeval = node(variable(yyvsp[0].sval, CAN_FREE, Node_var_array), Node_in_array, yyvsp[-2].nodeval); ;
break;}
case 109:
-#line 697 "./awk.y"
+#line 718 "./awk.y"
{
if (do_lint && yyvsp[0].nodeval->type == Node_regex)
warning("Regular expression on left of comparison.");
@@ -1989,43 +1970,43 @@ case 109:
;
break;}
case 110:
-#line 703 "./awk.y"
+#line 724 "./awk.y"
{ yyval.nodeval = node(yyvsp[-2].nodeval, Node_less, yyvsp[0].nodeval); ;
break;}
case 111:
-#line 705 "./awk.y"
+#line 726 "./awk.y"
{ yyval.nodeval = node(yyvsp[-2].nodeval, Node_greater, yyvsp[0].nodeval); ;
break;}
case 112:
-#line 707 "./awk.y"
+#line 728 "./awk.y"
{ yyval.nodeval = node(yyvsp[-4].nodeval, Node_cond_exp, node(yyvsp[-2].nodeval, Node_if_branches, yyvsp[0].nodeval));;
break;}
case 113:
-#line 709 "./awk.y"
+#line 730 "./awk.y"
{ yyval.nodeval = yyvsp[0].nodeval; ;
break;}
case 114:
-#line 711 "./awk.y"
+#line 732 "./awk.y"
{ yyval.nodeval = node(yyvsp[-1].nodeval, Node_concat, yyvsp[0].nodeval); ;
break;}
case 115:
-#line 716 "./awk.y"
+#line 737 "./awk.y"
{ want_assign = FALSE; ;
break;}
case 116:
-#line 718 "./awk.y"
+#line 739 "./awk.y"
{ yyval.nodeval = node(yyvsp[-3].nodeval, yyvsp[-2].nodetypeval, yyvsp[0].nodeval); ;
break;}
case 117:
-#line 720 "./awk.y"
+#line 741 "./awk.y"
{ yyval.nodeval = node(yyvsp[-2].nodeval, Node_and, yyvsp[0].nodeval); ;
break;}
case 118:
-#line 722 "./awk.y"
+#line 743 "./awk.y"
{ yyval.nodeval = node(yyvsp[-2].nodeval, Node_or, yyvsp[0].nodeval); ;
break;}
case 119:
-#line 724 "./awk.y"
+#line 745 "./awk.y"
{
if (do_lint && ! io_allowed && yyvsp[0].nodeval == NULL)
warning("non-redirected getline undefined inside BEGIN or END action");
@@ -2033,87 +2014,87 @@ case 119:
;
break;}
case 120:
-#line 730 "./awk.y"
+#line 751 "./awk.y"
{ yyval.nodeval = yyvsp[0].nodeval; ;
break;}
case 121:
-#line 732 "./awk.y"
+#line 753 "./awk.y"
{ yyval.nodeval = node((NODE *) NULL, Node_nomatch, yyvsp[0].nodeval); ;
break;}
case 122:
-#line 734 "./awk.y"
+#line 755 "./awk.y"
{ yyval.nodeval = node(yyvsp[-2].nodeval, yyvsp[-1].nodetypeval, mk_rexp(yyvsp[0].nodeval)); ;
break;}
case 123:
-#line 736 "./awk.y"
+#line 757 "./awk.y"
{ yyval.nodeval = node(variable(yyvsp[0].sval, CAN_FREE, Node_var_array), Node_in_array, yyvsp[-2].nodeval); ;
break;}
case 124:
-#line 738 "./awk.y"
+#line 759 "./awk.y"
{ yyval.nodeval = node(yyvsp[-2].nodeval, yyvsp[-1].nodetypeval, yyvsp[0].nodeval); ;
break;}
case 125:
-#line 740 "./awk.y"
+#line 761 "./awk.y"
{ yyval.nodeval = node(yyvsp[-4].nodeval, Node_cond_exp, node(yyvsp[-2].nodeval, Node_if_branches, yyvsp[0].nodeval));;
break;}
case 126:
-#line 742 "./awk.y"
+#line 763 "./awk.y"
{ yyval.nodeval = yyvsp[0].nodeval; ;
break;}
case 127:
-#line 744 "./awk.y"
+#line 765 "./awk.y"
{ yyval.nodeval = node(yyvsp[-1].nodeval, Node_concat, yyvsp[0].nodeval); ;
break;}
case 129:
-#line 751 "./awk.y"
+#line 772 "./awk.y"
{ yyval.nodeval = node(yyvsp[-2].nodeval, Node_exp, yyvsp[0].nodeval); ;
break;}
case 130:
-#line 753 "./awk.y"
+#line 774 "./awk.y"
{ yyval.nodeval = node(yyvsp[-2].nodeval, Node_times, yyvsp[0].nodeval); ;
break;}
case 131:
-#line 755 "./awk.y"
+#line 776 "./awk.y"
{ yyval.nodeval = node(yyvsp[-2].nodeval, Node_quotient, yyvsp[0].nodeval); ;
break;}
case 132:
-#line 757 "./awk.y"
+#line 778 "./awk.y"
{ yyval.nodeval = node(yyvsp[-2].nodeval, Node_mod, yyvsp[0].nodeval); ;
break;}
case 133:
-#line 759 "./awk.y"
+#line 780 "./awk.y"
{ yyval.nodeval = node(yyvsp[-2].nodeval, Node_plus, yyvsp[0].nodeval); ;
break;}
case 134:
-#line 761 "./awk.y"
+#line 782 "./awk.y"
{ yyval.nodeval = node(yyvsp[-2].nodeval, Node_minus, yyvsp[0].nodeval); ;
break;}
case 135:
-#line 763 "./awk.y"
+#line 784 "./awk.y"
{ yyval.nodeval = node(yyvsp[-1].nodeval, Node_postincrement, (NODE *) NULL); ;
break;}
case 136:
-#line 765 "./awk.y"
+#line 786 "./awk.y"
{ yyval.nodeval = node(yyvsp[-1].nodeval, Node_postdecrement, (NODE *) NULL); ;
break;}
case 137:
-#line 770 "./awk.y"
+#line 791 "./awk.y"
{ yyval.nodeval = node(yyvsp[0].nodeval, Node_not, (NODE *) NULL); ;
break;}
case 138:
-#line 772 "./awk.y"
+#line 793 "./awk.y"
{ yyval.nodeval = yyvsp[-1].nodeval; ;
break;}
case 139:
-#line 775 "./awk.y"
+#line 796 "./awk.y"
{ yyval.nodeval = snode(yyvsp[-1].nodeval, Node_builtin, (int) yyvsp[-3].lval); ;
break;}
case 140:
-#line 777 "./awk.y"
+#line 798 "./awk.y"
{ yyval.nodeval = snode(yyvsp[-1].nodeval, Node_builtin, (int) yyvsp[-3].lval); ;
break;}
case 141:
-#line 779 "./awk.y"
+#line 800 "./awk.y"
{
if (do_lint)
warning("call of `length' without parentheses is not portable");
@@ -2123,7 +2104,7 @@ case 141:
;
break;}
case 142:
-#line 787 "./awk.y"
+#line 808 "./awk.y"
{
yyval.nodeval = node(yyvsp[-1].nodeval, Node_func_call, make_string(yyvsp[-3].sval, strlen(yyvsp[-3].sval)));
func_use(yyvsp[-3].sval, FUNC_USE);
@@ -2132,23 +2113,23 @@ case 142:
;
break;}
case 144:
-#line 795 "./awk.y"
+#line 816 "./awk.y"
{ yyval.nodeval = node(yyvsp[0].nodeval, Node_preincrement, (NODE *) NULL); ;
break;}
case 145:
-#line 797 "./awk.y"
+#line 818 "./awk.y"
{ yyval.nodeval = node(yyvsp[0].nodeval, Node_predecrement, (NODE *) NULL); ;
break;}
case 146:
-#line 799 "./awk.y"
+#line 820 "./awk.y"
{ yyval.nodeval = yyvsp[0].nodeval; ;
break;}
case 147:
-#line 801 "./awk.y"
+#line 822 "./awk.y"
{ yyval.nodeval = yyvsp[0].nodeval; ;
break;}
case 148:
-#line 804 "./awk.y"
+#line 825 "./awk.y"
{
if (yyvsp[0].nodeval->type == Node_val) {
yyvsp[0].nodeval->numbr = -(force_number(yyvsp[0].nodeval));
@@ -2158,7 +2139,7 @@ case 148:
;
break;}
case 149:
-#line 812 "./awk.y"
+#line 833 "./awk.y"
{
/*
* was: $$ = $2
@@ -2168,19 +2149,19 @@ case 149:
;
break;}
case 150:
-#line 823 "./awk.y"
+#line 844 "./awk.y"
{ yyval.nodeval = NULL; ;
break;}
case 151:
-#line 825 "./awk.y"
+#line 846 "./awk.y"
{ yyval.nodeval = yyvsp[0].nodeval; ;
break;}
case 152:
-#line 830 "./awk.y"
+#line 851 "./awk.y"
{ yyval.nodeval = variable(yyvsp[0].sval, CAN_FREE, Node_var); ;
break;}
case 153:
-#line 832 "./awk.y"
+#line 853 "./awk.y"
{
if (yyvsp[-1].nodeval == NULL) {
fatal("invalid subscript expression");
@@ -2192,28 +2173,28 @@ case 153:
;
break;}
case 154:
-#line 842 "./awk.y"
+#line 863 "./awk.y"
{ yyval.nodeval = node(yyvsp[0].nodeval, Node_field_spec, (NODE *) NULL); ;
break;}
case 156:
-#line 850 "./awk.y"
+#line 871 "./awk.y"
{ yyerrok; ;
break;}
case 157:
-#line 854 "./awk.y"
+#line 875 "./awk.y"
{ yyerrok; ;
break;}
case 160:
-#line 863 "./awk.y"
+#line 884 "./awk.y"
{ yyerrok; want_assign = FALSE; ;
break;}
case 161:
-#line 866 "./awk.y"
+#line 887 "./awk.y"
{ yyerrok; ;
break;}
}
/* the action file gets copied in in place of this dollarsign */
-#line 543 "/usr/lib/bison.simple"
+#line 498 "/usr/share/bison.simple"
yyvsp -= yylen;
yyssp -= yylen;
@@ -2408,32 +2389,8 @@ yyerrhandle:
yystate = yyn;
goto yynewstate;
-
- yyacceptlab:
- /* YYACCEPT comes here. */
- if (yyfree_stacks)
- {
- free (yyss);
- free (yyvs);
-#ifdef YYLSP_NEEDED
- free (yyls);
-#endif
- }
- return 0;
-
- yyabortlab:
- /* YYABORT comes here. */
- if (yyfree_stacks)
- {
- free (yyss);
- free (yyvs);
-#ifdef YYLSP_NEEDED
- free (yyls);
-#endif
- }
- return 1;
}
-#line 869 "./awk.y"
+#line 890 "./awk.y"
struct token {
@@ -2784,9 +2741,9 @@ nextc()
int c;
if (lexptr && lexptr < lexend)
- c = (unsigned char) *lexptr++;
+ c = (int) (unsigned char) *lexptr++;
else if (get_src_buf())
- c = (unsigned char) *lexptr++;
+ c = (int) (unsigned char) *lexptr++;
else
c = EOF;
@@ -2794,8 +2751,8 @@ nextc()
}
#else
#define nextc() ((lexptr && lexptr < lexend) ? \
- ((unsigned char) *lexptr++) : \
- (get_src_buf() ? ((unsigned char) *lexptr++) : EOF) \
+ ((int) (unsigned char) *lexptr++) : \
+ (get_src_buf() ? ((int) (unsigned char) *lexptr++) : EOF) \
)
#endif
diff --git a/builtin.c b/builtin.c
index 3e114a64..499e0550 100644
--- a/builtin.c
+++ b/builtin.c
@@ -811,7 +811,8 @@ check_pos:
*cp++ = '#';
if (zero_flag)
*cp++ = '0';
- cp = strcpy(cp, "*.*") + 3;
+ strcpy(cp, "*.*");
+ cp += 3;
*cp++ = cs1;
*cp = '\0';
#ifndef GFMT_WORKAROUND
diff --git a/doc/ChangeLog b/doc/ChangeLog
index dc8aff84..2d8e5208 100644
--- a/doc/ChangeLog
+++ b/doc/ChangeLog
@@ -1,3 +1,7 @@
+Mon Aug 7 15:23:00 2000 Arnold D. Robbins <arnold@skeeve.com>
+
+ * Release 3.0.6: Release tar file made.
+
Sun Jun 25 15:08:19 2000 Arnold D. Robbins <arnold@skeeve.com>
* Release 3.0.5: Release tar file made.
diff --git a/doc/awkcard.in b/doc/awkcard.in
index d1ceb0d3..ac1e8e56 100644
--- a/doc/awkcard.in
+++ b/doc/awkcard.in
@@ -1504,7 +1504,7 @@ has been specified.\*(CB
.ES
.nf
\*(CDHost: \*(FCgnudist.gnu.org\*(FR
-File: \*(FC/gnu/gawk/gawk-3.0.5.tar.gz\fP
+File: \*(FC/gnu/gawk/gawk-3.0.6.tar.gz\fP
.in +.2i
.fi
GNU \*(AK (\*(GK). There may be a later version.
diff --git a/doc/gawk.1 b/doc/gawk.1
index 0b32ef78..6f07cfab 100644
--- a/doc/gawk.1
+++ b/doc/gawk.1
@@ -2574,7 +2574,7 @@ and the effort to do so really is not worth it.
.SH VERSION INFORMATION
This man page documents
.IR gawk ,
-version 3.0.5.
+version 3.0.6.
.SH AUTHORS
The original version of \*(UX
.I awk
@@ -2605,10 +2605,7 @@ help from Darrel Hankerson. Fred Fish supplied support for the Amiga.
If you find a bug in
.IR gawk ,
please send electronic mail to
-.BR bug-gnu-utils@gnu.org ,
-.I with
-a carbon copy to
-.BR arnold@gnu.org .
+.BR bug-gawk@gnu.org .
Please include your operating system and its revision, the version of
.IR gawk ,
what C compiler you used to compile it, and a test program
diff --git a/doc/gawk.info b/doc/gawk.info
index 0ac376a0..037522e9 100644
--- a/doc/gawk.info
+++ b/doc/gawk.info
@@ -8,8 +8,8 @@ END-INFO-DIR-ENTRY
This file documents `awk', a program that you can use to select
particular records in a file and perform operations upon them.
- This is Edition 1.0.5 of `Effective AWK Programming', for the
-3.0.5 version of the GNU implementation of AWK.
+ This is Edition 1.0.6 of `Effective AWK Programming', for the
+3.0.6 version of the GNU implementation of AWK.
Copyright (C) 1989, 1991, 1992, 1993, 1996-2000 Free Software
Foundation, Inc.
@@ -37,8 +37,8 @@ General Introduction
This file documents `awk', a program that you can use to select
particular records in a file and perform operations upon them.
- This is Edition 1.0.5 of `Effective AWK Programming',
-for the 3.0.5 version of the GNU implementation
+ This is Edition 1.0.6 of `Effective AWK Programming',
+for the 3.0.6 version of the GNU implementation
of AWK.
* Menu:
@@ -8290,7 +8290,7 @@ the use of `gawk' and `gensub' for when you have to do substitutions.
(1) This consequence was certainly unintended.
- (2) As of June, 2000, with final approval and publication as part of
+ (2) As of July, 2000, with final approval and publication as part of
the Austin Group Standards hopefully sometime in 2001.

@@ -9470,7 +9470,7 @@ previous releases of `gawk' that are either not available in the
current version, or that are still supported but deprecated (meaning
that they will _not_ be in the next release).
- For version 3.0.5 of `gawk', there are no command line options or
+ For version 3.0.6 of `gawk', there are no command line options or
other deprecated features from the previous version of `gawk'. This
node is thus essentially a place holder, in case some option becomes
obsolete in a future version of `gawk'.
@@ -10262,7 +10262,7 @@ months, and AM/PM times into 24-hour clocks, to generate the
---------- Footnotes ----------
- (1) June, 2000: Actually, I was mistaken when I wrote this. The
+ (1) July, 2000: Actually, I was mistaken when I wrote this. The
version presented here doesn't always work correctly, and the next
major version of `gawk' will provide `mktime' as a built-in function.
@@ -15452,21 +15452,21 @@ Extracting the Distribution
`gawk' is distributed as a `tar' file compressed with the GNU Zip
program, `gzip'.
- Once you have the distribution (for example, `gawk-3.0.5.tar.gz'),
+ Once you have the distribution (for example, `gawk-3.0.6.tar.gz'),
first use `gzip' to expand the file, and then use `tar' to extract it.
You can use the following pipeline to produce the `gawk' distribution:
# Under System V, add 'o' to the tar flags
- gzip -d -c gawk-3.0.5.tar.gz | tar -xvpf -
+ gzip -d -c gawk-3.0.6.tar.gz | tar -xvpf -
-This will create a directory named `gawk-3.0.5' in the current
+This will create a directory named `gawk-3.0.6' in the current
directory.
The distribution file name is of the form `gawk-V.R.N.tar.gz'. The
V represents the major version of `gawk', the R represents the current
release of version V, and the N represents a "patch level", meaning
that minor bugs have been fixed in the release. The current patch
-level is 5, but when retrieving distributions, you should get the
+level is 6, but when retrieving distributions, you should get the
version with the highest version, release, and patch level. (Note that
release levels greater than or equal to 90 denote "beta," or
non-production software; you may not wish to retrieve such a version
@@ -15639,7 +15639,7 @@ Compiling `gawk' for Unix
-------------------------
After you have extracted the `gawk' distribution, `cd' to
-`gawk-3.0.5'. Like most GNU software, `gawk' is configured
+`gawk-3.0.6'. Like most GNU software, `gawk' is configured
automatically for your Unix system by running the `configure' program.
This program is a Bourne shell script that was generated automatically
using GNU `autoconf'. (The `autoconf' software is described fully
@@ -16125,19 +16125,12 @@ idea of what kind of Unix system you're using, and the exact results
`gawk' gave you. Also say what you expected to occur; this will help
us decide whether the problem was really in the documentation.
- Once you have a precise problem, there are two email addresses you
-can send mail to.
-
-Internet:
- `bug-gnu-utils@gnu.org'
-
-UUCP:
- `uunet!gnu.org!bug-gnu-utils'
+ Once you have a precise problem, send email to <bug-gawk@gnu.org>.
Please include the version number of `gawk' you are using. You can
-get this information with the command `gawk --version'. You should
-send a carbon copy of your mail to Arnold Robbins, who can be reached
-at `arnold@gnu.org'.
+get this information with the command `gawk --version'. Using this
+address will automatically send a carbon copy of your mail to Arnold
+Robbins. If necessary, he can be reached directly at <arnold@gnu.org>.
*Important!* Do _not_ try to report bugs in `gawk' by posting to the
Usenet/Internet newsgroup `comp.lang.awk'. While the `gawk' developers
@@ -18417,16 +18410,16 @@ Node: Atari Compiling624634
Node: Atari Using626543
Node: Amiga Installation629389
Node: Bugs630500
-Node: Other Versions633554
-Node: Notes635228
-Node: Compatibility Mode635835
-Node: Additions636678
-Node: Adding Code637376
-Node: New Ports642890
-Node: Future Extensions647050
-Node: Improvements648996
-Node: Glossary650864
-Node: Copying667935
-Node: Index687127
+Node: Other Versions633504
+Node: Notes635178
+Node: Compatibility Mode635785
+Node: Additions636628
+Node: Adding Code637326
+Node: New Ports642840
+Node: Future Extensions647000
+Node: Improvements648946
+Node: Glossary650814
+Node: Copying667885
+Node: Index687077

End Tag Table
diff --git a/doc/gawk.texi b/doc/gawk.texi
index 6cc1a87a..2657b146 100644
--- a/doc/gawk.texi
+++ b/doc/gawk.texi
@@ -21,10 +21,10 @@
@c applies to, and when the document was updated.
@set TITLE Effective AWK Programming
@set SUBTITLE A User's Guide for GNU Awk
-@set PATCHLEVEL 5
+@set PATCHLEVEL 6
@set EDITION 1.0.@value{PATCHLEVEL}
@set VERSION 3.0
-@set UPDATE-MONTH June, 2000
+@set UPDATE-MONTH July, 2000
@iftex
@set DOCUMENT book
@end iftex
@@ -19493,22 +19493,13 @@ some idea of what kind of Unix system you're using, and the exact results
@code{gawk} gave you. Also say what you expected to occur; this will help
us decide whether the problem was really in the documentation.
-Once you have a precise problem, there are two email addresses you
-can send mail to.
+Once you have a precise problem, send email to @email{bug-gawk@@gnu.org}.
-@table @asis
-@item Internet:
-@samp{bug-gnu-utils@@gnu.org}
-
-@item UUCP:
-@samp{uunet!gnu.org!bug-gnu-utils}
-@end table
-
-Please include the
-version number of @code{gawk} you are using. You can get this information
-with the command @samp{gawk --version}.
-You should send a carbon copy of your mail to Arnold Robbins, who can
-be reached at @samp{arnold@@gnu.org}.
+Please include the version number of @code{gawk} you are using.
+You can get this information with the command @samp{gawk --version}.
+Using this address will automatically send a carbon copy of your
+mail to Arnold Robbins. If necessary, he can be reached directly at
+@email{arnold@@gnu.org}.
@cindex @code{comp.lang.awk}
@strong{Important!} Do @emph{not} try to report bugs in @code{gawk} by
diff --git a/eval.c b/eval.c
index f871af37..62a7f453 100644
--- a/eval.c
+++ b/eval.c
@@ -66,6 +66,11 @@ static int func_tag_valid = FALSE;
static jmp_buf func_tag;
extern int exiting, exit_val;
+/* This rather ugly macro is for VMS C */
+#ifdef C
+#undef C
+#endif
+#define C(c) ((char)c)
/*
* This table is used by the regexp routines to do case independant
* matching. Basically, every ascii character maps to itself, except
@@ -108,45 +113,47 @@ char casetable[] = {
/* 'x' 'y' 'z' '{' '|' '}' '~' */
'\170', '\171', '\172', '\173', '\174', '\175', '\176', '\177',
#ifndef USE_PURE_ASCII
- '\200', '\201', '\202', '\203', '\204', '\205', '\206', '\207',
- '\210', '\211', '\212', '\213', '\214', '\215', '\216', '\217',
- '\220', '\221', '\222', '\223', '\224', '\225', '\226', '\227',
- '\230', '\231', '\232', '\233', '\234', '\235', '\236', '\237',
- '\240', '\241', '\242', '\243', '\244', '\245', '\246', '\247',
- '\250', '\251', '\252', '\253', '\254', '\255', '\256', '\257',
- '\260', '\261', '\262', '\263', '\264', '\265', '\266', '\267',
- '\270', '\271', '\272', '\273', '\274', '\275', '\276', '\277',
- '\340', '\341', '\342', '\343', '\344', '\345', '\346', '\347',
- '\350', '\351', '\352', '\353', '\354', '\355', '\356', '\357',
- '\360', '\361', '\362', '\363', '\364', '\365', '\366', '\327',
- '\370', '\371', '\372', '\373', '\374', '\375', '\376', '\337',
- '\340', '\341', '\342', '\343', '\344', '\345', '\346', '\347',
- '\350', '\351', '\352', '\353', '\354', '\355', '\356', '\357',
- '\360', '\361', '\362', '\363', '\364', '\365', '\366', '\367',
- '\370', '\371', '\372', '\373', '\374', '\375', '\376', '\377',
+ C('\200'), C('\201'), C('\202'), C('\203'), C('\204'), C('\205'), C('\206'), C('\207'),
+ C('\210'), C('\211'), C('\212'), C('\213'), C('\214'), C('\215'), C('\216'), C('\217'),
+ C('\220'), C('\221'), C('\222'), C('\223'), C('\224'), C('\225'), C('\226'), C('\227'),
+ C('\230'), C('\231'), C('\232'), C('\233'), C('\234'), C('\235'), C('\236'), C('\237'),
+ C('\240'), C('\241'), C('\242'), C('\243'), C('\244'), C('\245'), C('\246'), C('\247'),
+ C('\250'), C('\251'), C('\252'), C('\253'), C('\254'), C('\255'), C('\256'), C('\257'),
+ C('\260'), C('\261'), C('\262'), C('\263'), C('\264'), C('\265'), C('\266'), C('\267'),
+ C('\270'), C('\271'), C('\272'), C('\273'), C('\274'), C('\275'), C('\276'), C('\277'),
+ C('\340'), C('\341'), C('\342'), C('\343'), C('\344'), C('\345'), C('\346'), C('\347'),
+ C('\350'), C('\351'), C('\352'), C('\353'), C('\354'), C('\355'), C('\356'), C('\357'),
+ C('\360'), C('\361'), C('\362'), C('\363'), C('\364'), C('\365'), C('\366'), C('\327'),
+ C('\370'), C('\371'), C('\372'), C('\373'), C('\374'), C('\375'), C('\376'), C('\337'),
+ C('\340'), C('\341'), C('\342'), C('\343'), C('\344'), C('\345'), C('\346'), C('\347'),
+ C('\350'), C('\351'), C('\352'), C('\353'), C('\354'), C('\355'), C('\356'), C('\357'),
+ C('\360'), C('\361'), C('\362'), C('\363'), C('\364'), C('\365'), C('\366'), C('\367'),
+ C('\370'), C('\371'), C('\372'), C('\373'), C('\374'), C('\375'), C('\376'), C('\377'),
#else
- '\200', '\201', '\202', '\203', '\204', '\205', '\206', '\207',
- '\210', '\211', '\212', '\213', '\214', '\215', '\216', '\217',
- '\220', '\221', '\222', '\223', '\224', '\225', '\226', '\227',
- '\230', '\231', '\232', '\233', '\234', '\235', '\236', '\237',
- '\240', '\241', '\242', '\243', '\244', '\245', '\246', '\247',
- '\250', '\251', '\252', '\253', '\254', '\255', '\256', '\257',
- '\260', '\261', '\262', '\263', '\264', '\265', '\266', '\267',
- '\270', '\271', '\272', '\273', '\274', '\275', '\276', '\277',
- '\300', '\301', '\302', '\303', '\304', '\305', '\306', '\307',
- '\310', '\311', '\312', '\313', '\314', '\315', '\316', '\317',
- '\320', '\321', '\322', '\323', '\324', '\325', '\326', '\327',
- '\330', '\331', '\332', '\333', '\334', '\335', '\336', '\337',
- '\340', '\341', '\342', '\343', '\344', '\345', '\346', '\347',
- '\350', '\351', '\352', '\353', '\354', '\355', '\356', '\357',
- '\360', '\361', '\362', '\363', '\364', '\365', '\366', '\367',
- '\370', '\371', '\372', '\373', '\374', '\375', '\376', '\377',
+ C('\200'), C('\201'), C('\202'), C('\203'), C('\204'), C('\205'), C('\206'), C('\207'),
+ C('\210'), C('\211'), C('\212'), C('\213'), C('\214'), C('\215'), C('\216'), C('\217'),
+ C('\220'), C('\221'), C('\222'), C('\223'), C('\224'), C('\225'), C('\226'), C('\227'),
+ C('\230'), C('\231'), C('\232'), C('\233'), C('\234'), C('\235'), C('\236'), C('\237'),
+ C('\240'), C('\241'), C('\242'), C('\243'), C('\244'), C('\245'), C('\246'), C('\247'),
+ C('\250'), C('\251'), C('\252'), C('\253'), C('\254'), C('\255'), C('\256'), C('\257'),
+ C('\260'), C('\261'), C('\262'), C('\263'), C('\264'), C('\265'), C('\266'), C('\267'),
+ C('\270'), C('\271'), C('\272'), C('\273'), C('\274'), C('\275'), C('\276'), C('\277'),
+ C('\300'), C('\301'), C('\302'), C('\303'), C('\304'), C('\305'), C('\306'), C('\307'),
+ C('\310'), C('\311'), C('\312'), C('\313'), C('\314'), C('\315'), C('\316'), C('\317'),
+ C('\320'), C('\321'), C('\322'), C('\323'), C('\324'), C('\325'), C('\326'), C('\327'),
+ C('\330'), C('\331'), C('\332'), C('\333'), C('\334'), C('\335'), C('\336'), C('\337'),
+ C('\340'), C('\341'), C('\342'), C('\343'), C('\344'), C('\345'), C('\346'), C('\347'),
+ C('\350'), C('\351'), C('\352'), C('\353'), C('\354'), C('\355'), C('\356'), C('\357'),
+ C('\360'), C('\361'), C('\362'), C('\363'), C('\364'), C('\365'), C('\366'), C('\367'),
+ C('\370'), C('\371'), C('\372'), C('\373'), C('\374'), C('\375'), C('\376'), C('\377'),
#endif
};
#else
#include "You lose. You will need a translation table for your character set."
#endif
+#undef C
+
/*
* This table maps node types to strings for debugging.
* KEEP IN SYNC WITH awk.h!!!!
@@ -205,6 +212,7 @@ static char *nodetypes[] = {
"Node_K_do",
"Node_K_return",
"Node_K_delete",
+ "Node_K_delete_loop",
"Node_K_getline",
"Node_K_function",
"Node_K_nextfile",
@@ -481,6 +489,8 @@ register NODE *volatile tree;
t = tree->arrvar;
if (t->type == Node_param_list)
t = stack_ptr[t->param_cnt];
+ if (t->type == Node_array_ref)
+ t = t->orig_array;
stable_tree = tree;
if ((t->flags & SCALAR) != 0)
fatal("attempt to use scalar as array");
@@ -564,6 +574,10 @@ register NODE *volatile tree;
do_delete(tree->lnode, tree->rnode);
break;
+ case Node_K_delete_loop:
+ do_delete_loop(tree->lnode, tree->rnode);
+ break;
+
case Node_K_next:
if (in_begin_rule)
fatal("`next' cannot be called from a BEGIN rule");
@@ -1606,6 +1620,8 @@ Func_ptr *assign;
case Node_builtin:
fatal("assignment is not allowed to result of builtin function");
default:
+ fprintf(stderr, "type = %s\n", nodetype2str(ptr->type));
+ fflush(stderr);
cant_happen();
}
return aptr;
diff --git a/io.c b/io.c
index 69c87840..5023b977 100644
--- a/io.c
+++ b/io.c
@@ -498,6 +498,13 @@ int *errflg;
else if (errno == 0) /* HACK! */
close_one();
#endif
+#ifdef VMS
+ /* Alpha/VMS V7.1's C RTL is returning this instead
+ of EMFILE (haven't tried other post-V6.2 systems) */
+#define SS$_EXQUOTA 0x001C
+ else if (errno == EIO && vaxc$errno == SS$_EXQUOTA)
+ close_one();
+#endif
else {
/*
* Some other reason for failure.
diff --git a/missing/strncasecmp.c b/missing/strncasecmp.c
index 0f6026c8..9d17c648 100644
--- a/missing/strncasecmp.c
+++ b/missing/strncasecmp.c
@@ -25,6 +25,11 @@ static char sccsid[] = "@(#)strcasecmp.c 5.6 (Berkeley) 6/27/88";
#define u_char unsigned char
#endif
+/* This rather ugly macro is for VMS C */
+#ifdef C
+#undef C
+#endif
+#define C(c) ((u_char)c)
/*
* This array is designed for mapping upper and lower case letter
* together for a case independent comparison. The mappings are
@@ -47,24 +52,26 @@ static u_char charmap[] = {
'\150', '\151', '\152', '\153', '\154', '\155', '\156', '\157',
'\160', '\161', '\162', '\163', '\164', '\165', '\166', '\167',
'\170', '\171', '\172', '\173', '\174', '\175', '\176', '\177',
- '\200', '\201', '\202', '\203', '\204', '\205', '\206', '\207',
- '\210', '\211', '\212', '\213', '\214', '\215', '\216', '\217',
- '\220', '\221', '\222', '\223', '\224', '\225', '\226', '\227',
- '\230', '\231', '\232', '\233', '\234', '\235', '\236', '\237',
- '\240', '\241', '\242', '\243', '\244', '\245', '\246', '\247',
- '\250', '\251', '\252', '\253', '\254', '\255', '\256', '\257',
- '\260', '\261', '\262', '\263', '\264', '\265', '\266', '\267',
- '\270', '\271', '\272', '\273', '\274', '\275', '\276', '\277',
- '\340', '\341', '\342', '\343', '\344', '\345', '\346', '\347',
- '\350', '\351', '\352', '\353', '\354', '\355', '\356', '\357',
- '\360', '\361', '\362', '\363', '\364', '\365', '\366', '\327',
- '\370', '\371', '\372', '\373', '\374', '\375', '\376', '\337',
- '\340', '\341', '\342', '\343', '\344', '\345', '\346', '\347',
- '\350', '\351', '\352', '\353', '\354', '\355', '\356', '\357',
- '\360', '\361', '\362', '\363', '\364', '\365', '\366', '\367',
- '\370', '\371', '\372', '\373', '\374', '\375', '\376', '\377',
+ C('\200'), C('\201'), C('\202'), C('\203'), C('\204'), C('\205'), C('\206'), C('\207'),
+ C('\210'), C('\211'), C('\212'), C('\213'), C('\214'), C('\215'), C('\216'), C('\217'),
+ C('\220'), C('\221'), C('\222'), C('\223'), C('\224'), C('\225'), C('\226'), C('\227'),
+ C('\230'), C('\231'), C('\232'), C('\233'), C('\234'), C('\235'), C('\236'), C('\237'),
+ C('\240'), C('\241'), C('\242'), C('\243'), C('\244'), C('\245'), C('\246'), C('\247'),
+ C('\250'), C('\251'), C('\252'), C('\253'), C('\254'), C('\255'), C('\256'), C('\257'),
+ C('\260'), C('\261'), C('\262'), C('\263'), C('\264'), C('\265'), C('\266'), C('\267'),
+ C('\270'), C('\271'), C('\272'), C('\273'), C('\274'), C('\275'), C('\276'), C('\277'),
+ C('\340'), C('\341'), C('\342'), C('\343'), C('\344'), C('\345'), C('\346'), C('\347'),
+ C('\350'), C('\351'), C('\352'), C('\353'), C('\354'), C('\355'), C('\356'), C('\357'),
+ C('\360'), C('\361'), C('\362'), C('\363'), C('\364'), C('\365'), C('\366'), C('\327'),
+ C('\370'), C('\371'), C('\372'), C('\373'), C('\374'), C('\375'), C('\376'), C('\337'),
+ C('\340'), C('\341'), C('\342'), C('\343'), C('\344'), C('\345'), C('\346'), C('\347'),
+ C('\350'), C('\351'), C('\352'), C('\353'), C('\354'), C('\355'), C('\356'), C('\357'),
+ C('\360'), C('\361'), C('\362'), C('\363'), C('\364'), C('\365'), C('\366'), C('\367'),
+ C('\370'), C('\371'), C('\372'), C('\373'), C('\374'), C('\375'), C('\376'), C('\377'),
};
+#undef C
+
int
strcasecmp(s1, s2)
const char *s1, *s2;
diff --git a/patchlevel.h b/patchlevel.h
index c80ca154..e44bc091 100644
--- a/patchlevel.h
+++ b/patchlevel.h
@@ -1 +1 @@
-#define PATCHLEVEL 5
+#define PATCHLEVEL 6
diff --git a/pc/ChangeLog b/pc/ChangeLog
index 2268502d..84c48ecb 100644
--- a/pc/ChangeLog
+++ b/pc/ChangeLog
@@ -1,3 +1,7 @@
+Mon Aug 7 15:23:00 2000 Arnold D. Robbins <arnold@skeeve.com>
+
+ * Release 3.0.6: Release tar file made.
+
Sun Jun 25 15:08:19 2000 Arnold D. Robbins <arnold@skeeve.com>
* Release 3.0.5: Release tar file made.
diff --git a/pc/Makefile.tst b/pc/Makefile.tst
index ed80b9bb..4ad5d2ef 100755
--- a/pc/Makefile.tst
+++ b/pc/Makefile.tst
@@ -70,7 +70,7 @@
# Using EMXSHELL=/bin/sh with emx versions can exhaust lower mem.
# Lower mem can also be exhausted on some of the tests even with MSC gawk.
# The .SWAP setting forces (DOS-only) dmake to swap itself out.
-.SWAP: childin fflush getlnhd tweakfld pipeio1 pipeio2
+.SWAP: childin fflush getlnhd tweakfld pipeio1 pipeio2 getlnbuf
# This won't work unless you have "sh" and set SHELL equal to it (Make 3.74
# or later which comes with DJGPP will work with SHELL=/bin/sh if you have
@@ -134,7 +134,7 @@ basic: msg swaplns messages argarray longwrds \
back89 tradanch nlfldsep splitvar intest nfldstr nors fnarydel \
noparms funstack clobber delarprm prdupval nasty zeroflag \
getnr2tm getnr2tb printf1 funsmnam fnamedat numindex subslash \
- opasnslf opasnidx arynocls getlnbuf
+ opasnslf opasnidx arynocls getlnbuf arysubnm fnparydl
unix-tests: poundba fflush getlnhd pipeio1 pipeio2 strftlng pid
@@ -663,6 +663,14 @@ getlnbuf::
@-AWKPATH=$(srcdir) $(AWK) -f gtlnbufv.awk $(srcdir)/getlnbuf.in > _2$@
$(CMP) $(srcdir)/getlnbuf.ok _$@ && $(CMP) $(srcdir)/getlnbuf.ok _2$@ && rm -f _$@ _2$@
+arysubnm::
+ @-AWKPATH=$(srcdir) $(AWK) -f arysubnm.awk >_$@
+ $(CMP) $(srcdir)/arysubnm.ok _$@ && rm -f _$@
+
+fnparydl::
+ @-AWKPATH=$(srcdir) $(AWK) -f fnparydl.awk >_$@
+ $(CMP) $(srcdir)/fnparydl.ok _$@ && rm -f _$@
+
clean:
rm -fr _* core junk out1 out2 out3 strftime.ok test1 test2 seq *~
diff --git a/posix/ChangeLog b/posix/ChangeLog
index 66d6b084..f0d1419c 100644
--- a/posix/ChangeLog
+++ b/posix/ChangeLog
@@ -1,3 +1,7 @@
+Mon Aug 7 15:23:00 2000 Arnold D. Robbins <arnold@skeeve.com>
+
+ * Release 3.0.6: Release tar file made.
+
Sun Jun 25 15:08:19 2000 Arnold D. Robbins <arnold@skeeve.com>
* Release 3.0.5: Release tar file made.
diff --git a/regex.c b/regex.c
index 16783c9b..8c7f4fe2 100644
--- a/regex.c
+++ b/regex.c
@@ -1576,6 +1576,26 @@ static reg_errcode_t compile_range _RE_ARGS ((const char **p_ptr,
reset the pointers that pointed into the old block to point to the
correct places in the new one. If extending the buffer results in it
being larger than MAX_BUF_SIZE, then flag memory exhausted. */
+#if __BOUNDED_POINTERS__
+# define SET_HIGH_BOUND(P) (__ptrhigh (P) = __ptrlow (P) + bufp->allocated)
+# define MOVE_BUFFER_POINTER(P) \
+ (__ptrlow (P) += incr, SET_HIGH_BOUND (P), __ptrvalue (P) += incr)
+# define ELSE_EXTEND_BUFFER_HIGH_BOUND \
+ else \
+ { \
+ SET_HIGH_BOUND (b); \
+ SET_HIGH_BOUND (begalt); \
+ if (fixup_alt_jump) \
+ SET_HIGH_BOUND (fixup_alt_jump); \
+ if (laststart) \
+ SET_HIGH_BOUND (laststart); \
+ if (pending_exact) \
+ SET_HIGH_BOUND (pending_exact); \
+ }
+#else
+# define MOVE_BUFFER_POINTER(P) (P) += incr
+# define ELSE_EXTEND_BUFFER_HIGH_BOUND
+#endif
#define EXTEND_BUFFER() \
do { \
unsigned char *old_buffer = bufp->buffer; \
@@ -1590,15 +1610,17 @@ static reg_errcode_t compile_range _RE_ARGS ((const char **p_ptr,
/* If the buffer moved, move all the pointers into it. */ \
if (old_buffer != bufp->buffer) \
{ \
- b = (b - old_buffer) + bufp->buffer; \
- begalt = (begalt - old_buffer) + bufp->buffer; \
+ int incr = bufp->buffer - old_buffer; \
+ MOVE_BUFFER_POINTER (b); \
+ MOVE_BUFFER_POINTER (begalt); \
if (fixup_alt_jump) \
- fixup_alt_jump = (fixup_alt_jump - old_buffer) + bufp->buffer;\
+ MOVE_BUFFER_POINTER (fixup_alt_jump); \
if (laststart) \
- laststart = (laststart - old_buffer) + bufp->buffer; \
+ MOVE_BUFFER_POINTER (laststart); \
if (pending_exact) \
- pending_exact = (pending_exact - old_buffer) + bufp->buffer; \
+ MOVE_BUFFER_POINTER (pending_exact); \
} \
+ ELSE_EXTEND_BUFFER_HIGH_BOUND \
} while (0)
diff --git a/test/ChangeLog b/test/ChangeLog
index e95c44b0..2508ef0f 100644
--- a/test/ChangeLog
+++ b/test/ChangeLog
@@ -1,3 +1,22 @@
+Mon Aug 7 15:23:00 2000 Arnold D. Robbins <arnold@skeeve.com>
+
+ * Release 3.0.6: Release tar file made.
+
+Thu Aug 3 17:51:56 2000 Arnold D. Robbins <arnold@skeeve.com>
+
+ * Makefile.in (nlstrina): new test case.
+ * nlstrina.awk, nlstrina.ok: new files.
+
+Tue Jul 11 14:22:55 2000 Arnold D. Robbins <arnold@skeeve.com>
+
+ * Makefile.in (fnparydl): new test case.
+ * fnparydl.awk, fnparydl.ok: new files.
+
+Fri Jun 30 22:00:03 2000 Arnold D. Robbins <arnold@skeeve.com>
+
+ * Makefile.in (arysubnm): new test case.
+ * arysubnm.awk, arysubnm.ok: new files.
+
Sun Jun 25 15:08:19 2000 Arnold D. Robbins <arnold@skeeve.com>
* Release 3.0.5: Release tar file made.
diff --git a/test/Makefile.in b/test/Makefile.in
index 2246a664..39f1dc48 100644
--- a/test/Makefile.in
+++ b/test/Makefile.in
@@ -39,7 +39,7 @@ basic: msg swaplns messages argarray longwrds \
back89 tradanch nlfldsep splitvar intest nfldstr nors fnarydel \
noparms funstack clobber delarprm prdupval nasty zeroflag \
getnr2tm getnr2tb printf1 funsmnam fnamedat numindex subslash \
- opasnslf opasnidx arynocls getlnbuf
+ opasnslf opasnidx arynocls getlnbuf arysubnm fnparydl nlstrina
unix-tests: poundbang fflush getlnhd pipeio1 pipeio2 strftlng pid
@@ -501,6 +501,18 @@ getlnbuf::
@-AWKPATH=$(srcdir) $(AWK) -f gtlnbufv.awk $(srcdir)/getlnbuf.in > _2$@
$(CMP) $(srcdir)/getlnbuf.ok _$@ && $(CMP) $(srcdir)/getlnbuf.ok _2$@ && rm -f _$@ _2$@
+arysubnm::
+ @-AWKPATH=$(srcdir) $(AWK) -f arysubnm.awk >_$@
+ $(CMP) $(srcdir)/arysubnm.ok _$@ && rm -f _$@
+
+fnparydl::
+ @-AWKPATH=$(srcdir) $(AWK) -f fnparydl.awk >_$@
+ $(CMP) $(srcdir)/fnparydl.ok _$@ && rm -f _$@
+
+nlstrina::
+ @-AWKPATH=$(srcdir) $(AWK) -f nlstrina.awk >_$@
+ $(CMP) $(srcdir)/nlstrina.ok _$@ && rm -f _$@
+
clean:
rm -fr _* core junk out1 out2 out3 strftime.ok test1 test2 seq *~
diff --git a/test/arysubnm.awk b/test/arysubnm.awk
new file mode 100644
index 00000000..961b54ab
--- /dev/null
+++ b/test/arysubnm.awk
@@ -0,0 +1 @@
+BEGIN { n = 11 ; foo[n] = n; print (2 <= n) }
diff --git a/test/arysubnm.ok b/test/arysubnm.ok
new file mode 100644
index 00000000..d00491fd
--- /dev/null
+++ b/test/arysubnm.ok
@@ -0,0 +1 @@
+1
diff --git a/test/fnparydl.awk b/test/fnparydl.awk
new file mode 100644
index 00000000..ef3a8225
--- /dev/null
+++ b/test/fnparydl.awk
@@ -0,0 +1,31 @@
+# fnparydl.awk --- check that deleting works with arrays
+# that are parameters.
+#
+# Tue Jul 11 14:20:58 EDT 2000
+
+function delit(a, k)
+{
+ print "BEFORE LOOP"
+ for (k in a) {
+ print "DELETING KEY", k
+ delete a[k]
+ }
+ print "AFTER LOOP"
+}
+
+BEGIN {
+ for (i = 1 ; i <= 7; i++) {
+ q[i] = sprintf("element %d", i)
+ x[i] = i
+ y[i] = q[i]
+ }
+# adump(q)
+ delit(q)
+# for (i in q)
+# delete q[i]
+ j = 0;
+ for (i in q)
+ j++
+ print j, "elements still in q[]"
+# adump(q)
+}
diff --git a/test/fnparydl.ok b/test/fnparydl.ok
new file mode 100644
index 00000000..26a5c390
--- /dev/null
+++ b/test/fnparydl.ok
@@ -0,0 +1,10 @@
+BEFORE LOOP
+DELETING KEY 4
+DELETING KEY 5
+DELETING KEY 6
+DELETING KEY 7
+DELETING KEY 1
+DELETING KEY 2
+DELETING KEY 3
+AFTER LOOP
+0 elements still in q[]
diff --git a/test/nlstrina.awk b/test/nlstrina.awk
new file mode 100644
index 00000000..41dbd5f1
--- /dev/null
+++ b/test/nlstrina.awk
@@ -0,0 +1,77 @@
+# From E.Ab@chem.rug.nl Wed Aug 2 13:16:53 2000
+# Received: from mail.actcom.co.il
+# by localhost with POP3 (fetchmail-5.1.2)
+# for arnold@localhost (single-drop); Wed, 02 Aug 2000 13:16:53 -0400 (EDT)
+# Received: from lmail.actcom.co.il by actcom.co.il with ESMTP
+# (8.9.1a/actcom-0.2) id MAA21699 for <arobbins@actcom.co.il>;
+# Wed, 2 Aug 2000 12:20:38 +0300 (EET DST)
+# (rfc931-sender: lmail.actcom.co.il [192.114.47.13])
+# Received: from freefriends.org (freefriends.org [63.85.55.109])
+# by lmail.actcom.co.il (8.9.3/8.9.1) with ESMTP id LAA22723
+# for <arobbins@actcom.co.il>; Wed, 2 Aug 2000 11:23:22 +0300
+# Received: from mescaline.gnu.org (mescaline.gnu.org [158.121.106.21])
+# by freefriends.org (8.9.3/8.9.3) with ESMTP id FAA23582
+# for <arnold@skeeve.com>; Wed, 2 Aug 2000 05:18:59 -0400
+# Received: from dep.chem.rug.nl (dep.chem.rug.nl [129.125.7.81])
+# by mescaline.gnu.org (8.9.1a/8.9.1) with ESMTP id FAA30670;
+# Wed, 2 Aug 2000 05:20:24 -0400
+# Received: from rugmd34.chem.rug.nl (rugmd34.chem.rug.nl [129.125.42.34])
+# by dep.chem.rug.nl (8.9.3/8.9.3/Debian 8.9.3-21) with ESMTP id LAA17089;
+# Wed, 2 Aug 2000 11:20:23 +0200
+# Received: from chem.rug.nl (localhost [127.0.0.1]) by rugmd34.chem.rug.nl (980427.SGI.8.8.8/980728.SGI.AUTOCF) via ESMTP id LAA25392; Wed, 2 Aug 2000 11:20:22 +0200 (MDT)
+# Sender: E.Ab@chem.rug.nl
+# Message-ID: <3987E7D5.2BDC5FD3@chem.rug.nl>
+# Date: Wed, 02 Aug 2000 11:20:21 +0200
+# From: Eiso AB <E.Ab@chem.rug.nl>
+# X-Mailer: Mozilla 4.72C-SGI [en] (X11; I; IRIX 6.5 IP32)
+# X-Accept-Language: en
+# MIME-Version: 1.0
+# To: bug-gnu-utils@gnu.org, arnold@gnu.org
+# Subject: bug? [GNU Awk 3.0.5]
+#
+# Content-Type: text/plain; charset=us-ascii
+# Content-Transfer-Encoding: 7bit
+# X-UIDL: \f8"!(8G!!ZL$#!h>X!!
+# Status: R
+#
+# hi Arnold,
+#
+#
+# Please try the script beneath...
+# I'm not sure if this is a bug or not, but I would expect
+# the empty string as an array index just to be treated
+# like any other string
+#
+# so if ("" in ta) would be true, and for ( i in ta ) should loop only once.
+#
+BEGIN {
+ v=""
+ ta[v]++
+ if ( v in ta) print "a",v,++ta[v],ta[v]
+ print "b",v,++ta[v],ta[v]
+ for( i in ta) print "c",++c,i,ta[i]
+}
+#
+# goodluck, Eiso
+#
+# --
+# _________
+# _______________________________/ Eiso AB \_________________________
+#
+# o
+#
+# o Dept. of Biochemistry
+# University of Groningen
+# The Netherlands
+# o
+# . .
+# o ^ mailto:eiso@chem.rug.nl
+# | - _ mailto:eiso@dds.nl
+# \__|__/ http://md.chem.rug.nl/~eiso
+# | tel 4326
+# |
+# / \
+# / \
+# | |
+# ________ ._| |_. ________________________________________________
+#
diff --git a/test/nlstrina.ok b/test/nlstrina.ok
new file mode 100644
index 00000000..690f1a2f
--- /dev/null
+++ b/test/nlstrina.ok
@@ -0,0 +1,3 @@
+a 2 2
+b 3 3
+c 1 3
diff --git a/vms/ChangeLog b/vms/ChangeLog
index 35240b7c..63db18a1 100644
--- a/vms/ChangeLog
+++ b/vms/ChangeLog
@@ -1,3 +1,15 @@
+Mon Aug 7 15:23:00 2000 Arnold D. Robbins <arnold@skeeve.com>
+
+ * Release 3.0.6: Release tar file made.
+
+Sat Jul 15 20:52:09 2000 Pat Rankin <rankin@eql.caltech.edu>
+
+ * vmstest.com (printf1, fusmnam, fnamedat, numindex,
+ subslash, opasnslf, opasnidx, arynocls, getlnbuf,
+ arysubnm, fnparydl): New basic tests.
+ (igncdym): New gawk.extensions test.
+ (nondec): Old gawk.extensions test commented out.
+
Sun Jun 25 15:08:19 2000 Arnold D. Robbins <arnold@skeeve.com>
* Release 3.0.5: Release tar file made.
diff --git a/vms/descrip.mms b/vms/descrip.mms
index 08093817..31ddb0c3 100644
--- a/vms/descrip.mms
+++ b/vms/descrip.mms
@@ -129,7 +129,7 @@ DOCS= $(DOCDIR)gawk.1,$(DOCDIR)gawk.texi,$(DOCDIR)texinfo.tex
# Release of gawk
REL=3.0
-PATCHLVL=5
+PATCHLVL=6
# generic target
all : gawk
diff --git a/vms/gawk.hlp b/vms/gawk.hlp
index f72113d6..bc1a2210 100644
--- a/vms/gawk.hlp
+++ b/vms/gawk.hlp
@@ -1086,7 +1086,7 @@
Source text for it is present in the file GAWK.TEXI. A postscript
version is available via anonymous FTP from host gnudist.gnu.org in
directory /gnu/gawk, file gawk-{version}-doc.tar.gz where {version}
- would be the current version number, such as 3.0.5.
+ would be the current version number, such as 3.0.6.
Another source of documentation is "The AWK Programming Language"
by Aho, Weinberger, and Kernighan (1988), published by Addison-Wesley.
@@ -1200,7 +1200,7 @@
failure. The final exit status will be 1 (VMS success) if 0 is
used, or even (VMS non-success) if non-zero is used.
3 changes
- Changes between version 3.0.5 and 2.15.6
+ Changes between version 3.0.6 and 2.15.6
General
RS can contain multiple characters or be a regexp
diff --git a/vms/vmsbuild.com b/vms/vmsbuild.com
index a896aed7..fcd514b0 100644
--- a/vms/vmsbuild.com
+++ b/vms/vmsbuild.com
@@ -7,7 +7,7 @@ $! gawk 3.0 revised, Dec'95
$! gawk 3.0.1 revised, Nov'96
$!
$ REL = "3.0" !release version number
-$ PATCHLVL = "5"
+$ PATCHLVL = "6"
$!
$!
$ CCFLAGS = "/noList" ! "/noOpt/Debug"
diff --git a/vms/vmstest.com b/vms/vmstest.com
index bc2a987c..85c4fa9d 100644
--- a/vms/vmstest.com
+++ b/vms/vmstest.com
@@ -42,7 +42,9 @@ $basic: basic_lst1 = "msg swaplns messages argarray longwrds" -
+ " substr eofsplit prt1eval splitwht back89 tradanch"
$ basic_lst2 = "nlfldsep splitvar intest nfldstr nors" -
+ " fnarydel noparms funstack clobber delarprm prdupval" -
- + " nasty zeroflag getnr2tm getnr2tb"
+ + " nasty zeroflag getnr2tm getnr2tb printf1" -
+ + " funsmnam fnamedat numindex subslash opasnslf" -
+ + " opasnidx arynocls getlnbuf arysubnm fnparydl"
$ echo "basic"
$basic_loop1: basic_test = f$element(0," ",basic_lst1)
$ basic_lst1 = basic_lst1 - basic_test - " "
@@ -65,7 +67,7 @@ $ return
$
$gawk_ext: gawk_ext_list = "fieldwdth ignrcase posix manyfiles" -
+ " igncfs argtest badargs strftime gensub gnureops reint" -
- + " nondec"
+ + " igncdym" ! + " nondec"
$ echo "gawk_ext (gawk.extensions)"
$gawk_ext_loop: gawk_ext_test = f$element(0," ",gawk_ext_list)
$ gawk_ext_list = gawk_ext_list - gawk_ext_test - " "
@@ -354,9 +356,10 @@ $
$strftime: echo "strftime"
$ ! this test could fail on slow machines or on a second boundary,
$ ! so if it does, double check the actual results
-$!! date | gawk -- "{$3 = sprintf(""%02d"",$3+0); print >""strftime.ok""; print strftime() >""tmp.""}"
-$ ! note: original test is too Unix-specific, so substitute an easier one
-$ gawk -- "BEGIN {""show time"" | getline; print >""strftime.ok""; print strftime("" %v %T"") >""tmp.""}"
+$!! date | gawk -v "OUTPUT"=tmp. -f strftime.awk
+$ ! note: this test is simpler to implement for VMS
+$ gawk -v "OUTPUT"=tmp. -
+ "BEGIN {""show time"" | getline; print >""strftime.ok""; print strftime("" %v %T"") >OUTPUT}"
$ set noOn
$ cmp strftime.ok tmp.
$ if $status then rm tmp.;,strftime.ok;*
@@ -425,7 +428,7 @@ $
$childin: echo "childin: currently fails for the VMS port, so skipped"
$ return
$! note: this `childin' test currently [gawk 3.0.3] fails for vms
-$childin: echo "childin"
+$!!childin: echo "childin"
$ echo "note: type ``hi<return><ctrl/Z>'",-
"' if testing appears to hang in `childin'"
$!! @echo hi | gawk "BEGIN { ""cat"" | getline; print; close(""cat"") }" >tmp.
@@ -745,6 +748,93 @@ $ cmp getnr2tb.ok tmp.
$ if $status then rm tmp.;
$ return
$
+$printf1: echo "printf1"
+$ gawk -f printf1.awk >tmp.
+$ cmp printf1.ok tmp.
+$ if $status then rm tmp.;
+$ return
+$
+$funsmnam: echo "funsmnam"
+$ set noOn
+$ gawk -f funsmnam.awk >tmp. 2>&1
+$ set On
+$ cmp funsmnam.ok tmp.
+$ if $status then rm tmp.;
+$ return
+$
+$fnamedat: echo "fnamedat"
+$ set noOn
+$ gawk -f fnamedat.awk < fnamedat.in >tmp. 2>&1
+$ set On
+$ cmp fnamedat.ok tmp.
+$ if $status then rm tmp.;
+$ return
+$
+$numindex: echo "numindex"
+$ set noOn
+$ gawk -f numindex.awk < numindex.in >tmp. 2>&1
+$ set On
+$ cmp numindex.ok tmp.
+$ if $status then rm tmp.;
+$ return
+$
+$subslash: echo "subslash"
+$ set noOn
+$ gawk -f subslash.awk >tmp. 2>&1
+$ set On
+$ cmp subslash.ok tmp.
+$ if $status then rm tmp.;
+$ return
+$
+$opasnslf: echo "opasnslf"
+$ set noOn
+$ gawk -f opasnslf.awk >tmp. 2>&1
+$ set On
+$ cmp opasnslf.ok tmp.
+$ if $status then rm tmp.;
+$ return
+$
+$opasnidx: echo "opasnidx"
+$ set noOn
+$ gawk -f opasnidx.awk >tmp. 2>&1
+$ set On
+$ cmp opasnidx.ok tmp.
+$ if $status then rm tmp.;
+$ return
+$
+$arynocls: echo "arynocls"
+$ gawk -v "INPUT"=arynocls.in -f arynocls.awk >tmp.
+$ cmp arynocls.ok tmp.
+$ if $status then rm tmp.;
+$ return
+$
+$igncdym: echo "igncdym"
+$ gawk -f igncdym.awk igncdym.in >tmp.
+$ cmp igncdym.ok tmp.
+$ if $status then rm tmp.;
+$ return
+$
+$getlnbuf: echo "getlnbuf"
+$ gawk -f getlnbuf.awk getlnbuf.in >tmp.
+$ gawk -f gtlnbufv.awk getlnbuf.in >tmp2.
+$ cmp getlnbuf.ok tmp.
+$ if $status then rm tmp.;
+$ cmp getlnbuf.ok tmp2.
+$ if $status then rm tmp2.;
+$ return
+$
+$arysubnm: echo "arysubnm"
+$ gawk -f arysubnm.awk >tmp.
+$ cmp arysubnm.ok tmp.
+$ if $status then rm tmp.;
+$ return
+$
+$fnparydl: echo "fnparydl"
+$ gawk -f fnparydl.awk >tmp.
+$ cmp fnparydl.ok tmp.
+$ if $status then rm tmp.;
+$ return
+$
$nondec: echo "nondec"
$ ! gawk -f nondec.awk >tmp.
$ ! cmp nondec.ok tmp.