diff options
author | jvdelisle <jvdelisle@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-01-23 02:01:10 +0000 |
---|---|---|
committer | jvdelisle <jvdelisle@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-01-23 02:01:10 +0000 |
commit | a979676f973dde29426e6dc9e2cc2b8b98c05526 (patch) | |
tree | 256f68a04ba24948b248589c8686f27ea8f05fd4 /libgfortran/io/inquire.c | |
parent | f26dc717e5d3282feed1109ae80a32ab72198779 (diff) | |
download | gcc-a979676f973dde29426e6dc9e2cc2b8b98c05526.tar.gz |
2015-01-22 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR libgfortran/61933
* io/inquire.c (inquire_via_unit): Set existing to true for
any negative unit that is currently connected and any positive
units within range of KIND=4 value. The unit value for any out
of range case that may occur if the user is using a KIND=8 will
have been set to -2 which is reserved and can never be opened,
and therefore the unit does not exist.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@220024 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgfortran/io/inquire.c')
-rw-r--r-- | libgfortran/io/inquire.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libgfortran/io/inquire.c b/libgfortran/io/inquire.c index 21367a6d83f..a5f362e0f20 100644 --- a/libgfortran/io/inquire.c +++ b/libgfortran/io/inquire.c @@ -41,11 +41,11 @@ inquire_via_unit (st_parameter_inquire *iqp, gfc_unit * u) const char *p; GFC_INTEGER_4 cf = iqp->common.flags; - if (iqp->common.unit == -1) + if (iqp->common.unit == GFC_INTERNAL_UNIT) generate_error (&iqp->common, LIBERROR_INQUIRE_INTERNAL_UNIT, NULL); if ((cf & IOPARM_INQUIRE_HAS_EXIST) != 0) - *iqp->exist = (u != NULL); + *iqp->exist = (u != NULL) || (iqp->common.unit >= 0); if ((cf & IOPARM_INQUIRE_HAS_OPENED) != 0) *iqp->opened = (u != NULL); |