projects
/
pspp
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
format: Cite variable names in messages reporting incompatible width.
[pspp]
/
src
/
language
/
dictionary
/
split-file.c
diff --git
a/src/language/dictionary/split-file.c
b/src/language/dictionary/split-file.c
index 1ebd7ae9ca6fa415cd2b13a737ea255827562244..8a134e1e769eca5562e57e31febb49b9c29b03d0 100644
(file)
--- a/
src/language/dictionary/split-file.c
+++ b/
src/language/dictionary/split-file.c
@@
-43,20
+43,30
@@
int
cmd_split_file (struct lexer *lexer, struct dataset *ds)
{
if (lex_match_id (lexer, "OFF"))
cmd_split_file (struct lexer *lexer, struct dataset *ds)
{
if (lex_match_id (lexer, "OFF"))
- dict_
set_split_vars (dataset_dict (ds), NULL, 0
);
+ dict_
clear_split_vars (dataset_dict (ds)
);
else
{
struct variable **v;
size_t n;
else
{
struct variable **v;
size_t n;
- /* For now, ignore SEPARATE and LAYERED. */
- (void) (lex_match_id (lexer, "SEPARATE") || lex_match_id (lexer, "LAYERED"));
+ enum split_type type = (!lex_match_id (lexer, "LAYERED")
+ && lex_match_id (lexer, "SEPARATE")
+ ? SPLIT_SEPARATE
+ : SPLIT_LAYERED);
lex_match (lexer, T_BY);
if (!parse_variables (lexer, dataset_dict (ds), &v, &n, PV_NO_DUPLICATE))
return CMD_CASCADING_FAILURE;
lex_match (lexer, T_BY);
if (!parse_variables (lexer, dataset_dict (ds), &v, &n, PV_NO_DUPLICATE))
return CMD_CASCADING_FAILURE;
- dict_set_split_vars (dataset_dict (ds), v, n);
+ if (n > MAX_SPLITS)
+ {
+ verify (MAX_SPLITS == 8);
+ msg (SE, _("At most 8 split variables may be specified."));
+ free (v);
+ return CMD_CASCADING_FAILURE;
+ }
+
+ dict_set_split_vars (dataset_dict (ds), v, n, type);
free (v);
}
free (v);
}