Until now, PSPP has trimmed trailing whitespace from variable
labels. SPSS does not do this, which led to gratuitous changes
in variable labels when reading and then writing back a .sav
file, so this commit stops stripping trailing whitespace from
variable labels.
Thanks to Curt Reinhold <Curt.Reinhold@psychonomics.de> for
providing the .sav file that led to this discovery.
free (v->label);
v->label = NULL;
- if (label != NULL)
+ if (label != NULL && label[strspn (label, CC_SPACES)])
{
const char *dict_encoding = var_get_encoding (v);
struct substring s = ss_cstr (label);
}
}
- ss_trim (&s, ss_cstr (CC_SPACES));
- if (!ss_is_empty (s))
v->label = ss_xstrdup (s);
}