Backport #5793

Please backport r33662, r33666 (ECONV_NEWLINE_DECORATOR_{READ,WRITE}_MASK)

Added by Jon Forums over 2 years ago. Updated about 2 years ago.

[ruby-core:41780]
Status:Closed
Priority:Normal
Assignee:Luis Lavena

Description

Please backport r33662 and it's fixup r33666 to ruby19_3.

Associated revisions

Revision 34542
Added by Yui NARUSE about 2 years ago

merge revision(s) 33662,33666,33770: [Backport #5793]

r33662 | usa | 2011-11-08 02:48:11 +0900 (Tue, 08 Nov 2011) | 18 lines

  • include/ruby/encoding.h (ECONVNEWLINEDECORATORREADMASK,
    ECONVNEWLINEDECORATORWRITEMASK): new macro.

  • io.c (rbioextractmodeenc, pipeopen, prepstdio, argfnextargv):
    set TEXTMODE
    NEWLINEDECORATORON_WRITE for textmode on creating IO
    if the flag is available.

  • io.c (make_writeconv): drop decorators for reading.

  • io.c (make_readconv): drop decorators for writing.

  • io.c (do_writeconv): existing writeconv is not the condition to raise
    ArgumentError. should check textmode or not.

  • test/ruby/testiom17n.rb
    (TestIOM17N#test{cr,lf,crlf}decoratoron_stdout): test above
    changes.


* include/ruby/encoding.h (ECONV_NEWLINE_DECORATOR_READ_MASK,
  ECONV_NEWLINE_DECORATOR_WRITE_MASK): new macro.

* io.c (rb_io_extract_modeenc, pipe_open, prep_stdio, argf_next_argv):
  set TEXTMODE_NEWLINE_DECORATOR_ON_WRITE for textmode on creating IO
  if the flag is available.

* io.c (make_writeconv): drop decorators for reading.

* io.c (make_readconv): drop decorators for writing.

* io.c (do_writeconv): existing writeconv is not the condition to raise
  ArgumentError.  should check textmode or not.

* test/ruby/test_io_m17n.rb
  (TestIO_M17N#test_{cr,lf,crlf}_decorator_on_stdout): test above
  changes.

* io.c (argf_next_argv): wrong timing of setting ecflags.
  fixed the failure of TestArgf#test_textmode introduced at r33662.

History

#1 Updated by Jon Forums over 2 years ago

FYI, a pre-backported version is being maintained on https://github.com/thecodeshop/ruby/commits/winio/ruby_1_9_3/

#2 Updated by Motohiro KOSAKI over 2 years ago

Maybe, a following commit should be backported too.


r33770 | usa | 2011-11-15 21:36:08 -0500 (Tue, 15 Nov 2011) | 3 lines

  • io.c (argfnextargv): wrong timing of setting ecflags. fixed the failure of TestArgf#test_textmode introduced at r33662.

#3 Updated by Motohiro KOSAKI over 2 years ago

  • Subject changed from Please backport r33662, r33666 to Please backport r33662, r33666 (ECONV_NEWLINE_DECORATOR_{READ,WRITE}_MASK)

#4 Updated by Jon Forums over 2 years ago

Motohiro KOSAKI wrote:

Maybe, a following commit should be backported too.


r33770 | usa | 2011-11-15 21:36:08 -0500 (Tue, 15 Nov 2011) | 3 lines

  • io.c (argfnextargv): wrong timing of setting ecflags. fixed the failure of TestArgf#test_textmode introduced at r33662.

Yes; it's already part of our winio/ruby_1_9_3 branch:

https://github.com/thecodeshop/ruby/compare/ruby_1_9_3...winio/ruby_1_9_3

#5 Updated by Luis Lavena over 2 years ago

  • Assignee set to Luis Lavena

If nobody objects I'll backport this next week (wednesday tops)

#6 Updated by Yui NARUSE about 2 years ago

Luis Lavena wrote:

If nobody objects I'll backport this next week (wednesday tops)

Why don't you backport?

#7 Updated by Luis Lavena about 2 years ago

Have too much work on my plate and traveling. Hiroshi is the author,
perhaps he can apply them directly?

Sorry for top posting. Sent from mobile.
On Feb 10, 2012 2:20 PM, "Yui NARUSE" naruse@airemix.jp wrote:

Issue #5793 has been updated by Yui NARUSE.

Luis Lavena wrote:

If nobody objects I'll backport this next week (wednesday tops)

Why don't you backport?

Backport #5793: Please backport r33662, r33666
(ECONVNEWLINEDECORATOR{READ,WRITE}MASK)
https://bugs.ruby-lang.org/issues/5793

Author: Jon Forums
Status: Open
Priority: Normal
Assignee: Luis Lavena
Category:
Target version:

Please backport r33662 and it's fixup r33666 to ruby19_3.

http://bugs.ruby-lang.org/

#8 Updated by Yui NARUSE about 2 years ago

  • Status changed from Open to Closed
  • % Done changed from 0 to 100

This issue was solved with changeset r34542.
Jon, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.


merge revision(s) 33662,33666,33770: [Backport #5793]

r33662 | usa | 2011-11-08 02:48:11 +0900 (Tue, 08 Nov 2011) | 18 lines

  • include/ruby/encoding.h (ECONVNEWLINEDECORATORREADMASK,
    ECONVNEWLINEDECORATORWRITEMASK): new macro.

  • io.c (rbioextractmodeenc, pipeopen, prepstdio, argfnextargv):
    set TEXTMODE
    NEWLINEDECORATORON_WRITE for textmode on creating IO
    if the flag is available.

  • io.c (make_writeconv): drop decorators for reading.

  • io.c (make_readconv): drop decorators for writing.

  • io.c (do_writeconv): existing writeconv is not the condition to raise
    ArgumentError. should check textmode or not.

  • test/ruby/testiom17n.rb
    (TestIOM17N#test{cr,lf,crlf}decoratoron_stdout): test above
    changes.


* include/ruby/encoding.h (ECONV_NEWLINE_DECORATOR_READ_MASK,
  ECONV_NEWLINE_DECORATOR_WRITE_MASK): new macro.

* io.c (rb_io_extract_modeenc, pipe_open, prep_stdio, argf_next_argv):
  set TEXTMODE_NEWLINE_DECORATOR_ON_WRITE for textmode on creating IO
  if the flag is available.

* io.c (make_writeconv): drop decorators for reading.

* io.c (make_readconv): drop decorators for writing.

* io.c (do_writeconv): existing writeconv is not the condition to raise
  ArgumentError.  should check textmode or not.

* test/ruby/test_io_m17n.rb
  (TestIO_M17N#test_{cr,lf,crlf}_decorator_on_stdout): test above
  changes.

* io.c (argf_next_argv): wrong timing of setting ecflags.
  fixed the failure of TestArgf#test_textmode introduced at r33662.

Also available in: Atom PDF