awk: do not use a copy of g_progname for node->l.new_progname

We never destroy g_progname's, the strings still exist, no need to copy

function                                             old     new   delta
chain_node                                           104      97      -7

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
Denys Vlasenko 2021-07-03 11:54:01 +02:00
parent e1e7ad6b60
commit 2211fa70cc

View File

@ -179,7 +179,7 @@ typedef struct node_s {
struct node_s *n; struct node_s *n;
var *v; var *v;
int aidx; int aidx;
char *new_progname; const char *new_progname;
regex_t *re; regex_t *re;
} l; } l;
union { union {
@ -1501,7 +1501,7 @@ static node *chain_node(uint32_t info)
if (seq->programname != g_progname) { if (seq->programname != g_progname) {
seq->programname = g_progname; seq->programname = g_progname;
n = chain_node(OC_NEWSOURCE); n = chain_node(OC_NEWSOURCE);
n->l.new_progname = xstrdup(g_progname); n->l.new_progname = g_progname;
} }
n = seq->last; n = seq->last;