Custom currency formats are not usable for input, only for output, but this
code tried to use them for input if the format was changed to a custom
currency format in the GUI. This commit fixes the problem by using a
DOLLAR format, instead, for parsing.
Reported by Bastián Díaz <diaz.bastian@ymail.com>.
const char *enc = dict_get_encoding (aux->dict);
const struct fmt_spec *newfmt = var_get_print_format (aux->new_variable);
char *s = data_out (old, enc, var_get_print_format (aux->old_variable));
- free (data_in (ss_cstr (s), enc, newfmt->type, new, new_width, enc));
+ enum fmt_type type = (fmt_usable_for_input (newfmt->type)
+ ? newfmt->type
+ : FMT_DOLLAR);
+ free (data_in (ss_cstr (s), enc, type, new, new_width, enc));
free (s);
}