diff --git a/ChangeLog b/ChangeLog index 5f7ac5767b..4098c468bc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Fri Apr 29 10:24:51 2011 Nobuyoshi Nakada + + * io.c (make_writeconv): do not add textmode newline decorator if any + newline decorator is set already. fixes #4618, fixes #4619 + Fri Apr 29 10:17:42 2011 KOSAKI Motohiro * thread.c (lock_func): small cleanup. diff --git a/io.c b/io.c index 328abc7ea8..b479f33cd5 100644 --- a/io.c +++ b/io.c @@ -789,7 +789,8 @@ make_writeconv(rb_io_t *fptr) ecflags = fptr->encs.ecflags; ecopts = fptr->encs.ecopts; #ifdef TEXTMODE_NEWLINE_DECORATOR_ON_WRITE - if (NEED_NEWLINE_DECORATOR_ON_WRITE(fptr)) + if (NEED_NEWLINE_DECORATOR_ON_WRITE(fptr) && + !(ecflags & ECONV_NEWLINE_DECORATOR_MASK)) ecflags |= TEXTMODE_NEWLINE_DECORATOR_ON_WRITE; #endif