2013-01-21 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/55919
* scanner.c (add_path_to_list): Copy path to temporary and strip
trailing directory separators before calling stat().
2013-01-21 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/55919
* gfortran.dg/include_8.f90: New test.
From-SVN: r195348
+2013-01-21 Thomas Koenig <tkoenig@gcc.gnu.org>
+
+ PR fortran/55919
+ * gfortran.dg/include_8.f90: New test.
+
2013-01-17 Richard Biener <rguenther@suse.de>
* trans-stmt.c (gfc_trans_do): Conditionally compute countm1
{
gfc_directorylist *dir;
const char *p;
+ char *q;
struct stat st;
+ size_t len;
+ int i;
p = path;
while (*p == ' ' || *p == '\t') /* someone might do "-I include" */
if (*p++ == '\0')
return;
- if (stat (p, &st))
+ /* Strip trailing directory separators from the path, as this
+ will confuse Windows systems. */
+ len = strlen (p);
+ q = (char *) alloca (len + 1);
+ memcpy (q, p, len + 1);
+ i = len - 1;
+ while (i >=0 && IS_DIR_SEPARATOR(q[i]))
+ q[i--] = '\0';
+
+ if (stat (q, &st))
{
if (errno != ENOENT)
gfc_warning_now ("Include directory \"%s\": %s", path,
+2013-01-21 Thomas Koenig <tkoenig@gcc.gnu.org>
+
+ PR fortran/55919
+ * add_path_to_list: Copy path to temporary and strip
+ trailing directory separators before calling stat().
+
2012-01-21 Uros Bizjak <ubizjak@gmail.com>
* gcc.dg/tree-ssa/pr55579.c: Cleanup esra tree dump.
--- /dev/null
+! { dg-do compile }
+! { dg-options "-J./" }
+! PR 55919 - a trailing dir separator would cause a warning
+! on Windows.
+program main
+end program main