projects
/
pspp
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge remote-tracking branch 'origin/master' into sheet
[pspp]
/
src
/
language
/
data-io
/
list.c
diff --git
a/src/language/data-io/list.c
b/src/language/data-io/list.c
index e03bd08c126c903b5092a7c8aa1009d674613b3a..79ba5280b1cf8cf1a4c5936b090e9ea6d8fbf6d7 100644
(file)
--- a/
src/language/data-io/list.c
+++ b/
src/language/data-io/list.c
@@
-1,5
+1,5
@@
/* PSPP - a program for statistical analysis.
/* PSPP - a program for statistical analysis.
- Copyright (C) 1997-9, 2000, 2006, 2009-2011, 2013 Free Software Foundation, Inc.
+ Copyright (C) 1997-9, 2000, 2006, 2009-2011, 2013
, 2014, 2016
Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@
-85,7
+85,7
@@
list_execute (const struct lst_cmd *lcmd, struct dataset *ds)
while (casegrouper_get_next_group (grouper, &group))
{
struct ccase *ccase;
while (casegrouper_get_next_group (grouper, &group))
{
struct ccase *ccase;
- struct table *t;
+ struct table *t
= NULL
;
ccase = casereader_peek (group, 0);
if (ccase != NULL)
ccase = casereader_peek (group, 0);
if (ccase != NULL)
@@
-128,7
+128,8
@@
list_execute (const struct lst_cmd *lcmd, struct dataset *ds)
casereader_destroy (group);
casereader_destroy (group);
- table_item_submit (table_item_create (t, "Data List"));
+ if (t)
+ table_item_submit (table_item_create (t, "Data List", NULL));
}
ok = casegrouper_destroy (grouper);
ok = proc_commit (ds) && ok;
}
ok = casegrouper_destroy (grouper);
ok = proc_commit (ds) && ok;
@@
-189,25
+190,20
@@
cmd_list (struct lexer *lexer, struct dataset *ds)
else if (lex_match_id (lexer, "CASES"))
{
lex_match (lexer, T_EQUALS);
else if (lex_match_id (lexer, "CASES"))
{
lex_match (lexer, T_EQUALS);
- lex_force_match_id (lexer, "FROM");
-
- if (lex_force_int (lexer))
+ if (lex_match_id (lexer, "FROM") && lex_force_int (lexer))
{
{
- cmd.first = lex_integer (lexer);
+
cmd.first = lex_integer (lexer);
lex_get (lexer);
}
lex_get (lexer);
}
- lex_force_match (lexer, T_TO);
-
- if (lex_force_int (lexer))
+ if ((lex_match (lexer, T_TO) && lex_force_int (lexer))
+ || lex_is_integer (lexer))
{
cmd.last = lex_integer (lexer);
lex_get (lexer);
}
{
cmd.last = lex_integer (lexer);
lex_get (lexer);
}
- lex_force_match (lexer, T_BY);
-
- if (lex_force_int (lexer))
+ if (lex_match (lexer, T_BY) && lex_force_int (lexer))
{
cmd.step = lex_integer (lexer);
lex_get (lexer);
{
cmd.step = lex_integer (lexer);
lex_get (lexer);
@@
-233,15
+229,15
@@
cmd_list (struct lexer *lexer, struct dataset *ds)
if (cmd.first < 1)
{
if (cmd.first < 1)
{
- msg (SW, _("The first case (%ld) to list is
less than 1. The value is
"
- "being reset to 1."), cmd.first);
+ msg (SW, _("The first case (%ld) to list is
numbered less than 1.
"
+ "
The value is
being reset to 1."), cmd.first);
cmd.first = 1;
}
if (cmd.last < 1)
{
cmd.first = 1;
}
if (cmd.last < 1)
{
- msg (SW, _("The last case (%ld) to list is
less than 1. The value is
"
- "being reset to 1."), cmd.last);
+ msg (SW, _("The last case (%ld) to list is
numbered less than 1.
"
+ "
The value is
being reset to 1."), cmd.last);
cmd.last = 1;
}
cmd.last = 1;
}