I committed the patch below as obvious. Together with my recent patch
for PR 48931 this should fix PR 49214.

Index: libgfortran/runtime/backtrace.c
===================================================================
--- libgfortran/runtime/backtrace.c     (revision 174394)
+++ libgfortran/runtime/backtrace.c     (working copy)
@@ -95,6 +95,8 @@ fd_gets (char *s, int size, int fd)
       else
        {
          s[i] = '\0';
+         if (i == 0)
+           return NULL;
          break;
        }
     }
Index: libgfortran/ChangeLog
===================================================================
--- libgfortran/ChangeLog       (revision 174394)
+++ libgfortran/ChangeLog       (working copy)
@@ -1,5 +1,10 @@
 2011-05-29  Janne Blomqvist  <j...@gcc.gnu.org>

+       PR libfortran/49214
+       * runtime/backtrace.c (fd_gets): Return NULL if nothing was read.
+
+2011-05-29  Janne Blomqvist  <j...@gcc.gnu.org>
+
        PR libfortran/19155
        * io/read.c (convert_real): Check for invalid input by comparing
        endptr instead of EINVAL.


-- 
Janne Blomqvist

Reply via email to