mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* 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
This commit is contained in:
parent
bc8e650735
commit
7ae7ac4aba
7 changed files with 91 additions and 6 deletions
21
ext/-test-/add_suffix/bug.c
Normal file
21
ext/-test-/add_suffix/bug.c
Normal file
|
|
@ -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);
|
||||
}
|
||||
1
ext/-test-/add_suffix/depend
Normal file
1
ext/-test-/add_suffix/depend
Normal file
|
|
@ -0,0 +1 @@
|
|||
bug.o: $(hdrdir)/ruby/util.h $(top_srcdir)/util.c
|
||||
4
ext/-test-/add_suffix/extconf.rb
Normal file
4
ext/-test-/add_suffix/extconf.rb
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
unless have_func("ruby_add_suffix", "ruby/util.h")
|
||||
$INCFLAGS << " -I$(top_srcdir)"
|
||||
end
|
||||
create_makefile("-test-/add_suffix/bug")
|
||||
Loading…
Add table
Add a link
Reference in a new issue