Issue #8083 has been reported by rutsky (Vladimir Rutsky).

----------------------------------------
Bug #8083: Exit status is limited to one-byte values which is invalid for Windows
https://bugs.ruby-lang.org/issues/8083

Author: rutsky (Vladimir Rutsky)
Status: Open
Priority: Normal
Assignee: cruby-windows
Category: platform/windows
Target version: 
ruby -v: ruby 1.9.3p0 (2011-10-30) [i386-mingw32]


=begin
Windows uses 32-bit process exit codes so Ruby incorrectly truncates them to one byte:

 C:\Ruby193\bin>ruby -e "system('C:\windows\system32\cmd.exe /c exit 255'); puts $?.exitstatus"
 255

 C:\Ruby193\bin>ruby -e "system('C:\windows\system32\cmd.exe /c exit 256'); puts $?.exitstatus"
 0

 C:\Ruby193\bin>ruby -e "system('C:\windows\system32\cmd.exe /c exit 257'); puts $?.exitstatus"
 1


Similar code works correctly in Python:

 C:\Python27>python -c "import subprocess; print subprocess.call('C:\windows\system32\cmd.exe /c exit 255')"
 255

 C:\Python27>python -c "import subprocess; print subprocess.call('C:\windows\system32\cmd.exe /c exit 256')"
 256

 C:\Python27>python -c "import subprocess; print subprocess.call('C:\windows\system32\cmd.exe /c exit 257')"
 257
=end



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