mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* string.c (rb_str_match): raise TypeError when both arguments are
strings. [ruby-dev:22869] (backported from HEAD) * string.c (rb_str_match2): removed. * Makefile.in, bcc32/Makefile.sub, win32/Makefile.sub, wince/Makefile.sub (string.c): now not depend on version.h. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@6594 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
03e766f2c3
commit
b97aa9b90e
6 changed files with 16 additions and 31 deletions
10
ChangeLog
10
ChangeLog
|
|
@ -1,3 +1,13 @@
|
|||
Wed Jul 7 15:53:14 2004 NAKAMURA Usaku <usa@ruby-lang.org>
|
||||
|
||||
* string.c (rb_str_match): raise TypeError when both arguments are
|
||||
strings. [ruby-dev:22869] (backported from HEAD)
|
||||
|
||||
* string.c (rb_str_match2): removed.
|
||||
|
||||
* Makefile.in, bcc32/Makefile.sub, win32/Makefile.sub,
|
||||
wince/Makefile.sub (string.c): now not depend on version.h.
|
||||
|
||||
Wed Jul 7 00:48:34 2004 WATANABE Hirofumi <eban@ruby-lang.org>
|
||||
|
||||
* ext/tk/lib/tkextlib/tktrans.rb,
|
||||
|
|
|
|||
|
|
@ -370,7 +370,7 @@ signal.@OBJEXT@: signal.c ruby.h config.h defines.h intern.h missing.h \
|
|||
sprintf.@OBJEXT@: sprintf.c ruby.h config.h defines.h intern.h missing.h
|
||||
st.@OBJEXT@: st.c config.h st.h
|
||||
string.@OBJEXT@: string.c ruby.h config.h defines.h intern.h missing.h \
|
||||
re.h regex.h version.h
|
||||
re.h regex.h
|
||||
struct.@OBJEXT@: struct.c ruby.h config.h defines.h intern.h missing.h
|
||||
time.@OBJEXT@: time.c ruby.h config.h defines.h intern.h missing.h
|
||||
util.@OBJEXT@: util.c ruby.h config.h defines.h intern.h missing.h util.h
|
||||
|
|
|
|||
|
|
@ -577,7 +577,7 @@ ruby.obj: ruby.c ruby.h config.h defines.h intern.h missing.h dln.h node.h util.
|
|||
signal.obj: signal.c ruby.h config.h defines.h intern.h missing.h rubysig.h win32.h
|
||||
sprintf.obj: sprintf.c ruby.h config.h defines.h intern.h missing.h win32.h
|
||||
st.obj: st.c config.h st.h
|
||||
string.obj: string.c ruby.h config.h defines.h intern.h missing.h re.h regex.h version.h win32.h
|
||||
string.obj: string.c ruby.h config.h defines.h intern.h missing.h re.h regex.h win32.h
|
||||
struct.obj: struct.c ruby.h config.h defines.h intern.h missing.h win32.h
|
||||
time.obj: time.c ruby.h config.h defines.h intern.h missing.h win32.h
|
||||
util.obj: util.c ruby.h config.h defines.h intern.h missing.h util.h win32.h
|
||||
|
|
|
|||
27
string.c
27
string.c
|
|
@ -14,7 +14,6 @@
|
|||
|
||||
#include "ruby.h"
|
||||
#include "re.h"
|
||||
#include "version.h"
|
||||
|
||||
#define BEG(no) regs->beg[no]
|
||||
#define END(no) regs->end[no]
|
||||
|
|
@ -1248,11 +1247,8 @@ rb_str_match(x, y)
|
|||
|
||||
switch (TYPE(y)) {
|
||||
case T_STRING:
|
||||
#if RUBY_VERSION_CODE < 182
|
||||
rb_warn("string =~ string will be obsolete; use explicit regexp");
|
||||
#endif
|
||||
y = rb_reg_regcomp(y);
|
||||
/* fall through */
|
||||
rb_raise(rb_eTypeError, "type mismatch: String given");
|
||||
|
||||
case T_REGEXP:
|
||||
return rb_reg_match(y, x);
|
||||
|
||||
|
|
@ -1262,24 +1258,6 @@ rb_str_match(x, y)
|
|||
}
|
||||
|
||||
|
||||
/*
|
||||
* call-seq:
|
||||
* ~str => fixnum or nil
|
||||
*
|
||||
* Equivalent to <code>$_</code><code>=~ <i>str</i></code>.
|
||||
*/
|
||||
|
||||
static VALUE
|
||||
rb_str_match2(str)
|
||||
VALUE str;
|
||||
{
|
||||
StringValue(str);
|
||||
#if RUBY_VERSION_CODE < 182
|
||||
rb_warn("~string will be obsolete; use explicit regexp");
|
||||
#endif
|
||||
return rb_reg_match2(rb_reg_regcomp(rb_reg_quote(str)));
|
||||
}
|
||||
|
||||
static VALUE get_pat _((VALUE, int));
|
||||
|
||||
|
||||
|
|
@ -4594,7 +4572,6 @@ Init_String()
|
|||
rb_define_method(rb_cString, "size", rb_str_length, 0);
|
||||
rb_define_method(rb_cString, "empty?", rb_str_empty, 0);
|
||||
rb_define_method(rb_cString, "=~", rb_str_match, 1);
|
||||
rb_define_method(rb_cString, "~", rb_str_match2, 0);
|
||||
rb_define_method(rb_cString, "match", rb_str_match_m, 1);
|
||||
rb_define_method(rb_cString, "succ", rb_str_succ, 0);
|
||||
rb_define_method(rb_cString, "succ!", rb_str_succ_bang, 0);
|
||||
|
|
|
|||
|
|
@ -659,8 +659,7 @@ sprintf.obj: {$(srcdir)}sprintf.c {$(srcdir)}ruby.h config.h \
|
|||
st.obj: {$(srcdir)}st.c config.h {$(srcdir)}st.h
|
||||
string.obj: {$(srcdir)}string.c {$(srcdir)}ruby.h config.h \
|
||||
{$(srcdir)}defines.h {$(srcdir)}intern.h {$(srcdir)}missing.h \
|
||||
{$(srcdir)}re.h {$(srcdir)}regex.h {$(srcdir)}version.h \
|
||||
{$(srcdir)}/win32/win32.h
|
||||
{$(srcdir)}re.h {$(srcdir)}regex.h {$(srcdir)}/win32/win32.h
|
||||
struct.obj: {$(srcdir)}struct.c {$(srcdir)}ruby.h config.h \
|
||||
{$(srcdir)}defines.h {$(srcdir)}intern.h {$(srcdir)}missing.h \
|
||||
{$(srcdir)}/win32/win32.h
|
||||
|
|
|
|||
|
|
@ -699,8 +699,7 @@ sprintf.obj: {$(srcdir)}sprintf.c {$(srcdir)}ruby.h config.h \
|
|||
st.obj: {$(srcdir)}st.c config.h {$(srcdir)}st.h
|
||||
string.obj: {$(srcdir)}string.c {$(srcdir)}ruby.h config.h \
|
||||
{$(srcdir)}defines.h {$(srcdir)}intern.h {$(srcdir)}missing.h \
|
||||
{$(srcdir)}re.h {$(srcdir)}regex.h {$(srcdir)}version.h \
|
||||
{$(srcdir)}/win32/win32.h
|
||||
{$(srcdir)}re.h {$(srcdir)}regex.h {$(srcdir)}/win32/win32.h
|
||||
struct.obj: {$(srcdir)}struct.c {$(srcdir)}ruby.h config.h \
|
||||
{$(srcdir)}defines.h {$(srcdir)}intern.h {$(srcdir)}missing.h \
|
||||
{$(srcdir)}/win32/win32.h
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue