diff options
author | Jerry DeLisle <jvdelisle@gcc.gnu.org> | 2010-08-14 18:59:18 +0000 |
---|---|---|
committer | Jerry DeLisle <jvdelisle@gcc.gnu.org> | 2010-08-14 18:59:18 +0000 |
commit | c613801e8b1f69feb2019d84f4a8e9d47bc403a6 (patch) | |
tree | 15b9b4aa7c9cabda8ad1628f6f1c95a9b5ea767f /libgfortran/io/inquire.c | |
parent | 41f3efb58dd7e9b6ad1ff4e7021e7585385ab3f8 (diff) | |
download | gcc-c613801e8b1f69feb2019d84f4a8e9d47bc403a6.zip gcc-c613801e8b1f69feb2019d84f4a8e9d47bc403a6.tar.gz gcc-c613801e8b1f69feb2019d84f4a8e9d47bc403a6.tar.bz2 |
re PR fortran/44931 (For INPUT_UNIT, INQUIRE NAME= should not return "stdin")
2010-08-14 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR libfortran/44931
* io/inquire.c (inquire_via_unit): Add special case for __MINGW32__ to
return special file names CONIN$, CONOUT$, and CONERR$.
From-SVN: r163245
Diffstat (limited to 'libgfortran/io/inquire.c')
-rw-r--r-- | libgfortran/io/inquire.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/libgfortran/io/inquire.c b/libgfortran/io/inquire.c index 540fecb..c4994ed 100644 --- a/libgfortran/io/inquire.c +++ b/libgfortran/io/inquire.c @@ -83,8 +83,19 @@ inquire_via_unit (st_parameter_inquire *iqp, gfc_unit * u) fstrcpy (iqp->name, iqp->name_len, u->file, u->file_len); } else -#endif fstrcpy (iqp->name, iqp->name_len, u->file, u->file_len); +#elif defined __MINGW32__ + if (u->unit_number == options.stdin_unit) + fstrcpy (iqp->name, iqp->name_len, "CONIN$", sizeof("CONIN$")); + else if (u->unit_number == options.stdout_unit) + fstrcpy (iqp->name, iqp->name_len, "CONOUT$", sizeof("CONOUT$")); + else if (u->unit_number == options.stderr_unit) + fstrcpy (iqp->name, iqp->name_len, "CONERR$", sizeof("CONERR$")); + else + fstrcpy (iqp->name, iqp->name_len, u->file, u->file_len); +#else + fstrcpy (iqp->name, iqp->name_len, u->file, u->file_len); +#endif } if ((cf & IOPARM_INQUIRE_HAS_ACCESS) != 0) |