From 09597aacf3423a93b405f1636f0d184fb75f53ac Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Mon, 21 Oct 2019 03:04:22 +0000 Subject: [PATCH] pivot-table: Make template pivot_values localized. This will be used in an upcoming commit. --- src/output/pivot-table.c | 6 ++++-- src/output/pivot-table.h | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/output/pivot-table.c b/src/output/pivot-table.c index bab2a8d6ae..057df4ef02 100644 --- a/src/output/pivot-table.c +++ b/src/output/pivot-table.c @@ -1860,7 +1860,7 @@ pivot_value_format_body (const struct pivot_value *value, break; case PIVOT_VALUE_TEMPLATE: - pivot_format_template (out, value->template.s, value->template.args, + pivot_format_template (out, value->template.local, value->template.args, value->template.n_args, show_values, show_variables); break; @@ -1949,7 +1949,9 @@ pivot_value_destroy (struct pivot_value *value) break; case PIVOT_VALUE_TEMPLATE: - free (value->template.s); + free (value->template.local); + if (value->template.id != value->template.local) + free (value->template.id); for (size_t i = 0; i < value->template.n_args; i++) pivot_argument_uninit (&value->template.args[i]); free (value->template.args); diff --git a/src/output/pivot-table.h b/src/output/pivot-table.h index 8006adaf00..99308c9e44 100644 --- a/src/output/pivot-table.h +++ b/src/output/pivot-table.h @@ -651,7 +651,8 @@ struct pivot_value /* PIVOT_VALUE_TEMPLATE. */ struct { - char *s; + char *local; /* Localized. */ + char *id; /* Identifier. */ struct pivot_argument *args; size_t n_args; } -- 2.30.2