mruby/mruby — pull request #2103 by titouanc (2014-04-21 14:47:27+00:00)
Title: Also set $0 for binary files

Also set `$0` for bytecode ruby files

Before this patch:

$ echo 'puts "$0=#{$0}"' > demo.rb && ./build/host/bin/mruby demo.rb
$0=demo.rb

$ ./build/host/bin/mrbc demo.rb && ./build/host/bin/mruby -b demo.mrb
$0=

$ ./build/host/bin/mruby -e 'puts "$0=#{$0}"'
$0=-e

After this patch:

$ echo 'puts "$0=#{$0}"' > demo.rb && ./build/host/bin/mruby demo.rb
$0=demo.rb

$ ./build/host/bin/mrbc demo.rb && ./build/host/bin/mruby -b demo.mrb
$0=demo.mrb

$ ./build/host/bin/mruby -e 'puts "$0=#{$0}"'
$0=-e