From eeedca3fcd959f73ba2c2fd4cbab5bd03ceb4f8d Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Tue, 5 Oct 2021 21:57:37 -0700 Subject: [PATCH] DATA LIST: Fix assertion when RECORDS given twice with decreasing value. Fixes bug #61285. Thanks to Irfan Ariq for reporting this bug. --- src/language/data-io/data-list.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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; } -- 2.30.2