summaryrefslogtreecommitdiff
path: root/profile.c
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2011-07-15 15:35:34 +0300
committerArnold D. Robbins <arnold@skeeve.com>2011-07-15 15:35:34 +0300
commit46f2db24d9e7f792f60149f5ee89ef4f22e3f4a9 (patch)
tree4522982b751d8643ee05022e60bdac757dfd0956 /profile.c
parent84658669a180b3f1e63d20b6ea166f7c5733786b (diff)
downloadgawk-46f2db24d9e7f792f60149f5ee89ef4f22e3f4a9.tar.gz
Fix gsub losing white space when working on fields.
Diffstat (limited to 'profile.c')
-rw-r--r--profile.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/profile.c b/profile.c
index cba8be9e..01d1e42f 100644
--- a/profile.c
+++ b/profile.c
@@ -507,6 +507,20 @@ cleanup:
case Op_after_endfile:
break;
+ case Op_sub_builtin:
+ {
+ const char *fname = "sub";
+ if (pc->sub_flags & GSUB)
+ fname = "gsub";
+ else if (pc->sub_flags & GENSUB)
+ fname = "gensub";
+ tmp = pp_list(pc->expr_count, "()", ", ");
+ str = pp_concat(fname, tmp, "");
+ efree(tmp);
+ pp_push(Op_sub_builtin, str, CAN_FREE);
+ }
+ break;
+
case Op_builtin:
{
static char *ext_func = "extension_function()";