On Thursday 16 September 2010 at 01:22, tcurtis  wrote:

> Log:
> Use Parrot_str_to_cstring instead of strstart when passing prompt to 
> functions that expect C strings in FileHandle.readline_interactive.

> --- trunk/src/pmc/filehandle.pmc      Thu Sep 16 08:18:24 2010        (r49036)
> +++ trunk/src/pmc/filehandle.pmc      Thu Sep 16 08:22:52 2010        (r49037)

> @@ -383,8 +386,11 @@
>              free(r);
>          }
>  #else
> -        if (got_prompt)
> -            fprintf(stderr, "%s", prompt->strstart);
> +        if (got_prompt) {
> +            char *prompt_cstring = Parrot_str_to_cstring(INTERP, prompt);
> +            fprintf(stderr, "%s", prompt_cstring);

Parrot_io_eprintf() with a format of "%Ss" should work here without the 
conversion to a C string.

-- c
_______________________________________________
http://lists.parrot.org/mailman/listinfo/parrot-dev

Reply via email to