Index: src/main/ruby/irb/hirb.rb =================================================================== --- src/main/ruby/irb/hirb.rb (revision 1094084) +++ src/main/ruby/irb/hirb.rb (working copy) @@ -17,8 +17,20 @@ # See the License for the specific language governing permissions and # limitations under the License. # +require 'rbconfig' module IRB + WINDOZE = Config::CONFIG['host_os'] =~ /mswin|mingw/ + #Map the '/dev/null' according to the runing platform + #Under Windows platform the 'dev/null' is not fully compliant with unix, and the 'NUL' object need to be use instead. + if WINDOZE + then + DEV_NULL = "NUL" + else + #Unix like + DEV_NULL = "/dev/null" + end + # Subclass of IRB so can intercept methods class HIRB < Irb def initialize