From: Jerry DeLisle Date: Sat, 14 Aug 2010 18:59:18 +0000 (+0000) Subject: re PR fortran/44931 (For INPUT_UNIT, INQUIRE NAME= should not return "stdin") X-Git-Tag: releases/gcc-4.6.0~5009 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c613801e8b1f69feb2019d84f4a8e9d47bc403a6;p=thirdparty%2Fgcc.git re PR fortran/44931 (For INPUT_UNIT, INQUIRE NAME= should not return "stdin") 2010-08-14 Jerry DeLisle 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 --- diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog index 6e0ec80714f4..9f767975ac36 100644 --- a/libgfortran/ChangeLog +++ b/libgfortran/ChangeLog @@ -1,3 +1,9 @@ +2010-08-14 Jerry DeLisle + + PR libfortran/44931 + * io/inquire.c (inquire_via_unit): Add special case for __MINGW32__ to + return special file names CONIN$, CONOUT$, and CONERR$. + 2010-08-07 Jerry DeLisle PR libfortran/45143 diff --git a/libgfortran/io/inquire.c b/libgfortran/io/inquire.c index 540fecb2c5b4..c4994ed179a2 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)