[svn:parrot] r39575 - trunk/src/pmc

NotFound at svn.parrot.org NotFound at svn.parrot.org
Mon Jun 15 21:30:42 UTC 2009


Author: NotFound
Date: Mon Jun 15 21:30:40 2009
New Revision: 39575
URL: https://trac.parrot.org/parrot/changeset/39575

Log:
[io] restore behaviour of readline_interactive, TT #760

Modified:
   trunk/src/pmc/filehandle.pmc

Modified: trunk/src/pmc/filehandle.pmc
==============================================================================
--- trunk/src/pmc/filehandle.pmc	Mon Jun 15 21:27:33 2009	(r39574)
+++ trunk/src/pmc/filehandle.pmc	Mon Jun 15 21:30:40 2009	(r39575)
@@ -359,7 +359,7 @@
     METHOD readline_interactive(STRING *prompt :optional, INTVAL got_prompt :opt_flag) {
         STRING *string_result = NULL;
 #ifdef PARROT_HAS_READLINE
-    char * const r = readline(got_prompt ? prompt->strstart : NULL);
+        char * const r = readline(got_prompt ? prompt->strstart : NULL);
 
         if (r) {
             if (*r)
@@ -391,7 +391,10 @@
             }
         }
 #endif
-        RETURN(STRING *string_result);
+        if (string_result)
+            RETURN(STRING *string_result);
+        else
+            RETURN(PMC *PMCNULL);
     }
 
 /*


More information about the parrot-commits mailing list