mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* dln.c (init_funcname_len): ignore rest from first dot.
[ruby-dev:41774] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30464 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
c9ed212b9e
commit
697a45b196
5 changed files with 20 additions and 3 deletions
|
@ -1,3 +1,8 @@
|
|||
Thu Jan 6 05:03:26 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* dln.c (init_funcname_len): ignore rest from first dot.
|
||||
[ruby-dev:41774]
|
||||
|
||||
Thu Jan 6 02:55:48 2011 Aaron Patterson <aaron@tenderlovemaking.com>
|
||||
|
||||
* ext/psych/lib/psych/visitors/yaml_tree.rb: use YAML 1.0 output
|
||||
|
|
6
dln.c
6
dln.c
|
@ -126,12 +126,12 @@ init_funcname_len(const char **file)
|
|||
|
||||
/* Load the file as an object one */
|
||||
for (base = p; *p; p++) { /* Find position of last '/' */
|
||||
if (*p == '.') dot = p;
|
||||
if (isdirsep(*p)) base = p+1;
|
||||
if (*p == '.' && !dot) dot = p;
|
||||
if (isdirsep(*p)) base = p+1, dot = NULL;
|
||||
}
|
||||
*file = base;
|
||||
/* Delete suffix if it exists */
|
||||
return (dot && dot > base ? dot : p) - base;
|
||||
return (dot ? dot : p) - base;
|
||||
}
|
||||
|
||||
static const char funcname_prefix[sizeof(FUNCNAME_PREFIX) - 1] = FUNCNAME_PREFIX;
|
||||
|
|
1
ext/-test-/load/dot.dot/dot.dot.c
Normal file
1
ext/-test-/load/dot.dot/dot.dot.c
Normal file
|
@ -0,0 +1 @@
|
|||
void Init_dot(void) {}
|
1
ext/-test-/load/dot.dot/extconf.rb
Normal file
1
ext/-test-/load/dot.dot/extconf.rb
Normal file
|
@ -0,0 +1 @@
|
|||
create_makefile("-test-/load/dot.dot/dot.dot")
|
10
test/-ext-/load/test_dot_dot.rb
Normal file
10
test/-ext-/load/test_dot_dot.rb
Normal file
|
@ -0,0 +1,10 @@
|
|||
require 'test/unit'
|
||||
|
||||
class Test_DotDot < Test::Unit::TestCase
|
||||
def test_load_dot_dot
|
||||
feature = '[ruby-dev:41774]'
|
||||
assert_nothing_raised(LoadError, feature) {
|
||||
require '-test-/load/dot.dot/dot.dot'
|
||||
}
|
||||
end
|
||||
end
|
Loading…
Reference in a new issue