summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1998-09-08 09:17:55 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1998-09-08 09:17:55 +0000
commitb0e1436164e4004f048bac4babc220e0deccb4f9 (patch)
tree1e46ec5aa4b12c076ba9c535ff889a49b9a7b3c1 /ext
parent48acbc5e03622f1eb0423a6c2a3a603f61acfac6 (diff)
1.1c5
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/v1_1r@300 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext')
-rw-r--r--ext/extmk.rb.in24
-rw-r--r--ext/kconv/kconv.c9
2 files changed, 27 insertions, 6 deletions
diff --git a/ext/extmk.rb.in b/ext/extmk.rb.in
index 0c32954577..e0f16e116c 100644
--- a/ext/extmk.rb.in
+++ b/ext/extmk.rb.in
@@ -93,6 +93,24 @@ def try_cpp
xsystem(format(CPP, $CFLAGS))
end
+def install_rb(mfile)
+ path = []
+ dir = []
+ Find.find("lib") do |f|
+ next unless /\.rb$/ =~ f
+ f = f[4..-1]
+ path.push f
+ dir |= File.dirname(f)
+ end
+ for f in dir
+ next if f == "."
+ mfile.printf "\t@test -d $(libdir)/%s || mkdir $(libdir)/%s\n", f, f
+ end
+ for f in path
+ mfile.printf "\t$(INSTALL_DATA) %s $(libdir)/%s\n", f, f
+ end
+end
+
def have_library(lib, func)
if $lib_cache[lib]
if $lib_cache[lib] == "yes"
@@ -304,16 +322,14 @@ realclean: clean
mfile.printf "\
install:
+ @test -d $(libdir) || mkdir $(libdir)
"
if !$static
mfile.printf "\
- @test -d $(libdir) || mkdir $(libdir)
$(INSTALL) $(TARGET) $(libdir)/$(TARGET)
"
end
- for rb in Dir["lib/*.rb"]
- mfile.printf "\t$(INSTALL_DATA) %s @libdir@/$(RUBY_INSTALL_NAME)\n", rb
- end
+ install_rb(mfile)
mfile.printf "\n"
if !$static && "@DLEXT@" != "o"
diff --git a/ext/kconv/kconv.c b/ext/kconv/kconv.c
index fb229c6ef6..0cb9b10a0b 100644
--- a/ext/kconv/kconv.c
+++ b/ext/kconv/kconv.c
@@ -1891,10 +1891,15 @@ static VALUE
kconv_guess(obj, src)
VALUE obj, src;
{
- unsigned char *p = RSTRING(src)->ptr;
- unsigned char *pend = p + RSTRING(src)->len;
+ unsigned char *p;
+ unsigned char *pend;
int sequence_counter = 0;
+ Check_Type(src, T_STRING);
+
+ p = RSTRING(src)->ptr;
+ pend = p + RSTRING(src)->len;
+
#define INCR do {\
p++;\
if (p==pend) return INT2FIX(_UNKNOWN);\