From: John Darrington Date: Sat, 8 Nov 2008 23:35:12 +0000 (+0900) Subject: Fail more gracefully when the file specified on the command line is X-Git-Tag: v0.7.1~50^2~14 X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0172359b97d990c1eacb3a9a0003c7142ba0b520;p=pspp-builds.git Fail more gracefully when the file specified on the command line is neither system nor portable file. --- diff --git a/src/ui/gui/psppire.c b/src/ui/gui/psppire.c index b1551fbb..d36a802c 100644 --- a/src/ui/gui/psppire.c +++ b/src/ui/gui/psppire.c @@ -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);