aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/io.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/fortran/io.c')
-rw-r--r--gcc/fortran/io.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/gcc/fortran/io.c b/gcc/fortran/io.c
index 95b3013..9828897 100644
--- a/gcc/fortran/io.c
+++ b/gcc/fortran/io.c
@@ -2504,16 +2504,15 @@ gfc_match_open (void)
goto cleanup;
}
- if (!open->file && open->status)
- {
- if (open->status->expr_type == EXPR_CONSTANT
+ if (!open->file &&
+ (!open->status ||
+ (open->status->expr_type == EXPR_CONSTANT
&& gfc_wide_strncasecmp (open->status->value.character.string,
- "scratch", 7) != 0)
- {
+ "scratch", 7) != 0)))
+ {
gfc_error ("NEWUNIT specifier must have FILE= "
"or STATUS='scratch' at %C");
goto cleanup;
- }
}
}
else if (!open->unit)