From: Ben Pfaff Date: Wed, 6 Oct 2021 04:57:37 +0000 (-0700) Subject: DATA LIST: Fix assertion when RECORDS given twice with decreasing value. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?p=pspp;a=commitdiff_plain;h=eeedca3fcd959f73ba2c2fd4cbab5bd03ceb4f8d DATA LIST: Fix assertion when RECORDS given twice with decreasing value. Fixes bug #61285. Thanks to Irfan Ariq for reporting this bug. --- diff --git a/src/language/data-io/data-list.c b/src/language/data-io/data-list.c index b6dc078985..a6ed956302 100644 --- a/src/language/data-io/data-list.c +++ b/src/language/data-io/data-list.c @@ -118,6 +118,11 @@ cmd_data_list (struct lexer *lexer, struct dataset *ds) } else if (lex_match_id (lexer, "RECORDS")) { + if (data_parser_get_records (parser) > 0) + { + lex_sbc_only_once ("RECORDS"); + goto error; + } lex_match (lexer, T_EQUALS); lex_match (lexer, T_LPAREN); if (!lex_force_int_range (lexer, "RECORDS", 0, INT_MAX)) @@ -143,7 +148,7 @@ cmd_data_list (struct lexer *lexer, struct dataset *ds) } if (end) { - msg (SE, _("The %s subcommand may only be specified once."), "END"); + lex_sbc_only_once ("END"); goto error; }