diff --git a/ChangeLog b/ChangeLog index b8b9b02ed0..c3fa00b460 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +Fri Jul 13 22:26:09 2001 Akinori MUSHA + + * lib/mkmf.rb: use File::split to split a target into a prefix and + a module name. This also works around a just found bug of + String#rindex. + + * ext/extmk.rb.in: ditto. + Thu Jul 12 15:11:48 2001 WATANABE Hirofumi * ext/socket/socket.c (ruby_connect): workaround for the setup of diff --git a/ext/extmk.rb.in b/ext/extmk.rb.in index 941d9d5dab..adbc350b80 100644 --- a/ext/extmk.rb.in +++ b/ext/extmk.rb.in @@ -362,9 +362,9 @@ end def create_makefile(target) $target = target - if target.rindex(%r!/!) - target = $' - target_prefix = "/"+$` + if target.include?('/') + target_prefix, target = File.split(target) + target_prefix[0,0] = '/' else target_prefix = "" end diff --git a/lib/mkmf.rb b/lib/mkmf.rb index fec789e4e8..e28cd49869 100644 --- a/lib/mkmf.rb +++ b/lib/mkmf.rb @@ -367,9 +367,9 @@ def create_makefile(target, srcdir = File.dirname($0)) print "creating Makefile\n" rm_f "conftest*" STDOUT.flush - if target.rindex(%r!/!) #/ - target = $' - target_prefix = "/"+$` + if target.include?('/') + target_prefix, target = File.split(target) + target_prefix[0,0] = '/' else target_prefix = "" end