From: Ben Pfaff Date: Tue, 25 Dec 2012 00:33:55 +0000 (-0800) Subject: placement-parser: Don't allow "/" as a FORTRAN input format. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5c567ded508b12a43f70c5df4733f6fbf4cc6804;p=pspp placement-parser: Don't allow "/" as a FORTRAN input format. DATA LIST allows / to appear inside FORTRAN format specifications but PRINT does not, so disallow it here. --- diff --git a/src/language/data-io/placement-parser.c b/src/language/data-io/placement-parser.c index 3360e8d739..a40e4226a1 100644 --- a/src/language/data-io/placement-parser.c +++ b/src/language/data-io/placement-parser.c @@ -52,6 +52,13 @@ static bool fixed_parse_fortran (struct lexer *l, struct pool *, enum fmt_use, formats like those parsed by DATA LIST or PRINT. Returns true only if successful. + The formats parsed are either input or output formats, according + to USE. + + If USE is FMT_FOR_INPUT, then T, X, and / "formats" are parsed, + in addition to regular formats. If USE is FMT_FOR_OUTPUT, then + T and X "formats" are parsed but not /. + If successful, formats for VAR_CNT variables are stored in *FORMATS, and the number of formats required is stored in *FORMAT_CNT. *FORMAT_CNT may be greater than VAR_CNT because @@ -204,7 +211,7 @@ fixed_parse_fortran (struct lexer *lexer, struct pool *pool, enum fmt_use use, { new_formats = &f; new_format_cnt = 1; - if (lex_match (lexer, T_SLASH)) + if (use == FMT_FOR_INPUT && lex_match (lexer, T_SLASH)) f.type = PRS_TYPE_NEW_REC; else {