stdout-rouge-fix.patch 719 B

1234567891011121314151617181920212223242526272829303132333435
  1. diff --git a/lib/mkmf.rb b/lib/mkmf.rb
  2. index c9e738a..7a8004d 100644
  3. --- a/lib/mkmf.rb
  4. +++ b/lib/mkmf.rb
  5. @@ -201,20 +201,26 @@ end
  6. module Logging
  7. @log = nil
  8. @logfile = 'mkmf.log'
  9. - @orgerr = $stderr.dup
  10. - @orgout = $stdout.dup
  11. @postpone = 0
  12. @quiet = $extmk
  13. def self::open
  14. @log ||= File::open(@logfile, 'w')
  15. @log.sync = true
  16. + orgerr = $stderr.dup
  17. + orgout = $stdout.dup
  18. $stderr.reopen(@log)
  19. $stdout.reopen(@log)
  20. yield
  21. ensure
  22. - $stderr.reopen(@orgerr)
  23. - $stdout.reopen(@orgout)
  24. + if orgerr
  25. + $stderr.reopen(orgerr)
  26. + orgerr.close
  27. + end
  28. + if orgout
  29. + $stdout.reopen(orgout)
  30. + orgout.close
  31. + end
  32. end
  33. def self::message(*s)