aboutsummaryrefslogtreecommitdiffstats
path: root/command.y
diff options
context:
space:
mode:
authorjohn haque <j.eh@mchsi.com>2011-08-21 05:54:38 -0500
committerjohn haque <j.eh@mchsi.com>2011-10-12 07:46:07 -0500
commitf0866c5197ee0c01fd1ded16e364cbe612c271be (patch)
treebece1471f69606eea216154b2d7a480cd90c0a20 /command.y
parent1fea520248b42ca995c8797698c60301ea42ffe9 (diff)
downloadegawk-f0866c5197ee0c01fd1ded16e364cbe612c271be.tar.gz
egawk-f0866c5197ee0c01fd1ded16e364cbe612c271be.tar.bz2
egawk-f0866c5197ee0c01fd1ded16e364cbe612c271be.zip
Add a test file, cleanup code and update doc.
Diffstat (limited to 'command.y')
-rw-r--r--command.y9
1 files changed, 4 insertions, 5 deletions
diff --git a/command.y b/command.y
index d2a61a0d..18ef0613 100644
--- a/command.y
+++ b/command.y
@@ -1163,6 +1163,7 @@ again:
if (c == '"') {
char *str, *p;
+ int flags = ALREADY_MALLOCED;
int esc_seen = FALSE;
toklen = lexend - lexptr;
@@ -1195,12 +1196,10 @@ err:
append_cmdarg(yylval);
return D_STRING;
} else { /* awk string */
- size_t len;
- len = p - str;
if (esc_seen)
- len = scan_escape(str, len);
+ flags |= SCAN;
yylval = mk_cmdarg(D_node);
- yylval->a_node = make_str_node(str, len);
+ yylval->a_node = make_str_node(str, p - str, flags);
append_cmdarg(yylval);
return D_NODE;
}
@@ -1350,7 +1349,7 @@ concat_args(CMDARG *arg, int count)
}
str[len] = '\0';
efree(tmp);
- return make_str_node(str, len);
+ return make_str_node(str, len, ALREADY_MALLOCED);
}
/* find_command --- find the index in 'cmdtab' using exact,