re PR fortran/69043 (Trying to include a directory causes an infinite loop)
authorJerry DeLisle <jvdelisle@gcc.gnu.org>
Sat, 19 Mar 2016 20:28:38 +0000 (20:28 +0000)
committerJerry DeLisle <jvdelisle@gcc.gnu.org>
Sat, 19 Mar 2016 20:28:38 +0000 (20:28 +0000)
2016-03-19  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

PR fortran/69043
* scanner.c (load_file): Update to use S_ISREG macro.

From-SVN: r234352

gcc/fortran/ChangeLog
gcc/fortran/scanner.c

index 105e7b4e680d37d9a8259dbd8d6521de4e0cb1ff..dac67d1fc845c88d9870aa52c735a65b5bc01b38 100644 (file)
@@ -1,3 +1,8 @@
+2016-03-19  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR fortran/69043
+       * scanner.c (load_file): Update to use S_ISREG macro.
+
 2016-03-17  Thomas Schwinge  <thomas@codesourcery.com>
 
        * gfortran.h (enum gfc_omp_map_op): Rename OMP_MAP_FORCE_DEALLOC
index 33d96d88d922ca5b06f67cb0f5b8841efcc27ccd..f4dedd69757a0da13af67ac81934a1cbd7721d69 100644 (file)
@@ -2246,7 +2246,7 @@ load_file (const char *realfilename, const char *displayedname, bool initial)
          return false;
        }
       stat_result = stat (realfilename, &st);
-      if (stat_result == 0 && !(st.st_mode & S_IFREG))
+      if (stat_result == 0 && !S_ISREG(st.st_mode))
        {
          fprintf (stderr, "%s:%d: Error: Included path '%s'"
                   " is not a regular file\n",