X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fui%2Fgui%2Fpsppire.c;h=737b965c116b35d5ac7c214ca465d341c00e3463;hb=f1a02381223dd6d652c590e2a5514967b9448905;hp=b87a29f2a48db9d12c692e9a126b66e2f199f2f9;hpb=0b73a96649162980c523c316f512d677fdd1b6d9;p=pspp-builds.git diff --git a/src/ui/gui/psppire.c b/src/ui/gui/psppire.c index b87a29f2..737b965c 100644 --- a/src/ui/gui/psppire.c +++ b/src/ui/gui/psppire.c @@ -257,46 +257,8 @@ parse_non_options (int key, char *arg, struct argp_state *state) { case ARGP_KEY_ARG: { - struct string syntax; - FILE *fp = fopen (arg, "r"); - if (NULL == fp) - { - const int errnum = errno; - fprintf (state->err_stream, _("Cannot open %s: %s.\n"), - arg, strerror (errnum)); - return 0; - } - if ( sfm_detect (fp)) - { - ds_init_cstr (&syntax, "GET FILE="); - goto close; - } - rewind (fp); - if (pfm_detect (fp)) - { - ds_init_cstr (&syntax, "IMPORT FILE="); - goto close; - } - - fclose (fp); - msg (ME, _("%s is neither a system nor portable file"), arg); - break; - - close: - fclose (fp); - - syntax_gen_string (&syntax, ss_cstr (arg)); - ds_put_cstr (&syntax, "."); - - getl_append_source (ss, - create_syntax_string_source (ds_cstr (&syntax)), - GETL_BATCH, - ERRMODE_CONTINUE); - - ds_destroy (&syntax); - - psppire_window_set_filename (PSPPIRE_WINDOW (the_data_window), arg); - + psppire_data_window_load_file (PSPPIRE_DATA_WINDOW (the_data_window), + arg); break; } default: