X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Flanguage%2Fdata-io%2Flist.c;h=e9e0e326c2234b5f823e1d0fc7fa29dac894bd42;hb=e314315b24e8f4356c1e72a61bef6633f8992bf4;hp=153c204f219c780ec3b94ef92dbb18146aee20d8;hpb=0df9cdd3df66caf4353128feff3008289cda8115;p=pspp diff --git a/src/language/data-io/list.c b/src/language/data-io/list.c index 153c204f21..e9e0e326c2 100644 --- a/src/language/data-io/list.c +++ b/src/language/data-io/list.c @@ -1,5 +1,5 @@ /* PSPP - a program for statistical analysis. - Copyright (C) 1997-9, 2000, 2006, 2009-2011, 2013, 2014 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 @@ -189,25 +189,20 @@ cmd_list (struct lexer *lexer, struct dataset *ds) 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_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); } - 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); @@ -233,15 +228,15 @@ cmd_list (struct lexer *lexer, struct dataset *ds) 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) { - 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; }