X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Foutput%2Fpivot-table.c;h=6ba4c16f2e0811545b4b5673678900f5b37a1cf3;hb=861528a56e8fcb470285a2ee0bb87d716f652174;hp=f1e0e73372177d1ed566c690523f7b0e1b7bf0dc;hpb=8ce009a3dbbedc71995dcc63f8fa7fa1f8b251d0;p=pspp diff --git a/src/output/pivot-table.c b/src/output/pivot-table.c index f1e0e73372..6ba4c16f2e 100644 --- a/src/output/pivot-table.c +++ b/src/output/pivot-table.c @@ -2844,13 +2844,22 @@ pivot_value_new_value (const union value *value, int width, /* Returns a new pivot_value for VARIABLE. */ struct pivot_value * pivot_value_new_variable (const struct variable *variable) +{ + return pivot_value_new_variable__ (var_get_name (variable), + var_get_label (variable)); +} + +/* Returns a new pivot_value for a variable with the given NAME and optional + LABEL. */ +struct pivot_value * +pivot_value_new_variable__ (const char *name, const char *label) { struct pivot_value *value = xmalloc (sizeof *value); *value = (struct pivot_value) { .variable = { .type = PIVOT_VALUE_VARIABLE, - .var_name = xstrdup (var_get_name (variable)), - .var_label = xstrdup_if_nonempty (var_get_label (variable)), + .var_name = xstrdup (name), + .var_label = xstrdup_if_nonempty (label), }, }; return value;