X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;ds=inline;f=tests%2Foutput%2Fpivot-table-test.c;h=f1944c3237bf828a5f29f44ee0f3e7f954085c74;hb=b2368722d2281703dd72de978e2fb7ad9caea7e5;hp=18e7d0499f5cd44bc6bf67cca2ebd83015ebf946;hpb=5ce9c6ba1502e623ec6723a8273da77e5858b8d4;p=pspp diff --git a/tests/output/pivot-table-test.c b/tests/output/pivot-table-test.c index 18e7d0499f..f1944c3237 100644 --- a/tests/output/pivot-table-test.c +++ b/tests/output/pivot-table-test.c @@ -68,7 +68,7 @@ main (int argc, char **argv) settings_init (); struct lex_reader *reader = lex_reader_for_file (input_file_name, NULL, - LEX_SYNTAX_AUTO, + SEG_MODE_AUTO, LEX_ERROR_CONTINUE); if (!reader) exit (1); @@ -1233,18 +1233,19 @@ static void output_msg (const struct msg *m_, void *lexer_) { struct lexer *lexer = lexer_; - struct msg m = *m_; - - if (m.file_name == NULL) - { - m.file_name = CONST_CAST (char *, lex_get_file_name (lexer)); - m.first_line = lex_get_first_line_number (lexer, 0); - m.last_line = lex_get_last_line_number (lexer, 0); - } - - m.command_name = output_get_uppercase_command_name (); + struct msg m = { + .category = m_->category, + .severity = m_->severity, + .location = (m_->location ? m_->location + : lexer ? lex_get_location (lexer, 0, 0) + : NULL), + .command_name = output_get_uppercase_command_name (), + .text = m_->text, + }; output_item_submit (message_item_create (&m)); free (m.command_name); + if (m.location != m_->location) + msg_location_destroy (m.location); }