aboutsummaryrefslogtreecommitdiffstats
path: root/node.c
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2010-07-16 12:49:45 +0300
committerArnold D. Robbins <arnold@skeeve.com>2010-07-16 12:49:45 +0300
commit6607eb3d5e40b98d2acc8f6b0d6a0b5a4b0f56bd (patch)
treec1eb39be8cc5c19101385e171ec0c58f95d521cc /node.c
parent6719bb6e1c5576e857ab6fc121ec31a75161a3e7 (diff)
downloadegawk-6607eb3d5e40b98d2acc8f6b0d6a0b5a4b0f56bd.tar.gz
egawk-6607eb3d5e40b98d2acc8f6b0d6a0b5a4b0f56bd.tar.bz2
egawk-6607eb3d5e40b98d2acc8f6b0d6a0b5a4b0f56bd.zip
Move to gawk-3.0.3.
Diffstat (limited to 'node.c')
-rw-r--r--node.c21
1 files changed, 18 insertions, 3 deletions
diff --git a/node.c b/node.c
index 66c9ecb7..6f10b9f3 100644
--- a/node.c
+++ b/node.c
@@ -3,7 +3,7 @@
*/
/*
- * Copyright (C) 1986, 1988, 1989, 1991-1996 the Free Software Foundation, Inc.
+ * Copyright (C) 1986, 1988, 1989, 1991-1997 the Free Software Foundation, Inc.
*
* This file is part of GAWK, the GNU implementation of the
* AWK Programming Language.
@@ -79,6 +79,14 @@ register NODE *n;
return n->numbr;
}
+#ifdef NONDECDATA
+ errno = 0;
+ if (! do_traditional && isnondecimal(cp)) {
+ n->numbr = nondec2awknum(cp, cpend - cp);
+ goto finish;
+ }
+#endif /* NONDECDATA */
+
errno = 0;
save = *cpend;
*cpend = '\0';
@@ -88,6 +96,7 @@ register NODE *n;
while (ISSPACE(*ptr))
ptr++;
*cpend = save;
+finish:
/* the >= should be ==, but for SunOS 3.5 strtod() */
if (errno == 0 && ptr >= cpend)
n->flags |= newflags;
@@ -257,7 +266,7 @@ unsigned int flags;
r->flags = flags | SCALAR;
#ifdef DEBUG
r->stref = 1;
- r->stptr = 0;
+ r->stptr = NULL;
r->stlen = 0;
#endif
return r;
@@ -343,10 +352,11 @@ more_nodes()
/* get more nodes and initialize list */
emalloc(nextfree, NODE *, NODECHUNK * sizeof(NODE), "newnode");
- for (np = nextfree; np < &nextfree[NODECHUNK - 1]; np++) {
+ for (np = nextfree; np <= &nextfree[NODECHUNK - 1]; np++) {
np->flags = 0;
np->nextp = np + 1;
}
+ --np;
np->nextp = NULL;
np = nextfree;
nextfree = nextfree->nextp;
@@ -393,6 +403,11 @@ register NODE *tmp;
free(tmp->stptr);
}
freenode(tmp);
+ return;
+ }
+ if ((tmp->flags & FIELD) != 0) {
+ freenode(tmp);
+ return;
}
}