aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-01-05 20:03:28 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-01-05 20:03:28 +0000
commit697a45b196c606147997372c20d14c6b2eccdda4 (patch)
tree48a14a6bc772db3577eb20287967b22901c06754
parentc9ed212b9e74f71fb3137c72c80e37088de59c95 (diff)
downloadruby-697a45b196c606147997372c20d14c6b2eccdda4.tar.gz
* 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
-rw-r--r--ChangeLog5
-rw-r--r--dln.c6
-rw-r--r--ext/-test-/load/dot.dot/dot.dot.c1
-rw-r--r--ext/-test-/load/dot.dot/extconf.rb1
-rw-r--r--test/-ext-/load/test_dot_dot.rb10
5 files changed, 20 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index d9aa1d485b..0eede3f343 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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
diff --git a/dln.c b/dln.c
index 9267f1159b..961592d7b0 100644
--- a/dln.c
+++ b/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;
diff --git a/ext/-test-/load/dot.dot/dot.dot.c b/ext/-test-/load/dot.dot/dot.dot.c
new file mode 100644
index 0000000000..936d28931a
--- /dev/null
+++ b/ext/-test-/load/dot.dot/dot.dot.c
@@ -0,0 +1 @@
+void Init_dot(void) {}
diff --git a/ext/-test-/load/dot.dot/extconf.rb b/ext/-test-/load/dot.dot/extconf.rb
new file mode 100644
index 0000000000..6287db6bd8
--- /dev/null
+++ b/ext/-test-/load/dot.dot/extconf.rb
@@ -0,0 +1 @@
+create_makefile("-test-/load/dot.dot/dot.dot")
diff --git a/test/-ext-/load/test_dot_dot.rb b/test/-ext-/load/test_dot_dot.rb
new file mode 100644
index 0000000000..82aa10a95f
--- /dev/null
+++ b/test/-ext-/load/test_dot_dot.rb
@@ -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