#760: readline_interactive method no longer returns PMCNULL on eof
---------------------+------------------------------------------------------
Reporter: flh | Owner: whiteknight
Type: patch | Status: new
Priority: blocker | Milestone:
Component: core | Version: trunk
Severity: release | Keywords:
Lang: tcl | Patch: rejected
Platform: all |
---------------------+------------------------------------------------------
Old description:
> Sending EOF to the standard input (typically: hitting Control-G) does not
> make HLLCompiler end interactive sessions when readline is used.
>
> To reproduce: take your favorite HLL written with HLLCompiler, and a
> Parrot with readline, and run it without any argument. This should start
> an interactive session (i.e., you get a prompt for the language), but
> hitting ^G makes HLLCompiler display a new prompt instead of exiting.
>
> This bug has two origins:
>
> * the "readline_interactive" method of FileHandle always returns a string
> (that's because of its type: when it seems to return NULL, it is actually
> converted to the empty string). On the other hand, HLLCompiler tests if
> the value returned by "readline_interactive" is null to detect EOF: this
> test is always false... The fix is to test EOF using the "get_bool"
> vtable of FileHandle; and
>
> * the method "readline_interactive" never sets the EOF flag when readline
> is activated.
>
> The attached patch fixes this.
New description:
Sending EOF to the standard input (typically: hitting Control-G) does not
make HLLCompiler end interactive sessions when readline is used.
To reproduce: take your favorite HLL written with HLLCompiler, and a
Parrot with readline, and run it without any argument. This should start
an interactive session (i.e., you get a prompt for the language), but
hitting {{{^G}}} makes HLLCompiler display a new prompt instead of
exiting.
This bug has two origins:
* the "readline_interactive" method of FileHandle always returns a string
(that's because of its type: when it seems to return NULL, it is actually
converted to the empty string). On the other hand, HLLCompiler tests if
the value returned by "readline_interactive" is null to detect EOF: this
test is always false... The fix is to test EOF using the "get_bool" vtable
of FileHandle; and
* the method "readline_interactive" never sets the EOF flag when readline
is activated.
The attached patch fixes this.
--
Comment(by coke):
fix formatting in desc.
--
Ticket URL: <https://trac.parrot.org/parrot/ticket/760#comment:11>
Parrot <https://trac.parrot.org/parrot/>
Parrot Development
_______________________________________________
parrot-tickets mailing list
[email protected]
http://lists.parrot.org/mailman/listinfo/parrot-tickets