if (!stringi_set_is_empty (&strings))
{
+ size_t count = stringi_set_count (&strings);
const char *example = stringi_set_node_get_string (
stringi_set_first (&strings));
- msg (ME, ngettext ("STRINGS specified a variable %s, but no variable "
- "with that name was found on SAVE.",
- "STRINGS specified %2$zu variables, including %1$s, "
- "whose names were not found on SAVE.",
- stringi_set_count (&strings)),
- example, stringi_set_count (&strings));
+
+ if (count == 1)
+ msg (ME, _("The SAVE command STRINGS subcommand specifies an unknown "
+ "variable %s."), example);
+ else
+ msg (ME, ngettext ("The SAVE command STRINGS subcommand specifies %zu "
+ "unknown variable: %s.",
+ "The SAVE command STRINGS subcommand specifies %zu "
+ "unknown variables, including %s.",
+ count),
+ count, example);
ok = false;
}
stringi_set_destroy (&strings);
SAVE 1/OUTFILE='matrix.sav'/NAMES={'a'}/VARIABLES=a.
SAVE 1/OUTFILE='matrix2.sav'.
SAVE {1,2}/OUTFILE='matrix2.sav'.
+SAVE {1,2}/OUTFILE='matrix3.sav'/NAMES={'a', 'a'}.
+SAVE {1,2}/OUTFILE='matrix4.sav'/STRINGS=a.
+SAVE {1,2}/OUTFILE='matrix5.sav'/STRINGS=a, b.
END MATRIX.
])
AT_CHECK([pspp matrix.sps], [1], [dnl
error: The first SAVE to `matrix2.sav' within this matrix program had 1
columns, so a 1×2 matrix cannot be saved to it.
+
+error: Duplicate variable name a in SAVE statement.
+
+error: The SAVE command STRINGS subcommand specifies an unknown variable a.
+
+error: The SAVE command STRINGS subcommand specifies 2 unknown variables,
+including a.
])
AT_CLEANUP
\ No newline at end of file