X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Flanguage%2Fstats%2Fflip.c;h=5c6e77404879e1b1b340f87d60c8ad1ef8fc6fe9;hb=9105b67fe006fe41c044e3659325594a52d0c899;hp=c3f2439fe9ac0dc9968fd4eddcd45913d9ea65f2;hpb=687adf53eae434e88a47bb3409f946f3a26115a4;p=pspp diff --git a/src/language/stats/flip.c b/src/language/stats/flip.c index c3f2439fe9..5c6e774048 100644 --- a/src/language/stats/flip.c +++ b/src/language/stats/flip.c @@ -64,7 +64,7 @@ struct varname struct flip_pgm { struct pool *pool; /* Pool containing FLIP data. */ - struct variable **var; /* Variables to transpose. */ + const struct variable **var; /* Variables to transpose. */ int *idx_to_fv; /* var[]->index to compacted sink case fv. */ size_t var_cnt; /* Number of elements in `var'. */ int case_cnt; /* Pre-flip case count. */ @@ -122,7 +122,7 @@ cmd_flip (struct lexer *lexer, struct dataset *ds) if (lex_match_id (lexer, "VARIABLES")) { lex_match (lexer, '='); - if (!parse_variables (lexer, dict, &flip->var, &flip->var_cnt, + if (!parse_variables_const (lexer, dict, &flip->var, &flip->var_cnt, PV_NO_DUPLICATE)) goto error; lex_match (lexer, '/'); @@ -299,7 +299,8 @@ flip_sink_create (struct dataset *ds, struct flip_pgm *flip) flip->file = pool_tmpfile (flip->pool); if (flip->file == NULL) { - msg (SE, _("Could not create temporary file for FLIP.")); + msg (SE, _("Could not create temporary file for FLIP: %s."), + strerror (errno)); return NULL; } @@ -448,7 +449,10 @@ flip_file (struct flip_pgm *flip) if (read_cases != fread (input_buf, case_bytes, read_cases, input_file)) { - msg (SE, _("Error reading FLIP file: %s."), strerror (errno)); + if (ferror (input_file)) + msg (SE, _("Error reading FLIP file: %s."), strerror (errno)); + else + msg (SE, _("Unexpected end of file reading FLIP file.")); return false; }