Fail more gracefully when the file specified on the command line is
authorJohn Darrington <john@darrington.wattle.id.au>
Sat, 8 Nov 2008 23:35:12 +0000 (08:35 +0900)
committerJohn Darrington <john@darrington.wattle.id.au>
Sat, 8 Nov 2008 23:35:12 +0000 (08:35 +0900)
neither system nor portable file.

src/ui/gui/psppire.c

index b1551fbb15f137f81cc548cc48f3f49a80f70fb3..d36a802cb0e828a9a9d7c46c81aa312d8e5958d2 100644 (file)
@@ -263,7 +263,13 @@ parse_non_options (int key, char *arg, struct argp_state *state)
        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);