summaryrefslogtreecommitdiff
path: root/awkgram.y
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2010-07-16 14:55:10 +0300
committerArnold D. Robbins <arnold@skeeve.com>2010-07-16 14:55:10 +0300
commit00ef0423acd97cb964a2bae54c93a03a8ab50e5e (patch)
tree2864426773f537f912db1bd716c27b713c5f7dcf /awkgram.y
parent3ba50a15ebd976f7a88393e2e45dc14b6478b9a9 (diff)
downloadgawk-00ef0423acd97cb964a2bae54c93a03a8ab50e5e.tar.gz
Move to 3.1.8.gawk-3.1.8
Diffstat (limited to 'awkgram.y')
-rw-r--r--awkgram.y22
1 files changed, 12 insertions, 10 deletions
diff --git a/awkgram.y b/awkgram.y
index 5a00ec13..c11e33cf 100644
--- a/awkgram.y
+++ b/awkgram.y
@@ -3,7 +3,7 @@
*/
/*
- * Copyright (C) 1986, 1988, 1989, 1991-2009 the Free Software Foundation, Inc.
+ * Copyright (C) 1986, 1988, 1989, 1991-2010 the Free Software Foundation, Inc.
*
* This file is part of GAWK, the GNU implementation of the
* AWK Programming Language.
@@ -1697,7 +1697,7 @@ allow_newline(void)
}
if (c == '\n')
sourceline++;
- if (! ISSPACE(c)) {
+ if (! isspace(c)) {
pushback();
break;
}
@@ -2133,7 +2133,7 @@ retry:
case '.':
c = nextc();
pushback();
- if (! ISDIGIT(c))
+ if (! isdigit(c))
return lasttok = '.';
else
c = '.';
@@ -2161,7 +2161,7 @@ retry:
if (tok == tokstart + 2) {
int peek = nextc();
- if (ISXDIGIT(peek)) {
+ if (isxdigit(peek)) {
inhex = TRUE;
pushback(); /* following digit */
} else {
@@ -2190,7 +2190,7 @@ retry:
if ((c = nextc()) == '-' || c == '+') {
int c2 = nextc();
- if (ISDIGIT(c2)) {
+ if (isdigit(c2)) {
tokadd(c);
tokadd(c2);
} else {
@@ -2198,7 +2198,7 @@ retry:
pushback(); /* + or - */
pushback(); /* e or E */
}
- } else if (! ISDIGIT(c)) {
+ } else if (! isdigit(c)) {
pushback(); /* character after e or E */
pushback(); /* e or E */
} else {
@@ -2246,7 +2246,7 @@ retry:
tokadd('\0');
if (! do_traditional && isnondecimal(tokstart, FALSE)) {
if (do_lint) {
- if (ISDIGIT(tokstart[1])) /* not an 'x' or 'X' */
+ if (isdigit(tokstart[1])) /* not an 'x' or 'X' */
lintwarn("numeric constant `%.*s' treated as octal",
(int) strlen(tokstart)-1, tokstart);
else if (tokstart[1] == 'x' || tokstart[1] == 'X')
@@ -2287,7 +2287,7 @@ retry:
}
}
- if (c != '_' && ! ISALPHA(c)) {
+ if (c != '_' && ! isalpha(c)) {
yyerror(_("invalid char '%c' in expression"), c);
exit(EXIT_FAILURE);
}
@@ -3606,7 +3606,7 @@ constant_fold(NODE *left, NODETYPE op, NODE *right)
return node(left, op, right);
}
- /* String concatentation of two string cnstants */
+ /* String concatentation of two string constants */
if (op == Node_concat
&& left->type == Node_val
&& (left->flags & (STRCUR|STRING)) != 0
@@ -3630,7 +3630,7 @@ constant_fold(NODE *left, NODETYPE op, NODE *right)
if (left->type != Node_val
|| (left->flags & (STRCUR|STRING)) != 0
|| right->type != Node_val
- || (left->flags & (STRCUR|STRING)) != 0) {
+ || (right->flags & (STRCUR|STRING)) != 0) {
return node(left, op, right);
}
@@ -3660,6 +3660,8 @@ constant_fold(NODE *left, NODETYPE op, NODE *right)
result *= right->numbr;
break;
case Node_quotient:
+ if (right->numbr == 0)
+ fatal(_("division by zero attempted in `/'"));
result /= right->numbr;
break;
case Node_mod: