projects
/
pspp
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add assertions.
[pspp]
/
src
/
split-file.c
diff --git
a/src/split-file.c
b/src/split-file.c
index 29fc432ef0902b4be4bb104f02d68f7e7b6fd1b1..506a433cafa7b0a6069c0b65eb2be317b8c049b5 100644
(file)
--- a/
src/split-file.c
+++ b/
src/split-file.c
@@
-14,13
+14,14
@@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 5
9 Temple Place - Suite 330
, Boston, MA
- 0211
1-1307
, USA. */
+ Foundation, Inc., 5
1 Franklin Street, Fifth Floor
, Boston, MA
+ 0211
0-1301
, USA. */
#include <config.h>
#include <stdlib.h>
#include "alloc.h"
#include "command.h"
#include <config.h>
#include <stdlib.h>
#include "alloc.h"
#include "command.h"
+#include "dictionary.h"
#include "error.h"
#include "lexer.h"
#include "str.h"
#include "error.h"
#include "lexer.h"
#include "str.h"
@@
-29,27
+30,22
@@
int
cmd_split_file (void)
{
int
cmd_split_file (void)
{
- lex_match_id ("SPLIT");
- lex_match_id ("FILE");
-
if (lex_match_id ("OFF"))
if (lex_match_id ("OFF"))
- {
- default_dict.n_splits = 0;
- free (default_dict.splits);
- default_dict.splits = NULL;
- }
+ dict_set_split_vars (default_dict, NULL, 0);
else
{
struct variable **v;
int n;
else
{
struct variable **v;
int n;
+ /* For now, ignore SEPARATE and LAYERED. */
+ lex_match_id ("SEPARATE") || lex_match_id ("LAYERED");
+
lex_match (T_BY);
lex_match (T_BY);
- if (!parse_variables (
NULL
, &v, &n, PV_NO_DUPLICATE))
+ if (!parse_variables (
default_dict
, &v, &n, PV_NO_DUPLICATE))
return CMD_FAILURE;
return CMD_FAILURE;
- default_dict.n_splits = n;
- default_dict.splits = v = xrealloc (v, sizeof *v * (n + 1));
- v[n] = NULL;
+ dict_set_split_vars (default_dict, v, n);
+ free (v);
}
return lex_end_of_command ();
}
return lex_end_of_command ();