Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Tag for 1.8.7.

git-svn-id: http://svn.ruby-lang.org/repos/ruby/tags/v1_8_7@16730 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information...
commit 63055294bfa69855507e71143a1820bfdee3774b 1 parent 5b792fe
@knu knu authored
Showing with 630 additions and 315 deletions.
  1. +111 −0 ChangeLog
  2. +31 −1 NEWS
  3. +4 −0 README
  4. +5 −0 README.EXT
  5. +6 −0 README.EXT.ja
  6. +4 −0 README.ja
  7. +13 −4 array.c
  8. +4 −0 bcc32/Makefile.sub
  9. +22 −0 configure.in
  10. +1 −1  dir.c
  11. +52 −31 enum.c
  12. +6 −7 error.c
  13. +29 −29 eval.c
  14. +1 −1  ext/openssl/ossl_bn.c
  15. +3 −3 ext/openssl/ossl_pkey_dh.c
  16. +1 −1  ext/openssl/ossl_pkey_dsa.c
  17. +10 −6 ext/openssl/ossl_rand.c
  18. +1 −1  ext/openssl/ossl_x509store.c
  19. +8 −1 ext/purelib.rb
  20. +6 −4 ext/tk/sample/demos-en/toolbar.rb
  21. +3 −3 ext/tk/sample/demos-en/ttkprogress.rb
  22. +36 −32 ext/tk/sample/demos-en/widget
  23. +35 −32 ext/tk/sample/demos-jp/widget
  24. +2 −2 ext/zlib/extconf.rb
  25. +1 −1  file.c
  26. +4 −2 instruby.rb
  27. +1 −1  intern.h
  28. +15 −14 io.c
  29. +1 −1  keywords
  30. +1 −1  lex.c
  31. +13 −0 lib/mkmf.rb
  32. +31 −31 lib/singleton.rb
  33. +4 −0 lib/webrick/httpservlet/cgihandler.rb
  34. +17 −16 marshal.c
  35. +2 −0  mkconfig.rb
  36. +1 −1  numeric.c
  37. +5 −6 object.c
  38. +10 −10 pack.c
  39. +5 −5 parse.y
  40. +29 −24 range.c
  41. +5 −4 re.c
  42. +8 −1 ruby.c
  43. +3 −3 ruby.h
  44. +4 −4 signal.c
  45. +19 −11 string.c
  46. +4 −4 struct.c
  47. +1 −0  test/ruby/test_array.rb
  48. +1 −0  test/ruby/test_enum.rb
  49. +2 −2 time.c
  50. +1 −1  util.c
  51. +5 −5 variable.c
  52. +26 −5 version.c
  53. +13 −3 version.h
  54. +4 −0 win32/Makefile.sub
View
111 ChangeLog
@@ -1,3 +1,114 @@
+Sat May 31 23:53:35 2008 Akinori MUSHA <knu@iDaemons.org>
+
+ * .: Release as Ruby 1.8.7.
+
+Sat May 31 23:33:34 2008 Akinori MUSHA <knu@iDaemons.org>
+
+ * README, README.ja: Add a note about default C flags.
+
+Sat May 31 22:11:15 2008 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
+
+ * version.c (ruby_description, ruby_copyright): backported from
+ 1.9. bug#19002, [ruby-dev:34883]
+
+ * error.c (report_bug): uses ruby_description.
+
+Sat May 31 20:56:04 2008 Akinori MUSHA <knu@iDaemons.org>
+
+ * array.c (rb_ary_delete_if): should return enumerator if no block
+ is given. [ruby-dev:34901]
+
+Sat May 31 18:28:17 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * suppress warnings with -Wwrite-string.
+
+Sat May 31 15:58:08 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * Makefile.in, configure.in (warnflags): defaulted to -Wall
+ -Wno-parentheses with gcc. [ruby-dev:34810]
+
+Fri May 30 05:28:18 2008 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * enum.c (count_i, count_iter_i, count_all_i): add prototypes for VC.
+
+Fri May 30 04:32:07 2008 Akinori MUSHA <knu@iDaemons.org>
+
+ * enum.c (count_i, count_iter_i): Sync with trunk.
+ enum.c (enum_count, count_all_i, Init_Enumerable),
+ array.c (rb_ary_count): Sync with trunk. If no argument or
+ block is given, count the number of all elements.
+
+Fri May 30 03:12:18 2008 Akinori MUSHA <knu@iDaemons.org>
+
+ * ext/openssl/ossl_bn.c (ossl_bn_s_rand, ossl_bn_s_pseudo_rand):
+ Int should be enough here.
+
+Fri May 30 02:35:00 2008 Akinori MUSHA <knu@iDaemons.org>
+
+ * ext/openssl/ossl_bn.c (ossl_bn_s_rand, ossl_bn_s_pseudo_rand),
+ ext/openssl/ossl_pkey_dh.c (ossl_dh_s_generate)
+ (ossl_dh_initialize),
+ ext/openssl/ossl_pkey_dsa.c (ossl_dsa_s_generate),
+ ext/openssl/ossl_rand.c (ossl_rand_bytes)
+ (ossl_rand_pseudo_bytes, ossl_rand_egd_bytes),
+ ext/openssl/ossl_x509store.c (ossl_x509stctx_set_error): Do not
+ use FIX2INT() without checking the value type. Use NUM2INT()
+ instead; found by akr in [ruby-dev:34890].
+
+Thu May 29 20:07:45 2008 Akinori MUSHA <knu@iDaemons.org>
+
+ * configure.in, win32/Makefile.sub, mkconfig.rb, instruby.rb,
+ ruby.c, lib/mkmf.rb, README.EXT, README.EXT.ja: Backport the
+ vendor_ruby directory support.
+
+Thu May 29 17:52:31 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ext/zlib/extconf.rb: search zlib1, and regard mswin32 later than VC6
+ as WIN32. [ruby-core:16984]
+
+Wed May 28 17:54:29 2008 Akinori MUSHA <knu@iDaemons.org>
+
+ * string.c (rb_str_start_with): Remove an unused variable.
+ (rb_str_upto_m): Fix a prototype.
+
+Wed May 28 17:48:28 2008 Akinori MUSHA <knu@iDaemons.org>
+
+ * range.c (range_step): Fix brokenness when a non-integer numeric
+ value is specified as step. [rubyspec]
+ (range_step): Make use of String#step internally if a string (or
+ string-alike) range is given.
+
+ * string.c (rb_str_upto_m, Init_String): Add an optional second
+ argument to specify if the last value should be included.
+
+Wed May 28 16:53:39 2008 Akinori MUSHA <knu@iDaemons.org>
+
+ * array.c (rb_ary_slice_bang): Call rb_ary_modify_check() at the
+ beginning. [rubyspec]
+
+Wed May 28 16:12:44 2008 Akinori MUSHA <knu@iDaemons.org>
+
+ * lib/webrick/httpservlet/cgihandler.rb (WEBrick::HTTPServlet::CGIHandler#do_GET):
+ Set the HTTP status code to 302 if a Location header field is
+ present and the status code is not valid as a client
+ redirection. cf. RFC 3875 6.2.3, 6.2.4.
+
+Wed May 28 15:18:16 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * lib/singleton.rb (SingletonClassMethods): _load should be public.
+
+Wed May 28 12:52:41 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * marshal.c (w_object, marshal_dump, r_object0, marshal_load): search
+ private methods too. [ruby-dev:34671]
+
+ * object.c (convert_type): ditto.
+
+Tue May 27 23:26:49 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
+
+ * error.c (rb_bug): description from rb_bug() should include
+ patchlevel. [ruby-dev:34826]
+
Tue May 27 20:19:22 2008 Akinori MUSHA <knu@iDaemons.org>
* array.c (rb_ary_slice_bang): Return an empty array instead of
View
32 NEWS
@@ -9,6 +9,31 @@ with all sufficient information, see the ChangeLog file.
== Changes since the 1.8.6 release
+=== Configuration changes
+
+* default C flags
+
+ Some C compiler flags may be added by default depending on your
+ environment. Specify optflags=.. and warnflags=.. as necessary to
+ override them.
+
+* vendor_ruby directory
+
+ A new library directory named `vendor_ruby' is introduced in
+ addition to `site_ruby'. The idea is to separate libraries
+ installed by the package system (`vendor') from manually (`site')
+ installed libraries preventing the former from getting overwritten
+ by the latter, while preserving the user option to override vendor
+ libraries with site libraries. (`site_ruby' takes precedence over
+ `vendor_ruby')
+
+ If you are a package maintainer, make each library package configure
+ the library passing the `--vendor' option to `extconf.rb' so that
+ the library files will get installed under `vendor_ruby'.
+
+ You can change the directory locations using configure options such
+ as `--with-sitedir=DIR' and `--with-vendordir=DIR'.
+
=== Library updates (outstanding ones only)
* new library
@@ -241,11 +266,16 @@ with all sufficient information, see the ChangeLog file.
* String#each_byte
* String#each
- * String#each_lines
+ * String#each_line
* String#gsub(pattern)
Return an enumerator if no block is given.
+ * String#upto
+
+ An optional second argument is added to specify if the last value
+ should be included.
+
* StopIteration
New exception class that causes Kernel#loop to stop iteration when
View
4 README
@@ -70,6 +70,10 @@ This is what you need to do to compile and install Ruby:
2. Run ./configure, which will generate config.h and Makefile.
+ Some C compiler flags may be added by default depending on your
+ environment. Specify optflags=.. and warnflags=.. as necessary
+ to override them.
+
3. Edit defines.h if you need. Usually this step will not be needed.
4. Remove comment mark(#) before the module names from ext/Setup (or
View
5 README.EXT
@@ -662,6 +662,11 @@ Try generating the Makefile by:
ruby extconf.rb
+If the library should be installed under vendor_ruby directory
+instead of site_ruby directory, use --vendor option as follows.
+
+ ruby extconf.rb --vendor
+
You don't need this step if you put the extension library under the ext
directory of the ruby source tree. In that case, compilation of the
interpreter will do this step for you.
View
6 README.EXT.ja
@@ -765,6 +765,12 @@ Makefile
�Ȥ��Ƥ��������
+site_ruby �ǥ��쥯�ȥ�Ǥʤ���
+vendor_ruby �ǥ��쥯�ȥ�˥��󥹥ȡ��뤹����ˤ�
+�ʲ��Τ褦�� --vendor ���ץ�����ä��Ƥ��������
+
+ ruby extconf.rb --vendor
+
�ǥ��쥯�ȥ��ext�ʲ����Ѱդ������ˤ�Ruby��Τ�make�λ���
��ưŪ��Makefile��������ޤ��Τǡ����Υ��ƥåפ����פǤ���
View
4 README.ja
@@ -92,6 +92,10 @@ Ruby
2. configure��¹Ԥ���Makefile�ʤɤ�������
+ �Ķ��ˤ�äƤϥǥե���Ȥ�C����ѥ����ѥ��ץ�����դ�
+ �ޤ���configure���ץ����� optflags=.. warnflags=.. ��
+ �Ǿ�񤭤Ǥ��ޤ���
+
3. (ɬ�פʤ��)defines.h���Խ�����
¿ʬ��ɬ��̵���Ȼפ��ޤ���
View
17 array.c
@@ -2080,6 +2080,7 @@ rb_ary_slice_bang(argc, argv, ary)
VALUE arg1, arg2;
long pos, len, orig_len;
+ rb_ary_modify_check(ary);
if (rb_scan_args(argc, argv, "11", &arg1, &arg2) == 2) {
pos = NUM2LONG(arg1);
len = NUM2LONG(arg2);
@@ -2184,6 +2185,7 @@ static VALUE
rb_ary_delete_if(ary)
VALUE ary;
{
+ RETURN_ENUMERATOR(ary, 0, 0);
rb_ary_reject_bang(ary);
return ary;
}
@@ -3063,27 +3065,34 @@ rb_ary_nitems(ary)
/*
* call-seq:
+ * array.count -> int
* array.count(obj) -> int
* array.count { |item| block } -> int
*
- * Returns the number of elements which equals to <i>obj</i>.
- * If a block is given, counts tthe number of elements yielding a true value.
+ * Returns the number of elements. If an argument is given, counts
+ * the number of elements which equals to <i>obj</i>. If a block is
+ * given, counts the number of elements yielding a true value.
*
* ary = [1, 2, 4, 2]
+ * ary.count # => 4
* ary.count(2) # => 2
* ary.count{|x|x%2==0} # => 3
*
*/
static VALUE
-rb_ary_count(int argc, VALUE *argv, VALUE ary)
+rb_ary_count(argc, argv, ary)
+ int argc;
+ VALUE *argv;
+ VALUE ary;
{
long n = 0;
if (argc == 0) {
VALUE *p, *pend;
- RETURN_ENUMERATOR(ary, 0, 0);
+ if (!rb_block_given_p())
+ return LONG2NUM(RARRAY_LEN(ary));
for (p = RARRAY_PTR(ary), pend = p + RARRAY_LEN(ary); p < pend; p++) {
if (RTEST(rb_yield(*p))) n++;
View
4 bcc32/Makefile.sub
@@ -294,9 +294,12 @@ $(CONFIG_H): $(MKFILES) $(srcdir)/bcc32/Makefile.sub
\#define RUBY_LIB "/lib/ruby/$(MAJOR).$(MINOR)"
\#define RUBY_SITE_LIB "/lib/ruby/site_ruby"
\#define RUBY_SITE_LIB2 "/lib/ruby/site_ruby/$(MAJOR).$(MINOR)"
+\#define RUBY_VENDOR_LIB "/lib/ruby/vendor_ruby"
+\#define RUBY_VENDOR_LIB2 "/lib/ruby/vendor_ruby/$(MAJOR).$(MINOR)"
\#define RUBY_PLATFORM "$(ARCH)-$(OS)"
\#define RUBY_ARCHLIB "/lib/ruby/$(MAJOR).$(MINOR)/$(ARCH)-$(OS)"
\#define RUBY_SITE_ARCHLIB "/lib/ruby/site_ruby/$(MAJOR).$(MINOR)/$(ARCH)-$(OS)"
+\#define RUBY_VENDOR_ARCHLIB "/lib/ruby/vendor_ruby/$(MAJOR).$(MINOR)/$(ARCH)-$(OS)"
|
@exit > $@
@@ -409,6 +412,7 @@ s,@EXPORT_PREFIX@,_,;t t
s,@arch@,$(ARCH)-$(OS),;t t
s,@sitearch@,$(ARCH)-$(OS),;t t
s,@sitedir@,$${prefix}/lib/ruby/site_ruby,;t t
+s,@vendordir@,$${prefix}/lib/ruby/vendor_ruby,;t t
s,@configure_args@,--enable-shared $(configure_args),;t t
s,@configure_input@,$$configure_input,;t t
s,@srcdir@,$(srcdir),;t t
View
22 configure.in
@@ -1710,9 +1710,28 @@ AC_DEFINE_UNQUOTED(RUBY_LIB, "${RUBY_LIB_PATH}")
AC_DEFINE_UNQUOTED(RUBY_SITE_LIB, "${RUBY_SITE_LIB_PATH}")
AC_DEFINE_UNQUOTED(RUBY_SITE_LIB2, "${RUBY_SITE_LIB_PATH2}")
+AC_ARG_WITH(vendordir,
+ [ --with-vendordir=DIR vendor libraries in DIR [PREFIX/lib/ruby/vendor_ruby]],
+ [vendordir=$withval],
+ [vendordir='${prefix}/lib/ruby/vendor_ruby'])
+VENDOR_DIR=`eval echo \\"${vendordir}\\"`
+case "$target_os" in
+ cygwin*|mingw*|*djgpp*|os2-emx*)
+ RUBY_VENDOR_LIB_PATH="`expr "$VENDOR_DIR" : "$prefix\(/.*\)"`" ||
+ RUBY_VENDOR_LIB_PATH="$VENDOR_DIR";;
+ *)
+ RUBY_VENDOR_LIB_PATH="$VENDOR_DIR";;
+esac
+RUBY_VENDOR_LIB_PATH2="${RUBY_VENDOR_LIB_PATH}/${MAJOR}.${MINOR}"
+
+AC_DEFINE_UNQUOTED(RUBY_LIB, "${RUBY_LIB_PATH}")
+AC_DEFINE_UNQUOTED(RUBY_VENDOR_LIB, "${RUBY_VENDOR_LIB_PATH}")
+AC_DEFINE_UNQUOTED(RUBY_VENDOR_LIB2, "${RUBY_VENDOR_LIB_PATH2}")
+
AC_SUBST(arch)dnl
AC_SUBST(sitearch)dnl
AC_SUBST(sitedir)dnl
+AC_SUBST(vendordir)dnl
configure_args=$ac_configure_args
AC_SUBST(configure_args)dnl
@@ -1725,6 +1744,8 @@ if test "$fat_binary" != no ; then
AC_DEFINE_UNQUOTED(RUBY_SITE_THIN_ARCHLIB,
"${RUBY_SITE_LIB_PATH}/" __ARCHITECTURE__ "-${target_os}")
+ AC_DEFINE_UNQUOTED(RUBY_VENDOR_THIN_ARCHLIB,
+ "${RUBY_VENDOR_LIB_PATH}/" __ARCHITECTURE__ "-${target_os}")
AC_DEFINE_UNQUOTED(RUBY_PLATFORM, __ARCHITECTURE__ "-${target_os}")
else
arch="${target_cpu}-${target_os}"
@@ -1738,6 +1759,7 @@ esac
AC_DEFINE_UNQUOTED(RUBY_ARCHLIB, "${RUBY_LIB_PATH}/${arch}")
AC_DEFINE_UNQUOTED(RUBY_SITE_ARCHLIB, "${RUBY_SITE_LIB_PATH2}/${sitearch}")
+AC_DEFINE_UNQUOTED(RUBY_VENDOR_ARCHLIB, "${RUBY_VENDOR_LIB_PATH2}/${sitearch}")
AC_ARG_WITH(search-path,
[ --with-search-path=DIR specify the additional search path],
View
2  dir.c
@@ -475,7 +475,7 @@ dir_inspect(dir)
Data_Get_Struct(dir, struct dir_data, dirp);
if (dirp->path) {
- char *c = rb_obj_classname(dir);
+ const char *c = rb_obj_classname(dir);
int len = strlen(c) + strlen(dirp->path) + 4;
VALUE s = rb_str_new(0, len);
snprintf(RSTRING_PTR(s), len+1, "#<%s:%s>", c, dirp->path);
View
83 enum.c
@@ -15,7 +15,7 @@
#include "util.h"
VALUE rb_mEnumerable;
-static ID id_each, id_eqq, id_cmp;
+static ID id_each, id_eqq, id_cmp, id_size;
struct iter_method_arg {
VALUE obj;
@@ -113,37 +113,57 @@ enum_grep(obj, pat)
return ary;
}
+static VALUE count_i _((VALUE, VALUE));
static VALUE
-count_i(i, arg)
- VALUE i;
- VALUE *arg;
+count_i(i, memop)
+ VALUE i, memop;
{
- if (rb_equal(i, arg[0])) {
- arg[1]++;
+ VALUE *memo = (VALUE*)memop;
+
+ if (rb_equal(i, memo[1])) {
+ memo[0]++;
}
return Qnil;
}
+static VALUE count_iter_i _((VALUE, VALUE));
static VALUE
-count_iter_i(i, n)
- VALUE i;
- long *n;
+count_iter_i(i, memop)
+ VALUE i, memop;
{
+ VALUE *memo = (VALUE*)memop;
+
if (RTEST(rb_yield(i))) {
- (*n)++;
+ memo[0]++;
}
return Qnil;
}
+static VALUE count_all_i _((VALUE, VALUE));
+static VALUE
+count_all_i(i, memop)
+ VALUE i, memop;
+{
+ VALUE *memo = (VALUE*)memop;
+
+ memo[0]++;
+ return Qnil;
+}
+
/*
* call-seq:
+ * enum.count => int
* enum.count(item) => int
* enum.count {| obj | block } => int
*
- * Returns the number of items in <i>enum</i> for which equals to <i>item</i>.
- * If a block is given, counts the number of elements yielding a true value.
+ * Returns the number of items in <i>enum</i>, where #size is called
+ * if it responds to it, otherwise the items are counted through
+ * enumeration. If an argument is given, counts the number of items
+ * in <i>enum</i>, for which equals to <i>item</i>. If a block is
+ * given, counts the number of elements yielding a true value.
*
* ary = [1, 2, 4, 2]
+ * ary.count # => 4
* ary.count(2) # => 2
* ary.count{|x|x%2==0} # => 3
*
@@ -155,31 +175,31 @@ enum_count(argc, argv, obj)
VALUE *argv;
VALUE obj;
{
- if (argc == 1) {
- VALUE item, args[2];
+ VALUE memo[2]; /* [count, condition value] */
+ rb_block_call_func *func;
+ if (argc == 0) {
if (rb_block_given_p()) {
- rb_warn("given block not used");
+ func = count_iter_i;
+ }
+ else {
+ if (rb_respond_to(obj, id_size)) {
+ return rb_funcall(obj, id_size, 0, 0);
+ }
+ func = count_all_i;
}
- rb_scan_args(argc, argv, "1", &item);
- args[0] = item;
- args[1] = 0;
- rb_block_call(obj, id_each, 0, 0, count_i, (VALUE)&args);
- return INT2NUM(args[1]);
- }
- else if (argc == 0) {
- long n;
-
- RETURN_ENUMERATOR(obj, 0, 0);
- n = 0;
- rb_block_call(obj, id_each, 0, 0, count_iter_i, (VALUE)&n);
- return INT2NUM(n);
}
else {
- VALUE v;
- rb_scan_args(argc, argv, "1", &v);
- return Qnil; /* not reached */
+ rb_scan_args(argc, argv, "1", &memo[1]);
+ if (rb_block_given_p()) {
+ rb_warn("given block not used");
+ }
+ func = count_i;
}
+
+ memo[0] = 0;
+ rb_block_call(obj, id_each, 0, 0, func, (VALUE)&memo);
+ return INT2NUM(memo[0]);
}
static VALUE
@@ -1866,5 +1886,6 @@ Init_Enumerable()
id_eqq = rb_intern("===");
id_each = rb_intern("each");
id_cmp = rb_intern("<=>");
+ id_size = rb_intern("size");
}
View
13 error.c
@@ -29,7 +29,7 @@
#define EXIT_SUCCESS 0
#endif
-extern const char ruby_version[], ruby_release_date[], ruby_platform[];
+extern const char *ruby_description;
int ruby_nerrs;
@@ -208,8 +208,7 @@ rb_bug(fmt, va_alist)
va_init_list(args, fmt);
vfprintf(out, fmt, args);
va_end(args);
- fprintf(out, "\nruby %s (%s) [%s]\n\n",
- ruby_version, ruby_release_date, ruby_platform);
+ fprintf(out, "\n%s\n\n", ruby_description);
}
abort();
}
@@ -258,7 +257,7 @@ rb_check_type(x, t)
if (TYPE(x) != t) {
while (type->type >= 0) {
if (type->type == t) {
- char *etype;
+ const char *etype;
if (NIL_P(x)) {
etype = "nil";
@@ -499,7 +498,7 @@ rb_check_backtrace(bt)
VALUE bt;
{
long i;
- static char *err = "backtrace must be Array of String";
+ static const char err[] = "backtrace must be Array of String";
if (!NIL_P(bt)) {
int t = TYPE(bt);
@@ -728,7 +727,7 @@ name_err_mesg_to_str(obj)
mesg = ptr[0];
if (NIL_P(mesg)) return Qnil;
else {
- char *desc = 0;
+ const char *desc = 0;
VALUE d = 0, args[3];
obj = ptr[1];
@@ -882,7 +881,7 @@ syserr_initialize(argc, argv, self)
#if !defined(_WIN32) && !defined(__VMS)
char *strerror();
#endif
- char *err;
+ const char *err;
VALUE mesg, error;
VALUE klass = rb_obj_class(self);
View
58 eval.c
@@ -1103,8 +1103,8 @@ static void scope_dup _((struct SCOPE *));
} while (0)
static VALUE rb_eval _((VALUE,NODE*));
-static VALUE eval _((VALUE,VALUE,VALUE,char*,int));
-static NODE *compile _((VALUE, char*, int));
+static VALUE eval _((VALUE,VALUE,VALUE,const char*,int));
+static NODE *compile _((VALUE, const char*, int));
static VALUE rb_yield_0 _((VALUE, VALUE, VALUE, int, int));
@@ -1227,7 +1227,7 @@ error_print()
{
VALUE errat = Qnil; /* OK */
volatile VALUE eclass, e;
- char *einfo;
+ const char *einfo;
long elen;
if (NIL_P(ruby_errinfo)) return;
@@ -2032,7 +2032,7 @@ void
rb_frozen_class_p(klass)
VALUE klass;
{
- char *desc = "something(?!)";
+ const char *desc = "something(?!)";
if (OBJ_FROZEN(klass)) {
if (FL_TEST(klass, FL_SINGLETON))
@@ -2070,7 +2070,7 @@ rb_undef(klass, id)
}
body = search_method(klass, id, &origin);
if (!body || !body->nd_body) {
- char *s0 = " class";
+ const char *s0 = " class";
VALUE c = klass;
if (FL_TEST(c, FL_SINGLETON)) {
@@ -2322,9 +2322,9 @@ rb_copy_node_scope(node, rval)
#define MATCH_DATA *rb_svar(node->nd_cnt)
-static char* is_defined _((VALUE, NODE*, char*));
+static const char* is_defined _((VALUE, NODE*, char*));
-static char*
+static const char*
arg_defined(self, node, buf, type)
VALUE self;
NODE *node;
@@ -2351,7 +2351,7 @@ arg_defined(self, node, buf, type)
return type;
}
-static char*
+static const char*
is_defined(self, node, buf)
VALUE self;
NODE *node; /* OK */
@@ -2671,27 +2671,27 @@ set_trace_func(obj, trace)
return trace;
}
-static char *
+static const char *
get_event_name(rb_event_t event)
{
switch (event) {
- case RUBY_EVENT_LINE:
+ case RUBY_EVENT_LINE:
return "line";
- case RUBY_EVENT_CLASS:
+ case RUBY_EVENT_CLASS:
return "class";
- case RUBY_EVENT_END:
+ case RUBY_EVENT_END:
return "end";
- case RUBY_EVENT_CALL:
+ case RUBY_EVENT_CALL:
return "call";
- case RUBY_EVENT_RETURN:
+ case RUBY_EVENT_RETURN:
return "return";
- case RUBY_EVENT_C_CALL:
+ case RUBY_EVENT_C_CALL:
return "c-call";
- case RUBY_EVENT_C_RETURN:
+ case RUBY_EVENT_C_RETURN:
return "c-return";
- case RUBY_EVENT_RAISE:
+ case RUBY_EVENT_RAISE:
return "raise";
- default:
+ default:
return "unknown";
}
}
@@ -2708,7 +2708,7 @@ call_trace_func(event, node, self, id, klass)
struct FRAME *prev;
NODE *node_save;
VALUE srcfile;
- char *event_name;
+ const char *event_name;
if (!trace_func) return;
if (tracing) return;
@@ -4136,7 +4136,7 @@ rb_eval(self, n)
case NODE_DEFINED:
{
char buf[20];
- char *desc = is_defined(self, node->nd_head, buf);
+ const char *desc = is_defined(self, node->nd_head, buf);
if (desc) result = rb_str_new2(desc);
else result = Qnil;
@@ -4804,7 +4804,7 @@ proc_jump_error(state, result)
VALUE result;
{
char mesg[32];
- char *statement;
+ const char *statement;
switch (state) {
case TAG_BREAK:
@@ -5638,7 +5638,7 @@ rb_method_missing(argc, argv, obj)
{
ID id;
VALUE exc = rb_eNoMethodError;
- char *format = 0;
+ const char *format = 0;
NODE *cnode = ruby_current_node;
if (argc == 0 || !SYMBOL_P(argv[0])) {
@@ -6448,7 +6448,7 @@ rb_frame_this_func()
static NODE*
compile(src, file, line)
VALUE src;
- char *file;
+ const char *file;
int line;
{
NODE *node;
@@ -6468,7 +6468,7 @@ compile(src, file, line)
static VALUE
eval(self, src, scope, file, line)
VALUE self, src, scope;
- char *file;
+ const char *file;
int line;
{
struct BLOCK *data = NULL;
@@ -6629,7 +6629,7 @@ rb_f_eval(argc, argv, self)
VALUE self;
{
VALUE src, scope, vfile, vline;
- char *file = "(eval)";
+ const char *file = "(eval)";
int line = 1;
rb_scan_args(argc, argv, "13", &src, &scope, &vfile, &vline);
@@ -6783,7 +6783,7 @@ specific_eval(argc, argv, klass, self)
return yield_under(klass, self, Qundef);
}
else {
- char *file = "(eval)";
+ const char *file = "(eval)";
int line = 1;
if (argc == 0) {
@@ -9014,7 +9014,7 @@ proc_to_s(self)
{
struct BLOCK *data;
NODE *node;
- char *cname = rb_obj_classname(self);
+ const char *cname = rb_obj_classname(self);
const int w = (sizeof(VALUE) * CHAR_BIT) / 4;
long len = strlen(cname)+6+w; /* 6:tags 16:addr */
VALUE str;
@@ -9748,7 +9748,7 @@ method_inspect(method)
struct METHOD *data;
VALUE str;
const char *s;
- char *sharp = "#";
+ const char *sharp = "#";
Data_Get_Struct(method, struct METHOD, data);
str = rb_str_buf_new2("#<");
@@ -12923,7 +12923,7 @@ static VALUE
rb_thread_inspect(thread)
VALUE thread;
{
- char *cname = rb_obj_classname(thread);
+ const char *cname = rb_obj_classname(thread);
rb_thread_t th = rb_thread_check(thread);
const char *status = thread_status_name(th->status);
VALUE str;
View
2  ext/openssl/ossl_bn.c
@@ -515,7 +515,7 @@ BIGNUM_SELF_SHIFT(rshift);
bottom = (odd == Qtrue) ? 1 : 0; \
/* FALLTHROUGH */ \
case 2: \
- top = FIX2INT(fill); \
+ top = NUM2INT(fill); \
} \
b = NUM2INT(bits); \
if (!(result = BN_new())) { \
View
6 ext/openssl/ossl_pkey_dh.c
@@ -116,9 +116,9 @@ ossl_dh_s_generate(int argc, VALUE *argv, VALUE klass)
VALUE size, gen, obj;
if (rb_scan_args(argc, argv, "11", &size, &gen) == 2) {
- g = FIX2INT(gen);
+ g = NUM2INT(gen);
}
- dh = dh_generate(FIX2INT(size), g);
+ dh = dh_generate(NUM2INT(size), g);
obj = dh_instance(klass, dh);
if (obj == Qfalse) {
DH_free(dh);
@@ -158,7 +158,7 @@ ossl_dh_initialize(int argc, VALUE *argv, VALUE self)
}
else if (FIXNUM_P(arg)) {
if (!NIL_P(gen)) {
- g = FIX2INT(gen);
+ g = NUM2INT(gen);
}
if (!(dh = dh_generate(FIX2INT(arg), g))) {
ossl_raise(eDHError, NULL);
View
2  ext/openssl/ossl_pkey_dsa.c
@@ -110,7 +110,7 @@ dsa_generate(int size)
static VALUE
ossl_dsa_s_generate(VALUE klass, VALUE size)
{
- DSA *dsa = dsa_generate(FIX2INT(size)); /* err handled by dsa_instance */
+ DSA *dsa = dsa_generate(NUM2INT(size)); /* err handled by dsa_instance */
VALUE obj = dsa_instance(klass, dsa);
if (obj == Qfalse) {
View
16 ext/openssl/ossl_rand.c
@@ -96,9 +96,10 @@ static VALUE
ossl_rand_bytes(VALUE self, VALUE len)
{
VALUE str;
-
- str = rb_str_new(0, FIX2INT(len));
- if (!RAND_bytes(RSTRING_PTR(str), FIX2INT(len))) {
+ int n = NUM2INT(len);
+
+ str = rb_str_new(0, n);
+ if (!RAND_bytes(RSTRING_PTR(str), n)) {
ossl_raise(eRandomError, NULL);
}
@@ -114,9 +115,10 @@ static VALUE
ossl_rand_pseudo_bytes(VALUE self, VALUE len)
{
VALUE str;
+ int n = NUM2INT(len);
- str = rb_str_new(0, FIX2INT(len));
- if (!RAND_pseudo_bytes(RSTRING_PTR(str), FIX2INT(len))) {
+ str = rb_str_new(0, n);
+ if (!RAND_pseudo_bytes(RSTRING_PTR(str), n)) {
ossl_raise(eRandomError, NULL);
}
@@ -147,9 +149,11 @@ ossl_rand_egd(VALUE self, VALUE filename)
static VALUE
ossl_rand_egd_bytes(VALUE self, VALUE filename, VALUE len)
{
+ long n = NUM2INT(len);
+
SafeStringValue(filename);
- if (!RAND_egd_bytes(RSTRING_PTR(filename), FIX2INT(len))) {
+ if (!RAND_egd_bytes(RSTRING_PTR(filename), n)) {
ossl_raise(eRandomError, NULL);
}
return Qtrue;
View
2  ext/openssl/ossl_x509store.c
@@ -458,7 +458,7 @@ ossl_x509stctx_set_error(VALUE self, VALUE err)
X509_STORE_CTX *ctx;
GetX509StCtx(self, ctx);
- X509_STORE_CTX_set_error(ctx, FIX2INT(err));
+ X509_STORE_CTX_set_error(ctx, NUM2INT(err));
return err;
}
View
9 ext/purelib.rb
@@ -1,3 +1,10 @@
-if nul = $:.find_index {|path| /\A(?:\.\/)*-\z/ =~ path}
+nul = nil
+$:.each_with_index {|path, index|
+ if /\A(?:\.\/)*-\z/ =~ path
+ nul = index
+ break
+ end
+}
+if nul
$:[nul..-1] = ["."]
end
View
10 ext/tk/sample/demos-en/toolbar.rb
@@ -18,11 +18,12 @@
base_frame = Ttk::Frame.new($toolbar_demo).pack(:fill=>:both, :expand=>true)
if Tk.windowingsystem != 'aqua'
- msg = Ttk::Label.new(base_frame, :wraplength=>'4i', :text=><<EOL)
+ msg = Ttk::Label.new(base_frame, :wraplength=>'4i',
+ :text=>Tk::UTF8_String.new(<<EOL))
This is a demonstration of how to do \
a toolbar that is styled correctly \
and which can be torn off (this feature reqrires Tcl/Tk8.5). \
-The buttons are configured to be \u201Ctoolbar style\u201D buttons by \
+The buttons are configured to be \\u201Ctoolbar style\\u201D buttons by \
telling them that they are to use the Toolbutton style. At the left \
end of the toolbar is a simple marker that the cursor changes to a \
movement icon over; drag that away from the toolbar to tear off the \
@@ -31,10 +32,11 @@
and it will reattach to the window it was torn off from.
EOL
else
- msg = Ttk::Label.new(base_frame, :wraplength=>'4i', :text=><<EOL)
+ msg = Ttk::Label.new(base_frame, :wraplength=>'4i',
+ :text=>Tk::UTF8_String.new(<<EOL))
This is a demonstration of how to do \
a toolbar that is styled correctly. The buttons are configured to \
-be \u201Ctoolbar style\u201D buttons by telling them that they are \
+be \\u201Ctoolbar style\\u201D buttons by telling them that they are \
to use the Toolbutton style.
EOL
end
View
6 ext/tk/sample/demos-en/ttkprogress.rb
@@ -18,11 +18,11 @@
base_frame = TkFrame.new($ttkprogress_demo).pack(:fill=>:both, :expand=>true)
Ttk::Label.new(base_frame, :font=>$font, :wraplength=>'4i', :justify=>:left,
- :text=><<EOL).pack(:side=>:top, :fill=>:x)
+ :text=>Tk::UTF8_String.new(<<EOL)).pack(:side=>:top, :fill=>:x)
Below are two progress bars. \
-The top one is a \u201Cdeterminate\u201D progress bar, \
+The top one is a \\u201Cdeterminate\\u201D progress bar, \
which is used for showing how far through a defined task the program has got. \
-The bottom one is an \u201Cindeterminate\u201D progress bar, \
+The bottom one is an \\u201Cindeterminate\\u201D progress bar, \
which is used to show that the program is busy \
but does not know how long for. Both are run here in self-animated mode, \
which can be turned on and off using the buttons underneath.
View
68 ext/tk/sample/demos-en/widget
@@ -775,6 +775,12 @@ def showCode1(demo)
TkLabel.new(f,'text'=>' pos:').pack('side'=>'left')
posnum =TkLabel.new(f,'text'=>'').pack('side'=>'left')
+ $set_linenum = proc{|w|
+ line, pos = w.index('insert').split('.')
+ linenum.text = line
+ posnum.text = pos
+ }
+
f.pack('side'=>'bottom', 'expand'=>'true', 'fill'=>'x')
if $tk_version =~ /^4\.[01]/
@@ -820,10 +826,21 @@ def showCode1(demo)
TkGrid.columnconfigure(f, 0, 'weight'=>1, 'minsize'=>0)
}
end
+
+ btag = TkBindTag.new
+
+ btag.bind('Key', $set_linenum, '%W')
+ btag.bind('Button', $set_linenum, '%W')
+
+ btags = $code_text.bindtags
+ btags.insert(btags.index($code_text.class) + 1, btag)
+ $code_text.bindtags = btags
+
else
$code_window.deiconify
$code_window.raise
end
+
$code_window.title("Demo code: #{file}")
$code_window.iconname(file)
# fid = open(file, 'r')
@@ -835,22 +852,7 @@ def showCode1(demo)
#$code_text.set_insert('1.0')
TkTextMarkInsert.new($code_text,'1.0')
- btag = TkBindTag.new
-
- set_linenum = proc{|w|
- line, pos = w.index('insert').split('.')
- linenum.text = line
- posnum.text = pos
- }
-
- btag.bind('Key', set_linenum, '%W')
- btag.bind('Button', set_linenum, '%W')
-
- btags = $code_text.bindtags
- btags.insert(btags.index($code_text.class) + 1, btag)
- $code_text.bindtags = btags
-
- set_linenum.call($code_text)
+ $set_linenum.call($code_text)
fid.close
end
@@ -879,6 +881,12 @@ def showCode2(demo)
TkLabel.new(lf, :text=>' pos:').pack(:side=>:left)
posnum =TkLabel.new(lf, :text=>'').pack(:side=>:left)
+ $set_linenum = proc{|w|
+ line, pos = w.index('insert').split('.')
+ linenum.text = line
+ posnum.text = pos
+ }
+
b_dis = TkButton.new(bf, :text=>'Dismiss', :default=>:active,
:command=>proc{
$code_window.destroy
@@ -909,6 +917,17 @@ def showCode2(demo)
$code_window.bindinfo('Return').each{|cmd, arg|
$code_window.bind_append('Escape', cmd, arg)
}
+
+ btag = TkBindTag.new
+
+ btag.bind('Key', $set_linenum, '%W')
+ btag.bind('Button', $set_linenum, '%W')
+ btag.bind('Configure', $set_linenum, '%W')
+
+ btags = $code_text.bindtags
+ btags.insert(btags.index($code_text.class) + 1, btag)
+ $code_text.bindtags = btags
+
else
$code_window.deiconify
$code_window.raise
@@ -921,22 +940,7 @@ def showCode2(demo)
$code_text.insert('1.0', fid.read)
TkTextMarkInsert.new($code_text,'1.0')
- btag = TkBindTag.new
-
- set_linenum = proc{|w|
- line, pos = w.index('insert').split('.')
- linenum.text = line
- posnum.text = pos
- }
-
- btag.bind('Key', set_linenum, '%W')
- btag.bind('Button', set_linenum, '%W')
-
- btags = $code_text.bindtags
- btags.insert(btags.index($code_text.class) + 1, btag)
- $code_text.bindtags = btags
-
- set_linenum.call($code_text)
+ $set_linenum.call($code_text)
fid.close
end
View
67 ext/tk/sample/demos-jp/widget
@@ -814,6 +814,12 @@ def showCode1(demo)
TkLabel.new(f,'text'=>' pos:').pack('side'=>'left')
posnum =TkLabel.new(f,'text'=>'').pack('side'=>'left')
+ $set_linenum = proc{|w|
+ line, pos = w.index('insert').split('.')
+ linenum.text = line
+ posnum.text = pos
+ }
+
f.pack('side'=>'bottom', 'expand'=>'true', 'fill'=>'x')
if $tk_version =~ /^4\.[01]/
@@ -858,10 +864,21 @@ def showCode1(demo)
TkGrid.columnconfigure(f, 0, 'weight'=>1, 'minsize'=>0)
}
end
+
+ btag = TkBindTag.new
+
+ btag.bind('Key', $set_linenum, '%W')
+ btag.bind('Button', $set_linenum, '%W')
+
+ btags = $code_text.bindtags
+ btags.insert(btags.index($code_text.class) + 1, btag)
+ $code_text.bindtags = btags
+
else
$code_window.deiconify
$code_window.raise
end
+
$code_window.title("Demo code: #{file}")
$code_window.iconname(file)
# fid = open(file, 'r')
@@ -873,22 +890,7 @@ def showCode1(demo)
#$code_text.set_insert('1.0')
TkTextMarkInsert.new($code_text,'1.0')
- btag = TkBindTag.new
-
- set_linenum = proc{|w|
- line, pos = w.index('insert').split('.')
- linenum.text = line
- posnum.text = pos
- }
-
- btag.bind('Key', set_linenum, '%W')
- btag.bind('Button', set_linenum, '%W')
-
- btags = $code_text.bindtags
- btags.insert(btags.index($code_text.class) + 1, btag)
- $code_text.bindtags = btags
-
- set_linenum.call($code_text)
+ $set_linenum.call($code_text)
fid.close
end
@@ -917,6 +919,12 @@ def showCode2(demo)
TkLabel.new(lf, :text=>' pos:').pack(:side=>:left)
posnum =TkLabel.new(lf, :text=>'').pack(:side=>:left)
+ $set_linenum = proc{|w|
+ line, pos = w.index('insert').split('.')
+ linenum.text = line
+ posnum.text = pos
+ }
+
#b_dis = TkButton.new(bf, :text=>'了解', :default=>:active,
b_dis = TkButton.new(bf, :text=>'閉じる', :default=>:active,
:command=>proc{
@@ -948,6 +956,16 @@ def showCode2(demo)
$code_window.bindinfo('Return').each{|cmd, arg|
$code_window.bind_append('Escape', cmd, arg)
}
+
+ btag = TkBindTag.new
+
+ btag.bind('Key', $set_linenum, '%W')
+ btag.bind('Button', $set_linenum, '%W')
+
+ btags = $code_text.bindtags
+ btags.insert(btags.index($code_text.class) + 1, btag)
+ $code_text.bindtags = btags
+
else
$code_window.deiconify
$code_window.raise
@@ -960,22 +978,7 @@ def showCode2(demo)
$code_text.insert('1.0', fid.read)
TkTextMarkInsert.new($code_text,'1.0')
- btag = TkBindTag.new
-
- set_linenum = proc{|w|
- line, pos = w.index('insert').split('.')
- linenum.text = line
- posnum.text = pos
- }
-
- btag.bind('Key', set_linenum, '%W')
- btag.bind('Button', set_linenum, '%W')
-
- btags = $code_text.bindtags
- btags.insert(btags.index($code_text.class) + 1, btag)
- $code_text.bindtags = btags
-
- set_linenum.call($code_text)
+ $set_linenum.call($code_text)
fid.close
end
View
4 ext/zlib/extconf.rb
@@ -10,7 +10,7 @@
dir_config 'zlib'
-if %w'z libz zlib zdll'.find {|z| have_library(z, 'deflateReset')} and
+if %w'z libz zlib1 zlib zdll'.find {|z| have_library(z, 'deflateReset')} and
have_header('zlib.h') then
defines = []
@@ -22,7 +22,7 @@
os_code = 'AMIGA'
when /\Aos2[\-_]emx\z/ then
os_code = 'OS2'
- when 'mswin32', 'mingw32', 'bccwin32' then
+ when /mswin|mingw|bccwin/ then
# NOTE: cygwin should be regarded as Unix.
os_code = 'WIN32'
else
View
2  file.c
@@ -1495,7 +1495,7 @@ static VALUE
rb_file_ftype(st)
struct stat *st;
{
- char *t;
+ const char *t;
if (S_ISREG(st->st_mode)) {
t = "file";
View
6 instruby.rb
@@ -213,6 +213,8 @@ def with_destdir(dir)
archlibdir = CONFIG["archdir"]
sitelibdir = CONFIG["sitelibdir"]
sitearchlibdir = CONFIG["sitearchdir"]
+vendorlibdir = CONFIG["vendorlibdir"]
+vendorarchlibdir = CONFIG["vendorarchdir"]
mandir = File.join(CONFIG["mandir"], "man")
configure_args = Shellwords.shellwords(CONFIG["configure_args"])
enable_shared = CONFIG["ENABLE_SHARED"] == 'yes'
@@ -253,7 +255,7 @@ def with_destdir(dir)
extout = "#$extout"
install?(:ext, :arch, :'ext-arch') do
puts "installing extension objects"
- makedirs [archlibdir, sitearchlibdir]
+ makedirs [archlibdir, sitearchlibdir, vendorarchlibdir]
if noinst = CONFIG["no_install_files"] and noinst.empty?
noinst = nil
end
@@ -261,7 +263,7 @@ def with_destdir(dir)
end
install?(:ext, :comm, :'ext-comm') do
puts "installing extension scripts"
- makedirs [rubylibdir, sitelibdir]
+ makedirs [rubylibdir, sitelibdir, vendorlibdir]
install_recursive("#{extout}/common", rubylibdir, :mode => $data_mode)
end
end
View
2  intern.h
@@ -467,7 +467,7 @@ VALUE rb_struct_alloc _((VALUE, VALUE));
VALUE rb_struct_aref _((VALUE, VALUE));
VALUE rb_struct_aset _((VALUE, VALUE, VALUE));
VALUE rb_struct_getmember _((VALUE, ID));
-VALUE rb_struct_iv_get _((VALUE, char*));
+VALUE rb_struct_iv_get _((VALUE, const char*));
VALUE rb_struct_s_members _((VALUE));
VALUE rb_struct_members _((VALUE));
/* time.c */
View
29 io.c
@@ -1000,7 +1000,8 @@ rb_io_inspect(obj)
VALUE obj;
{
rb_io_t *fptr;
- char *buf, *cname, *st = "";
+ char *buf;
+ const char *cname, *st = "";
long len;
fptr = RFILE(rb_io_taint_check(obj))->fptr;
@@ -1703,7 +1704,7 @@ rb_io_getline(rs, io)
}
else {
int c, newline;
- char *rsptr;
+ const char *rsptr;
long rslen;
int rspara = 0;
@@ -2705,7 +2706,7 @@ rb_io_binmode(io)
return io;
}
-char*
+const char*
rb_io_flags_mode(flags)
int flags;
{
@@ -2858,7 +2859,7 @@ rb_io_mode_modenum(mode)
#define MODENUM_MAX 4
-static char*
+static const char*
rb_io_modenum_mode(flags)
int flags;
{
@@ -3005,7 +3006,7 @@ rb_file_sysopen_internal(io, fname, flags, mode)
{
rb_io_t *fptr;
int fd;
- char *m;
+ const char *m;
MakeOpenFile(io, fptr);
@@ -3123,12 +3124,12 @@ rb_io_unbuffered(fptr)
rb_io_synchronized(fptr);
}
-static VALUE pipe_open(VALUE pstr, char *pname, char *mode);
+static VALUE pipe_open(VALUE pstr, const char *pname, const char *mode);
static VALUE
pipe_open(pstr, pname, mode)
VALUE pstr;
- char *pname, *mode;
+ const char *pname, *mode;
{
int modef = rb_io_mode_flags(mode);
rb_io_t *fptr;
@@ -3350,7 +3351,7 @@ rb_io_s_popen(argc, argv, klass)
VALUE *argv;
VALUE klass;
{
- char *mode;
+ const char *mode;
VALUE pname, pmode, port;
if (rb_scan_args(argc, argv, "11", &pname, &pmode) == 1) {
@@ -3388,7 +3389,7 @@ rb_open_file(argc, argv, io)
VALUE io;
{
VALUE fname, vmode, perm;
- char *path, *mode;
+ const char *path, *mode;
int flags, fmode;
rb_scan_args(argc, argv, "12", &fname, &vmode, &perm);
@@ -3606,7 +3607,7 @@ rb_io_check_io(io)
return rb_check_convert_type(io, T_FILE, "IO", "to_io");
}
-static char*
+static const char*
rb_io_mode_string(fptr)
rb_io_t *fptr;
{
@@ -3626,7 +3627,7 @@ io_reopen(io, nfile)
VALUE io, nfile;
{
rb_io_t *fptr, *orig;
- char *mode;
+ const char *mode;
int fd, fd2;
off_t pos = 0;
@@ -3742,7 +3743,7 @@ rb_io_reopen(argc, argv, file)
VALUE file;
{
VALUE fname, nmode;
- char *mode;
+ const char *mode;
rb_io_t *fptr;
rb_secure(4);
@@ -3805,7 +3806,7 @@ rb_io_init_copy(dest, io)
{
rb_io_t *fptr, *orig;
int fd;
- char *mode;
+ const char *mode;
io = rb_io_get_io(io);
if (dest == io) return dest;
@@ -4425,7 +4426,7 @@ rb_io_s_new(argc, argv, klass)
VALUE klass;
{
if (rb_block_given_p()) {
- char *cname = rb_class2name(klass);
+ const char *cname = rb_class2name(klass);
rb_warn("%s::new() does not take block; use %s::open() instead",
cname, cname);
View
2  keywords
@@ -1,4 +1,4 @@
-struct kwtable {char *name; int id[2]; enum lex_state state;};
+struct kwtable {const char *name; int id[2]; enum lex_state state;};
%%
__LINE__, {k__LINE__, k__LINE__}, EXPR_END
__FILE__, {k__FILE__, k__FILE__}, EXPR_END
View
2  lex.c
@@ -1,6 +1,6 @@
/* C code produced by gperf version 2.7.2 */
/* Command-line: gperf -p -j1 -i 1 -g -o -t -N rb_reserved_word -k'1,3,$' ./keywords */
-struct kwtable {char *name; int id[2]; enum lex_state state;};
+struct kwtable {const char *name; int id[2]; enum lex_state state;};
#define TOTAL_KEYWORDS 40
#define MIN_WORD_LENGTH 2
View
13 lib/mkmf.rb
@@ -51,6 +51,9 @@
$sitedir = CONFIG["sitedir"]
$sitelibdir = CONFIG["sitelibdir"]
$sitearchdir = CONFIG["sitearchdir"]
+$vendordir = CONFIG["vendordir"]
+$vendorlibdir = CONFIG["vendorlibdir"]
+$vendorarchdir = CONFIG["vendorarchdir"]
$mswin = /mswin/ =~ RUBY_PLATFORM
$bccwin = /bccwin/ =~ RUBY_PLATFORM
@@ -76,11 +79,14 @@ def dir_re(dir)
INSTALL_DIRS = [
[dir_re('commondir'), "$(RUBYCOMMONDIR)"],
[dir_re('sitedir'), "$(RUBYCOMMONDIR)"],
+ [dir_re('vendordir'), "$(RUBYCOMMONDIR)"],
[dir_re('rubylibdir'), "$(RUBYLIBDIR)"],
[dir_re('archdir'), "$(RUBYARCHDIR)"],
[dir_re('sitelibdir'), "$(RUBYLIBDIR)"],
+ [dir_re('vendorlibdir'), "$(RUBYLIBDIR)"],
[dir_re('sitearchdir'), "$(RUBYARCHDIR)"],
[dir_re('bindir'), "$(BINDIR)"],
+ [dir_re('vendorarchdir'), "$(RUBYARCHDIR)"],
]
def install_dirs(target_prefix = nil)
@@ -100,6 +106,13 @@ def install_dirs(target_prefix = nil)
['RUBYLIBDIR', '$(rubylibdir)$(target_prefix)'],
['RUBYARCHDIR', '$(archdir)$(target_prefix)'],
]
+ elsif $configure_args.has_key?('--vendor')
+ dirs = [
+ ['BINDIR', '$(bindir)'],
+ ['RUBYCOMMONDIR', '$(vendordir)$(target_prefix)'],
+ ['RUBYLIBDIR', '$(vendorlibdir)$(target_prefix)'],
+ ['RUBYARCHDIR', '$(vendorarchdir)$(target_prefix)'],
+ ]
else
dirs = [
['BINDIR', '$(bindir)'],
View
62 lib/singleton.rb
@@ -30,7 +30,7 @@
# * Klass.new and Klass.allocate - as private
#
# Providing (or modifying) the class methods
-# * Klass.inherited(sub_klass) and Klass.clone() -
+# * Klass.inherited(sub_klass) and Klass.clone() -
# to ensure that the Singleton pattern is properly
# inherited and cloned.
#
@@ -70,10 +70,10 @@ def clone
def dup
raise TypeError, "can't dup instance of singleton #{self.class}"
end
-
- private
+
+ private
# default marshalling strategy
- def _dump(depth=-1)
+ def _dump(depth=-1)
''
end
end
@@ -104,7 +104,7 @@ def instance; @__instance__ end
end
end
elsif _instantiate?()
- Thread.critical = false
+ Thread.critical = false
else
@__instance__ = false
Thread.critical = false
@@ -123,26 +123,26 @@ def instance; @__instance__ end
end
@__instance__
end
-
- module SingletonClassMethods
+
+ module SingletonClassMethods
# properly clone the Singleton pattern - did you know
- # that duping doesn't copy class methods?
+ # that duping doesn't copy class methods?
def clone
Singleton.__init__(super)
end
-
+
+ def _load(str)
+ instance
+ end
+
private
-
- # ensure that the Singleton pattern is properly inherited
+
+ # ensure that the Singleton pattern is properly inherited
def inherited(sub_klass)
super
Singleton.__init__(sub_klass)
end
-
- def _load(str)
- instance
- end
-
+
# waiting-loop hook
def _instantiate?()
while false.equal?(@__instance__)
@@ -153,7 +153,7 @@ def _instantiate?()
@__instance__
end
end
-
+
def __init__(klass)
klass.instance_eval { @__instance__ = nil }
class << klass
@@ -161,11 +161,11 @@ class << klass
end
klass
end
-
+
private
# extending an object with Singleton is a bad idea
undef_method :extend_object
-
+
def append_features(mod)
# help out people counting on transitive mixins
unless mod.instance_of?(Class)
@@ -173,7 +173,7 @@ def append_features(mod)
end
super
end
-
+
def included(klass)
super
klass.private_class_method :new, :allocate
@@ -181,21 +181,21 @@ def included(klass)
Singleton.__init__(klass)
end
end
-
+
if __FILE__ == $0
def num_of_instances(klass)
"#{ObjectSpace.each_object(klass){}} #{klass} instance(s)"
-end
+end
# The basic and most important example.
class SomeSingletonClass
include Singleton
end
-puts "There are #{num_of_instances(SomeSingletonClass)}"
+puts "There are #{num_of_instances(SomeSingletonClass)}"
a = SomeSingletonClass.instance
b = SomeSingletonClass.instance # a and b are same object
@@ -218,23 +218,23 @@ def initialize
puts "initialize called by thread ##{Thread.current[:i]}"
end
end
-
+
class << Ups
def _instantiate?
@enter.push Thread.current[:i]
while false.equal?(@__instance__)
Thread.critical = false
- sleep 0.08
+ sleep 0.08
Thread.critical = true
end
@leave.push Thread.current[:i]
@__instance__
end
-
+
def __sleep
sleep(rand(0.08))
end
-
+
def new
begin
__sleep
@@ -246,12 +246,12 @@ class << self
end
end
end
-
+
def instantiate_all
@enter = []
@leave = []
- 1.upto(9) {|i|
- Thread.new {
+ 1.upto(9) {|i|
+ Thread.new {
begin
Thread.current[:i] = i
__sleep
@@ -341,7 +341,7 @@ class Middle < Up
class Down < Middle; end
puts "and basic \"Down test\" is #{Down.instance == Down.instance}\n
-Various exceptions"
+Various exceptions"
begin
module AModule
View
4 lib/webrick/httpservlet/cgihandler.rb
@@ -85,6 +85,10 @@ def do_GET(req, res)
res.status = $1.to_i
header.delete('status')
end
+ if header.has_key?('location')
+ # RFC 3875 6.2.3, 6.2.4
+ res.status = 302 unless (300...400) === res.status
+ end
if header.has_key?('set-cookie')
header['set-cookie'].each{|k|
res.cookies << Cookie.parse_set_cookie(k)
View
33 marshal.c
@@ -338,7 +338,7 @@ w_symbol(id, arg)
ID id;
struct dump_arg *arg;
{
- char *sym = rb_id2name(id);
+ const char *sym = rb_id2name(id);
st_data_t num;
if (st_lookup(arg->symbols, id, &num)) {
@@ -381,7 +381,7 @@ w_extended(klass, arg, check)
struct dump_arg *arg;
int check;
{
- char *path;
+ const char *path;
if (check && FL_TEST(klass, FL_SINGLETON)) {
if (RCLASS(klass)->m_tbl->num_entries ||
@@ -511,7 +511,7 @@ w_object(obj, arg, limit)
if (OBJ_TAINTED(obj)) arg->taint = Qtrue;
st_add_direct(arg->data, obj, arg->data->num_entries);
- if (rb_respond_to(obj, s_mdump)) {
+ if (rb_obj_respond_to(obj, s_mdump, Qtrue)) {
volatile VALUE v;
v = rb_funcall(obj, s_mdump, 0, 0);
@@ -521,7 +521,7 @@ w_object(obj, arg, limit)
if (ivtbl) w_ivar(0, &c_arg);
return;
}
- if (rb_respond_to(obj, s_dump)) {
+ if (rb_obj_respond_to(obj, s_dump, Qtrue)) {
VALUE v;
v = rb_funcall(obj, s_dump, 1, INT2NUM(limit));
@@ -664,7 +664,7 @@ w_object(obj, arg, limit)
{
VALUE v;
- if (!rb_respond_to(obj, s_dump_data)) {
+ if (!rb_obj_respond_to(obj, s_dump_data, Qtrue)) {
rb_raise(rb_eTypeError,
"no marshal_dump is defined for class %s",
rb_obj_classname(obj));
@@ -765,12 +765,12 @@ marshal_dump(argc, argv)
arg.str = rb_str_buf_new(0);
RBASIC(arg.str)->klass = 0;
if (!NIL_P(port)) {
- if (!rb_respond_to(port, s_write)) {
+ if (!rb_obj_respond_to(port, s_write, Qtrue)) {
type_error:
rb_raise(rb_eTypeError, "instance of IO needed");
}
arg.dest = port;
- if (rb_respond_to(port, s_binmode)) {
+ if (rb_obj_respond_to(port, s_binmode, Qtrue)) {
rb_funcall2(port, s_binmode, 0, 0);
reentrant_check(arg.str, s_dump_data);
}
@@ -948,7 +948,7 @@ r_symbol(arg)
return r_symreal(arg);
}
-static char*
+static const char*
r_unique(arg)
struct load_arg *arg;
{
@@ -1245,7 +1245,7 @@ r_object0(arg, proc, ivp, extmod)
VALUE klass = path2class(r_unique(arg));
VALUE data;
- if (!rb_respond_to(klass, s_load)) {
+ if (!rb_obj_respond_to(klass, s_load, Qtrue)) {
rb_raise(rb_eTypeError, "class %s needs to have method `_load'",
rb_class2name(klass));
}
@@ -1272,7 +1272,7 @@ r_object0(arg, proc, ivp, extmod)
rb_extend_object(v, m);
}
}
- if (!rb_respond_to(v, s_mload)) {
+ if (!rb_obj_respond_to(v, s_mload, Qtrue)) {
rb_raise(rb_eTypeError, "instance of %s needs to have method `marshal_load'",
rb_class2name(klass));
}
@@ -1299,7 +1299,7 @@ r_object0(arg, proc, ivp, extmod)
case TYPE_DATA:
{
VALUE klass = path2class(r_unique(arg));
- if (rb_respond_to(klass, s_alloc)) {
+ if (rb_obj_respond_to(klass, s_alloc, Qtrue)) {
static int warn = Qtrue;
if (warn) {
rb_warn("define `allocate' instead of `_alloc'");
@@ -1315,7 +1315,7 @@ r_object0(arg, proc, ivp, extmod)
rb_raise(rb_eArgError, "dump format error");
}
r_entry(v, arg);
- if (!rb_respond_to(v, s_load_data)) {
+ if (!rb_obj_respond_to(v, s_load_data, Qtrue)) {
rb_raise(rb_eTypeError,
"class %s needs to have instance method `_load_data'",
rb_class2name(klass));
@@ -1415,12 +1415,13 @@ marshal_load(argc, argv)
struct load_arg arg;
rb_scan_args(argc, argv, "11", &port, &proc);
- if (rb_respond_to(port, rb_intern("to_str"))) {
+ v = rb_check_string_type(port);
+ if (!NIL_P(v)) {
arg.taint = OBJ_TAINTED(port); /* original taintedness */
- StringValue(port); /* possible conversion */
+ port = v;
}
- else if (rb_respond_to(port, s_getc) && rb_respond_to(port, s_read)) {
- if (rb_respond_to(port, s_binmode)) {
+ else if (rb_obj_respond_to(port, s_getc, Qtrue) && rb_obj_respond_to(port, s_read, Qtrue)) {
+ if (rb_obj_respond_to(port, s_binmode, Qtrue)) {
rb_funcall2(port, s_binmode, 0, 0);
}
arg.taint = Qtrue;
View
2  mkconfig.rb
@@ -144,6 +144,8 @@ module Config
CONFIG["archdir"] = "$(rubylibdir)/$(arch)"
CONFIG["sitelibdir"] = "$(sitedir)/$(ruby_version)"
CONFIG["sitearchdir"] = "$(sitelibdir)/$(sitearch)"
+ CONFIG["vendorlibdir"] = "$(vendordir)/$(ruby_version)"
+ CONFIG["vendorarchdir"] = "$(vendorlibdir)/$(sitearch)"
CONFIG["topdir"] = File.dirname(__FILE__)
MAKEFILE_CONFIG = {}
CONFIG.each{|k,v| MAKEFILE_CONFIG[k] = v.dup}
View
2  numeric.c
@@ -2776,7 +2776,7 @@ static VALUE
fix_id2name(fix)
VALUE fix;
{
- char *name = rb_id2name(FIX2UINT(fix));
+ const char *name = rb_id2name(FIX2UINT(fix));
if (name) return rb_str_new2(name);
return Qnil;
}
View
11 object.c
@@ -314,7 +314,7 @@ VALUE
rb_any_to_s(obj)
VALUE obj;
{
- char *cname = rb_obj_classname(obj);
+ const char *cname = rb_obj_classname(obj);
size_t len;
VALUE str;
@@ -341,7 +341,7 @@ inspect_i(id, value, str)
VALUE str;
{
VALUE str2;
- char *ivname;
+ const char *ivname;
/* need not to show internal data */
if (CLASS_OF(value) == 0) return ST_CONTINUE;
@@ -397,9 +397,8 @@ rb_obj_inspect(obj)
&& ROBJECT(obj)->iv_tbl->num_entries > 0) {
VALUE str;
size_t len;
- char *c;
+ const char *c = rb_obj_classname(obj);
- c = rb_obj_classname(obj);
if (rb_inspecting_p(obj)) {
len = strlen(c)+10+16+1;
str = rb_str_new(0, len); /* 10:tags 16:addr 1:nul */
@@ -1161,7 +1160,7 @@ sym_inspect(sym)
VALUE sym;
{
VALUE str;
- char *name;
+ const char *name;
ID id = SYM2ID(sym);
name = rb_id2name(id);
@@ -2193,7 +2192,7 @@ convert_type(val, tname, method, raise)
ID m;
m = rb_intern(method);
- if (!rb_respond_to(val, m)) {
+ if (!rb_obj_respond_to(val, m, Qtrue)) {
if (raise) {
rb_raise(rb_eTypeError, "can't convert %s into %s",
NIL_P(val) ? "nil" :
View
20 pack.c
@@ -366,7 +366,7 @@ num2i32(x)
#endif
static const char toofew[] = "too few arguments";
-static void encodes _((VALUE,char*,long,int));
+static void encodes _((VALUE,const char*,long,int));
static void qpencode _((VALUE,VALUE,long));
static int uv_to_utf8 _((char*,unsigned long));
@@ -441,13 +441,13 @@ static VALUE
pack_pack(ary, fmt)
VALUE ary, fmt;
{
- static char *nul10 = "\0\0\0\0\0\0\0\0\0\0";
- static char *spc10 = " ";
+ static const char nul10[] = "\0\0\0\0\0\0\0\0\0\0";
+ static const char spc10[] = " ";
char *p, *pend;
VALUE res, from, associates = 0;
char type;
long items, len, idx, plen;
- char *ptr;
+ const char *ptr;
#ifdef NATINT_PACK
int natint; /* native integer */
#endif
@@ -1004,21 +1004,21 @@ pack_pack(ary, fmt)
return res;
}
-static char uu_table[] =
+static const char uu_table[] =
"`!\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_";
-static char b64_table[] =
+static const char b64_table[] =
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
static void
encodes(str, s, len, type)
VALUE str;
- char *s;
+ const char *s;
long len;
int type;
{
char *buff = ALLOCA_N(char, len * 4 / 3 + 6);
long i = 0;
- char *trans = type == 'u' ? uu_table : b64_table;
+ const char *trans = type == 'u' ? uu_table : b64_table;
int padding;
if (type == 'u') {
@@ -1304,7 +1304,7 @@ static VALUE
pack_unpack(str, fmt)
VALUE str, fmt;
{
- static char *hexdigits = "0123456789abcdef0123456789ABCDEFx";
+ static const char hexdigits[] = "0123456789abcdef0123456789ABCDEFx";
char *s, *send;
char *p, *pend;
VALUE ary;
@@ -1338,7 +1338,7 @@ pack_unpack(str, fmt)
}
star = 0;
if (*p == '_' || *p == '!') {
- char *natstr = "sSiIlL";
+ static const char natstr[] = "sSiIlL";
if (strchr(natstr, type)) {
#ifdef NATINT_PACK
View
10 parse.y
@@ -4524,7 +4524,7 @@ yylex()
}
if (lex_state != EXPR_DOT) {
- struct kwtable *kw;
+ const struct kwtable *kw;
/* See if it is a reserved word. */
kw = rb_reserved_word(tok(), toklen());
@@ -5178,7 +5178,7 @@ static void
void_expr0(node)
NODE *node;
{
- char *useless = 0;
+ const char *useless = 0;
if (!RTEST(ruby_verbose)) return;
@@ -5945,7 +5945,7 @@ rb_parser_while_loop(chop, split)
static struct {
ID token;
- char *name;
+ const char *name;
} op_tbl[] = {
{tDOT2, ".."},
{tDOT3, "..."},
@@ -6193,11 +6193,11 @@ rb_intern(name)
return id;
}
-char *
+const char *
rb_id2name(id)
ID id;
{
- char *name;
+ const char *name;
st_data_t data;
if (id < tLAST_TOKEN) {
View
53 range.c
@@ -278,7 +278,7 @@ step_i(i, arg)
* rng.step(n=1) {| obj | block } => rng
*
* Iterates over <i>rng</i>, passing each <i>n</i>th element to the block. If
- * the range contains numbers or strings, natural ordering is used. Otherwise
+ * the range contains numbers, <i>n</i> is added for each iteration. Otherwise
* <code>step</code> invokes <code>succ</code> to iterate through range
* elements. The following code uses class <code>Xs</code>, which is defined
* in the class-level documentation.
@@ -308,7 +308,6 @@ range_step(argc, argv, range)
VALUE range;
{
VALUE b, e, step, tmp;
- long unit;
RETURN_ENUMERATOR(range, argc, argv);
@@ -316,49 +315,56 @@ range_step(argc, argv, range)
e = rb_ivar_get(range, id_end);
if (argc == 0) {
step = INT2FIX(1);
- unit = 1;
}
else {
rb_scan_args(argc, argv, "01", &step);
- tmp = rb_check_to_integer(step, "to_int");
- if (!NIL_P(tmp)) {
- step = tmp;
- unit = NUM2LONG(step);
+ if (!rb_obj_is_kind_of(step, rb_cNumeric)) {
+ step = rb_to_int(step);
}
- else {
- tmp = rb_funcall(rb_funcall(b, '+', 1, step), '-', 1, b);
- unit = rb_cmpint(tmp, step, INT2FIX(0));
+ if (rb_funcall(step, '<', 1, INT2FIX(0))) {
+ rb_raise(rb_eArgError, "step can't be negative");
+ }
+ else if (!rb_funcall(step, '>', 1, INT2FIX(0))) {
+ rb_raise(rb_eArgError, "step can't be 0");
}
}
- if (unit < 0) {
- rb_raise(rb_eArgError, "step can't be negative");
- }
- if (unit == 0)
- rb_raise(rb_eArgError, "step can't be 0");
+
if (FIXNUM_P(b) && FIXNUM_P(e) && FIXNUM_P(step)) { /* fixnums are special */
long end = FIX2LONG(e);
- long i;
+ long i, unit = FIX2LONG(step);
- if (unit == 0) rb_raise(rb_eArgError, "step can't be 0");
- if (!EXCL(range)) end += 1;
+ if (!EXCL(range))
+ end += 1;
i = FIX2LONG(b);
while (i < end) {
rb_yield(LONG2NUM(i));
if (i + unit < i) break;
i += unit;
}
+
+ }
+ else if (rb_obj_is_kind_of(b, rb_cNumeric) ||
+ !NIL_P(rb_check_to_integer(b, "to_int")) ||
+ !NIL_P(rb_check_to_integer(e, "to_int"))) {
+ ID op = EXCL(range) ? '<' : rb_intern("<=");
+
+ while (RTEST(rb_funcall(b, op, 1, e))) {
+ rb_yield(b);
+ b = rb_funcall(b, '+', 1, step);
+ }
}
else {
- VALUE tmp = rb_check_string_type(b);
+ tmp = rb_check_string_type(b);
if (!NIL_P(tmp)) {
VALUE args[5], iter[2];
b = tmp;
- args[0] = b; args[1] = e; args[2] = range;
- iter[0] = INT2FIX(1); iter[1] = step;
- rb_iterate((VALUE(*)_((VALUE)))str_step, (VALUE)args, step_i,
- (VALUE)iter);
+ args[0] = e;
+ args[1] = EXCL(range) ? Qtrue : Qfalse;
+ iter[0] = INT2FIX(1);
+ iter[1] = step;
+ rb_block_call(b, rb_intern("upto"), 2, args, step_i, (VALUE)iter);
}
else if (rb_obj_is_kind_of(b, rb_cNumeric) ||
!NIL_P(rb_check_to_integer(b, "to_int")) ||
@@ -377,7 +383,6 @@ range_step(argc, argv, range)
rb_raise(rb_eTypeError, "can't iterate from %s",
rb_obj_classname(b));
}
-
args[0] = INT2FIX(1);
args[1] = step;
range_each_func(range, step_i, b, e, args);
View
9 re.c
@@ -595,7 +595,7 @@ static VALUE
rb_reg_kcode_m(re)
VALUE re;
{
- char *kcode;
+ const char *kcode;
if (FL_TEST(re, KCODE_FIXED)) {
switch (RBASIC(re)->flags & KCODE_MASK) {
@@ -1340,7 +1340,7 @@ match_string(match)
static VALUE
match_inspect(VALUE match)
{
- char *cname = rb_obj_classname(match);
+ const char *cname = rb_obj_classname(match);
VALUE str;
int i;
struct re_registers *regs = RMATCH(match)->regs;
@@ -1477,8 +1477,9 @@ rb_reg_regcomp(str)
case_cache = ruby_ignorecase;
kcode_cache = reg_kcode;
- return reg_cache = rb_reg_new(RSTRING(str)->ptr, RSTRING(str)->len,
- ruby_ignorecase);
+ reg_cache = rb_reg_new(RSTRING(str)->ptr, RSTRING(str)->len, ruby_ignorecase);
+ RB_GC_GUARD(save_str);
+ return reg_cache;
}
static int
View
9 ruby.c
@@ -65,7 +65,7 @@ static VALUE do_loop = Qfalse, do_print = Qfalse;
static VALUE do_check = Qfalse, do_line = Qfalse;
static VALUE do_split = Qfalse;
-static char *script;
+static const char *script;
static int origargc;
static char **origargv;
@@ -322,6 +322,13 @@ ruby_init_loadpath()
incpush(RUBY_RELATIVE(RUBY_SITE_ARCHLIB));
incpush(RUBY_RELATIVE(RUBY_SITE_LIB));
+ incpush(RUBY_RELATIVE(RUBY_VENDOR_LIB2));
+#ifdef RUBY_VENDOR_THIN_ARCHLIB
+ incpush(RUBY_RELATIVE(RUBY_VENDOR_THIN_ARCHLIB));
+#endif
+ incpush(RUBY_RELATIVE(RUBY_VENDOR_ARCHLIB));
+ incpush(RUBY_RELATIVE(RUBY_VENDOR_LIB));
+
incpush(RUBY_RELATIVE(RUBY_LIB));
#ifdef RUBY_THIN_ARCHLIB
incpush(RUBY_RELATIVE(RUBY_THIN_ARCHLIB));
View
6 ruby.h
@@ -538,11 +538,11 @@ void rb_gc_register_address _((VALUE*));
void rb_gc_unregister_address _((VALUE*));
ID rb_intern _((const char*));
-char *rb_id2name _((ID));
+const char *rb_id2name _((ID));
ID rb_to_id _((VALUE));