X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fui%2Fgui%2Fpsppire.c;h=ea8250a6b9314092d7efa084fe83734f58cb7cf7;hb=f1ae4ee2876bee191b1bf79672d4bf834750c227;hp=92825a4f9cfc07aa9d3a567f57f54eb3dc607071;hpb=078b003b3171c6158a3419a01189b9658896f470;p=pspp diff --git a/src/ui/gui/psppire.c b/src/ui/gui/psppire.c index 92825a4f9c..ea8250a6b9 100644 --- a/src/ui/gui/psppire.c +++ b/src/ui/gui/psppire.c @@ -38,6 +38,7 @@ #include "output/driver.h" #include "output/journal.h" #include "output/message-item.h" +#include "output/spv/spv.h" #include "ui/gui/dict-display.h" #include "ui/gui/executor.h" @@ -104,7 +105,7 @@ initialize (const struct init_source *is) bind_textdomain_codeset (PACKAGE, "UTF-8"); break; case 8: - if ( ! gtk_parse_args (is->argc, is->argv) ) + if (! gtk_parse_args (is->argc, is->argv)) { perror ("Error parsing arguments"); exit (1); @@ -159,9 +160,11 @@ handle_msg (const struct msg *m_, void *lexer_) m.first_column = lex_get_first_column (lexer, 0); m.last_column = lex_get_last_column (lexer, 0); } - m.command_name = CONST_CAST (char *, output_get_command_name ()); + m.command_name = output_get_command_name (); message_item_submit (message_item_create (&m)); + + free (m.command_name); } void @@ -191,8 +194,15 @@ psppire_preload_file (const gchar *file) w = open_data_window (NULL, filename, NULL, NULL); else if (retval == 0) { - create_data_window (); - w = open_syntax_window (filename, NULL); + char *error = spv_detect (filename); + if (!error) + read_spv_file (filename); + else + { + free (error); + create_data_window (); + open_syntax_window (filename, NULL); + } } fh_unref (fh);