i18n_init (void)
{
setlocale (LC_ALL, "");
- bindtextdomain (PACKAGE, relocate(locale_dir));
+ char *allocated;
+ bindtextdomain (PACKAGE, relocate2 (locale_dir, &allocated));
+ free (allocated);
textdomain (PACKAGE);
assert (default_encoding == NULL);
struct cell_color
parse_color (struct driver_option *o)
{
+ struct cell_color color = CELL_COLOR_BLACK;
+ parse_color__ (o->default_value, &color);
if (o->value)
{
- struct cell_color color;
- if (parse_color__ (o->value, &color))
- return color;
-
- msg (MW, _("%s: `%s' is `%s', which could not be parsed as a color"),
- o->driver_name, o->name, o->value);
+ if (!parse_color__ (o->value, &color))
+ msg (MW, _("%s: `%s' is `%s', which could not be parsed as a color"),
+ o->driver_name, o->name, o->value);
}
-
- struct cell_color color;
- if (parse_color__ (o->default_value, &color))
- return color;
-
- return (struct cell_color) CELL_COLOR_BLACK;
+ driver_option_destroy (o);
+ return color;
}
{
char *error = pivot_table_look_read ("default.stt", &look);
if (error)
- look = pivot_table_look_ref (pivot_table_look_builtin_default ());
+ {
+ free (error);
+ look = pivot_table_look_ref (pivot_table_look_builtin_default ());
+ }
}
return look;
}
size_t n = 0;
path[n++] = ".";
const char *home = getenv ("HOME");
+ char *allocated = NULL;
if (home != NULL)
- path[n++] = xasprintf ("%s/.pspp/looks", home);
- char *allocated;
- path[n++] = relocate2 (PKGDATADIR "/looks", &allocated);
+ path[n++] = allocated = xasprintf ("%s/.pspp/looks", home);
+ char *allocated2;
+ path[n++] = relocate2 (PKGDATADIR "/looks", &allocated2);
path[n++] = NULL;
/* Search path. */
free (name2);
}
free (allocated);
+ free (allocated2);
if (!file)
return xasprintf ("%s: not found", name);
spv_writer_put_table (spv->writer, table_item->pt);
}
else if (is_text_item (output_item))
- spv_writer_put_text (spv->writer, to_text_item (output_item),
- output_get_command_name ());
+ {
+ char *command_id = output_get_command_name ();
+ spv_writer_put_text (spv->writer, to_text_item (output_item),
+ command_id);
+ free (command_id);
+ }
else if (is_page_eject_item (output_item))
spv_writer_eject_page (spv->writer);
else if (is_page_setup_item (output_item))
if (error)
return error;
+ table_area_style_uninit (out);
*out = (struct table_area_style) {
.font_style = {
.bold = (in->style & 1) != 0,