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.
From-SVN: r220024
+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.
+
2015-01-14 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR libgfortran/61933
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);