Guest User

multi-char rec-sep GH #812

a guest
Aug 15th, 2012
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.70 KB | None | 0 0
  1. diff --git a/src/io/api.c b/src/io/api.c
  2. index 2778c56..5fd825a 100644
  3. --- a/src/io/api.c
  4. +++ b/src/io/api.c
  5. @@ -905,7 +905,13 @@ STRING *
  6.  Parrot_io_readline(PARROT_INTERP, ARGMOD(PMC *handle))
  7.  {
  8.      ASSERT_ARGS(Parrot_io_readline)
  9. -    return Parrot_io_readline_s(interp, handle, STRINGNULL);
  10. +
  11. +    PMC * const attr_value = VTABLE_get_attr_str(interp,
  12. +                    handle, Parrot_str_new_constant(interp, "record_separator"));
  13. +    STRING * const terminator =  (PMC_IS_NULL(attr_value) ? CONST_STRING(interp, "\n")
  14. +                                        : VTABLE_get_string(interp, attr_value));
  15. +
  16. +    return Parrot_io_readline_s(interp, handle, terminator);
  17.  }
  18.  
  19.  PARROT_EXPORT
Advertisement
Add Comment
Please, Sign In to add comment