diff options
author | Janne Blomqvist <jb@gcc.gnu.org> | 2010-04-01 19:22:57 +0300 |
---|---|---|
committer | Janne Blomqvist <jb@gcc.gnu.org> | 2010-04-01 19:22:57 +0300 |
commit | e76a3fde81380ce422994e1a0fb21322d2268341 (patch) | |
tree | e8d9448ab70a3f19bbb9217f201b291d412f9203 /libgfortran/io/intrinsics.c | |
parent | 5e9fb3dbde748212ff0b025dcf196da9b086b1c4 (diff) | |
download | gcc-e76a3fde81380ce422994e1a0fb21322d2268341.zip gcc-e76a3fde81380ce422994e1a0fb21322d2268341.tar.gz gcc-e76a3fde81380ce422994e1a0fb21322d2268341.tar.bz2 |
PR libfortran/43605 Fix FTELL for formatted files
Co-Authored-By: Manfred Schwarb <manfred99@gmx.ch>
From-SVN: r157914
Diffstat (limited to 'libgfortran/io/intrinsics.c')
-rw-r--r-- | libgfortran/io/intrinsics.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/libgfortran/io/intrinsics.c b/libgfortran/io/intrinsics.c index 9428b75..4beb013 100644 --- a/libgfortran/io/intrinsics.c +++ b/libgfortran/io/intrinsics.c @@ -1,8 +1,8 @@ /* Implementation of the FGET, FGETC, FPUT, FPUTC, FLUSH FTELL, TTYNAM and ISATTY intrinsics. - Copyright (C) 2005, 2007, 2009 Free Software Foundation, Inc. + Copyright (C) 2005, 2007, 2009, 2010 Free Software Foundation, Inc. -This file is part of the GNU Fortran 95 runtime library (libgfortran). +This file is part of the GNU Fortran runtime library (libgfortran). Libgfortran is free software; you can redistribute it and/or modify it under the terms of the GNU General Public @@ -267,10 +267,10 @@ size_t PREFIX(ftell) (int * unit) { gfc_unit * u = find_unit (*unit); - size_t ret; + gfc_offset ret; if (u == NULL) return ((size_t) -1); - ret = (size_t) stell (u->s); + ret = stell (u->s) + fbuf_reset (u); unlock_unit (u); return ret; } @@ -286,7 +286,7 @@ PREFIX(ftell) (int * unit) *offset = -1; \ else \ { \ - *offset = stell (u->s); \ + *offset = stell (u->s) + fbuf_reset (u); \ unlock_unit (u); \ } \ } |