зеркало из https://github.com/github/ruby.git
* 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:
Родитель
c9ed212b9e
Коммит
697a45b196
|
@ -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;
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
void Init_dot(void) {}
|
|
@ -0,0 +1 @@
|
|||
create_makefile("-test-/load/dot.dot/dot.dot")
|
|
@ -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
|
Загрузка…
Ссылка в новой задаче