aboutsummaryrefslogtreecommitdiff
path: root/libgfortran
diff options
context:
space:
mode:
authortoon <toon@138bc75d-0d04-0410-961f-82ee72b054a4>2003-10-29 06:47:56 +0000
committertoon <toon@138bc75d-0d04-0410-961f-82ee72b054a4>2003-10-29 06:47:56 +0000
commitac9543cceb969055fbc6e9f8cc8efc2736555313 (patch)
tree5f72f5e93a9c703157aedb366a6e9d850f5d57b3 /libgfortran
parent5c9594807c2a5b5955324ee77326c966d409c7e4 (diff)
2003-10-29 Toon Moene <toon@moene.indiv.nluug.nl>
PR fortran/12701 * open.c (new_unit): Open without a file name opens a file with name fort.<unit>. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/tree-ssa-20020619-branch@73029 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgfortran')
-rw-r--r--libgfortran/ChangeLog6
-rw-r--r--libgfortran/io/open.c9
2 files changed, 11 insertions, 4 deletions
diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog
index 61bcbf2fde4..ba764cda779 100644
--- a/libgfortran/ChangeLog
+++ b/libgfortran/ChangeLog
@@ -1,3 +1,9 @@
+2003-10-29 Toon Moene <toon@moene.indiv.nluug.nl>
+
+ PR fortran/12701
+ * open.c (new_unit): Open without a file name opens
+ a file with name fort.<unit>.
+
2003-10-12 Feng Wang <wf_cs@yahoo.com>
* intrinsics/cshift0.c: New file.
diff --git a/libgfortran/io/open.c b/libgfortran/io/open.c
index dc7cb5002a0..77ee8eb31f7 100644
--- a/libgfortran/io/open.c
+++ b/libgfortran/io/open.c
@@ -252,6 +252,7 @@ new_unit (unit_flags * flags)
{
unit_t *u;
stream *s;
+ char tmpname[5 /* fort. */ + 10 /* digits of unit number */ + 1 /* 0 */];
/* Change unspecifieds to defaults */
@@ -354,9 +355,9 @@ new_unit (unit_flags * flags)
if (ioparm.file != NULL)
break;
- generate_error (ERROR_MISSING_OPTION,
- "FILE parameter required in OPEN statement");
- return;
+ ioparm.file = tmpname;
+ ioparm.file_len = sprintf(ioparm.file, "fort.%d", ioparm.unit);
+ break;
default:
internal_error ("new_unit(): Bad status");
@@ -396,7 +397,7 @@ new_unit (unit_flags * flags)
u->last_record = 0;
u->current_record = 0;
- /* If the file is direct access, calcuate the maximum record number
+ /* If the file is direct access, calculate the maximum record number
* via a division now instead of letting the multiplication overflow
* later. */