http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60286
Tobias Burnus <burnus at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |wrong-code
CC| |burnus at gcc dot gnu.org,
| |jvdelisle at gcc dot gnu.org
--- Comment #2 from Tobias Burnus <burnus at gcc dot gnu.org> ---
Something like this should do.
(Requires more updates in the file, e.g. also for READ=, READWRITE= - and for
the "YES" / yes cleanup.)
--- a/libgfortran/io/inquire.c
+++ b/libgfortran/io/inquire.c
@@ -33 +33 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not,
see
-static const char undefined[] = "UNDEFINED";
+static const char yes[] = "YES", no[] = "NO", undefined[] = "UNDEFINED";
@@ -133 +133 @@ inquire_via_unit (st_parameter_inquire *iqp, gfc_unit * u)
- p = "NO";
+ p = no;
@@ -136 +136 @@ inquire_via_unit (st_parameter_inquire *iqp, gfc_unit * u)
- p = "YES";
+ p = yes;
@@ -510 +510,7 @@ inquire_via_unit (st_parameter_inquire *iqp, gfc_unit * u)
- p = (u == NULL) ? inquire_write (NULL, 0) :
+ if (u && u->unit_number == options.stdin_unit)
+ p = no;
+ else if (u
+ && (u->unit_number == options.stdout_unit
+ || u->unit_number == options.stderr_unit))
+ p = yes;
+ else if (u)
@@ -511,0 +518,2 @@ inquire_via_unit (st_parameter_inquire *iqp, gfc_unit * u)
+ else
+ inquire_write (NULL, 0) :