break;
}
}
+ if (flip->n_vars <= 0)
+ goto error;
flip->file = pool_create_temp_file (flip->pool);
if (flip->file == NULL)
return CMD_SUCCESS;
error:
- dict_destroy (new_dict);
+ dict_unref (new_dict);
destroy_flip_pgm (flip);
return CMD_CASCADING_FAILURE;
}
}
*cp = '\0';
+ if (strlen (name) == 0)
+ {
+ free (name);
+ name = xstrdup ("v");
+ }
+
/* Use the mangled name, if it is available, or add numeric
extensions until we find one that is. */
- if (!dict_create_var (dict, name, 0))
+ if (!id_is_plausible (name, false) || !dict_create_var (dict, name, 0))
{
int len = strlen (name);
int i;
strncpy (n, name, ofs);
sprintf (&n[ofs], "%d", i);
- if (dict_create_var (dict, n, 0))
+ if (id_is_plausible (n, false) && dict_create_var (dict, n, 0))
break;
}
}
Returns true if successful read, false if an I/O occurred
during destruction or previously. */
static void
-flip_casereader_destroy (struct casereader *reader UNUSED, void *flip_)
+flip_casereader_destroy (struct casereader *reader, void *flip_)
{
struct flip_pgm *flip = flip_;
if (flip->error)