Fix trivial comment typo.
[official-gcc.git] / libgfortran / io / endfile.c
blob76a1c34a04d1026d8758f9b5b12f901e383bd697
1 /* Copyright (C) 2002-2003 Free Software Foundation, Inc.
2 Contributed by Andy Vaught
4 This file is part of the GNU Fortran 95 runtime library (libgfortran).
6 Libgfortran is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2, or (at your option)
9 any later version.
11 Libgfortran is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with Libgfortran; see the file COPYING. If not, write to
18 the Free Software Foundation, 59 Temple Place - Suite 330,
19 Boston, MA 02111-1307, USA. */
21 #include "config.h"
22 #include "libgfortran.h"
23 #include "io.h"
25 /* endfile.c-- Implement the ENDFILE statement */
27 extern void st_endfile (void);
28 export_proto(st_endfile);
30 void
31 st_endfile (void)
33 gfc_unit *u;
35 library_start ();
37 u = get_unit (0);
38 if (u != NULL)
40 current_unit = u; /* next_record() needs this set */
41 if (u->current_record)
42 next_record (1);
44 flush(u->s);
45 struncate (u->s);
46 u->endfile = AFTER_ENDFILE;
49 library_end ();