]> granicus.if.org Git - fcron/commitdiff
fcrondyn with readline no longer crashes when receiving EOF
authorThibault Godouet <fcron@free.fr>
Sun, 13 Apr 2014 17:57:10 +0000 (18:57 +0100)
committerThibault Godouet <fcron@free.fr>
Sun, 13 Apr 2014 17:58:18 +0000 (18:58 +0100)
doc/en/changes.sgml
fcrondyn.c

index 8750ddb5ac12e38c6deb1548e34753bc4f862e1a..f22892e0bc81051ec245d62e931ba552846d403b 100644 (file)
@@ -26,6 +26,9 @@ A copy of the license is included in gfdl.sgml.
            <listitem>
               <para>Fixed minor bug in fcronsighup resulting in log errors about closing the signal file</para>
            </listitem>
+           <listitem>
+              <para>fcrondyn no longer crashes when receiving an EOF when using readline (thanks Wade Carpenter for the patch)</para>
+           </listitem>
       </itemizedlist>
 
       <itemizedlist>
index 294768f6297bc7c19d17d6fb9e6ce4a4bbd89779..c4140a104099238a4479a51c65787b7232563972 100644 (file)
@@ -695,6 +695,13 @@ interactive_mode(int fd)
 
     while (1) {
         line_read = readline("fcrondyn> ");
+
+        if (line_read == NULL) {
+            /* Handle EOF gracefully and move past the prompt line */
+            printf("\n");
+            break;
+        }
+
         return_code = talk_fcron(line_read, fd);
 
 #ifdef HAVE_READLINE_HISTORY