summaryrefslogtreecommitdiff
path: root/ext/-test-/add_suffix/bug.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-07-29 22:59:54 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-07-29 22:59:54 +0000
commit7ae7ac4abab04f4351ae84f63f81b61a41843aff (patch)
treede41136ca6ffb27f28729ecaf219e4fdea2bfbe6 /ext/-test-/add_suffix/bug.c
parentbc8e65073588035b6d6d272be8c697a8dc27ee81 (diff)
* util.c (ruby_add_suffix): fixed a bug returning uninitialized
value. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28794 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/-test-/add_suffix/bug.c')
-rw-r--r--ext/-test-/add_suffix/bug.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/ext/-test-/add_suffix/bug.c b/ext/-test-/add_suffix/bug.c
new file mode 100644
index 0000000000..882832ed34
--- /dev/null
+++ b/ext/-test-/add_suffix/bug.c
@@ -0,0 +1,21 @@
+#include "ruby.h"
+#include "ruby/defines.h"
+#ifndef HAVE_RUBY_ADD_SUFFIX
+#define _WIN32 1
+#include "util.c"
+#endif
+
+static VALUE
+add_suffix(VALUE self, VALUE path, VALUE suffix)
+{
+ StringValueCStr(path);
+ ruby_add_suffix(path, StringValueCStr(suffix));
+ return path;
+}
+
+void
+Init_bug(void)
+{
+ VALUE mBug = rb_define_module("Bug");
+ rb_define_module_function(mBug, "add_suffix", add_suffix, 2);
+}