aboutsummaryrefslogtreecommitdiffstats
path: root/awkgram.y
diff options
context:
space:
mode:
Diffstat (limited to 'awkgram.y')
-rw-r--r--awkgram.y11
1 files changed, 4 insertions, 7 deletions
diff --git a/awkgram.y b/awkgram.y
index e2725a90..2157d3e8 100644
--- a/awkgram.y
+++ b/awkgram.y
@@ -392,7 +392,7 @@ regexp
_("regexp constant `/%s/' looks like a C comment, but is not"), re);
}
- exp = make_str_node(re, len);
+ exp = make_str_node(re, len, ALREADY_MALLOCED);
n = make_regnode(Node_regex, exp);
if (n == NULL) {
unref(exp);
@@ -2741,7 +2741,6 @@ yylex(void)
int mid;
static int did_newline = FALSE;
char *tokkey;
- size_t toklen;
int inhex = FALSE;
int intlstr = FALSE;
AWKNUM d;
@@ -3176,16 +3175,14 @@ retry:
tokadd(c);
}
yylval = GET_INSTRUCTION(Op_token);
- toklen = tok - tokstart;
if (want_source) {
- yylval->lextok = estrdup(tokstart, toklen);
+ yylval->lextok = estrdup(tokstart, tok - tokstart);
return lasttok = FILENAME;
}
yylval->opcode = Op_push_i;
- if (esc_seen)
- toklen = scan_escape(tokstart, toklen);
- yylval->memory = make_string(tokstart, toklen);
+ yylval->memory = make_str_node(tokstart,
+ tok - tokstart, esc_seen ? SCAN : 0);
if (intlstr) {
yylval->memory->flags |= INTLSTR;
intlstr = FALSE;