mattn/mruby-require

Strange behaviour on Windows

pbosetti opened this issue · 1 comments

Hi,
on my fork, I notice a trance behaviour on Windows. When I compile a .mrb file and then require (or load it), if the original source .rb file contains a function, whose name has exactly 10 characters (regardless the actual string), then loading the file has no effect, and no error is raised.

Note that this only happens on Windows. Mac and Linux do not present this issue. Additionally, if I run the same compiled .mrb compiled script with the standard mruby interpreter I get the correct behaviour. Can you replicate this?

Steps to replicate:

  1. create a test.rb script which defines the function def abcdefghij(); end
  2. compile it with mrbc
  3. launch the mirb interactive interpreter and load "./test.mrb"
  4. test for existence of abcdefghij(): you should get an undefined method error.

More or less character in the function name do work. Exactly 10 characters and it doesn't.

I tried this on latest mruby&mruby-requrie.

But I can't reproduce it.

test.rb

def abcdefghij(); puts"foo"; end
C:\dev\mruby>bin\mrbc test.rb

t.rb

#! .\bin\mruby

load "./test.mrb"

abcdefghij
C:\dev\mruby>bin\mruby t.rb
foo