summaryrefslogtreecommitdiff
path: root/regex.c
AgeCommit message (Collapse)Author
2008-08-04merge revision(s) 18212:shyouhei
* regex.c (xmalloc, xrealloc, xfree): not to use ruby managed memory. * regex.c (DOUBLE_STACK, re_compile_fastmap0, re_adjust_startpos), (re_search, re_match_exec): check if failed to allocate memory. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_7@18345 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-06Merge changes from ruby_1_8 to reduce warnings and potentially improveknu
security. * mkconfig.rb: hide build path from rbconfig.rb. * util.c (ruby_strtod, dtoa): initialize more variables for error handling. * io.c (rscheck), marshal.c (w_nbyte, w_bytes, w_unique), (path2class, path2module): constified. * pack.c (pack_unpack), process.c (rb_syswait): suppress warnings. * suppress warnings on cygwin, mingw and mswin. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_7@16863 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-04-22Merge from ruby_1_8.knu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_7@16166 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-09-25* parse.y (yyerror): limit error message length. [ruby-dev:31848]nobu
* regex.c (re_mbc_startpos): separated from re_adjust_startpos. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@13513 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-02-27* regex.c (calculate_must_string, slow_search, re_search): Silenceknu
warnings regarding char * vs. unsigned char * mismatch; submitted by Lyle Johnson <lyle.johnson@gmail.com> in [ruby-core:10416]. * ext/bigdecimal/bigdecimal.c (BigDecimal_load): Ditto. * ext/digest/sha1/sha1ossl.c (SHA1_Finish): Ditto. * ext/digest/rmd160/rmd160ossl.c (RMD160_Finish): Ditto. * ext/digest/digest.c (rb_digest_base_finish, rb_digest_base_update): Ditto. * ext/nkf/nkf.c (rb_str_resize, rb_nkf_kconv, rb_nkf_guess1, rb_nkf_guess2): Ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@11905 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-08-07* dln.c, eval.c, gc.c, regex.c, ruby.h: shut up AIX allocamatz
warning. [ruby-dev:29191] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@10694 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-04-24* regex.c (re_compile_pattern): should check if c is not amatz
multibyte chracter. a patch from KIMURA Koichi <kimura.koichi at canon.co.jp>. [ruby-dev:28598] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@10106 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-10-18* regex.c (re_compile_pattern): numeric literal inside character classnobu
disabled succeeding backtrack. fixed: [ruby-list:41328] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@9410 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-07-10* regex.c (read_special): fix parsing backslashes following \c innobu
regexp. fixed: [ruby-dev:26500] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@8749 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-04-24* regex.c: declare rb_warn to have variadic argument. [ruby-core:4751]akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@8383 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-11-22* file.c (rb_file_chown): integer conversion should be prior tomatz
GetOpenFile(). [ruby-dev:24947] * file.c (rb_file_truncate): ditto. * file.c (rb_file_s_truncate): ditto. * dir.c (dir_seek): use NUM2OFFT(). * misc/ruby-mode.el (ruby-non-block-do-re): [ruby-core:03719] * dir.c (dir_seek): should retrieve dir_data after NUM2INT(). [ruby-dev:24941] * string.c (rb_str_splice): should place index wrapping after possible modification. [ruby-dev:24940] * eval.c (error_print): nicer traceback at interrupt. [ruby-core:03774] * string.c (str_gsub): internal buffer should not be listed by ObjectSpace.each_object() by String#gsub. [ruby-dev:24931] * lib/cgi/session.rb (CGI::Session::FileStore::initialize): raise exception if data corresponding to session specified from the client does not exist. * string.c (str_gsub): internal buffer should not be listed by ObjectSpace.each_object(). [ruby-dev:24919] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@7354 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-11-08* regex.c (slow_match): avoid GCC 3.4.x warnings.eban
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@7230 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-10-27* string.c (RESIZE_CAPA): check string attribute before modifyingmatz
capacity member of string structure. [ruby-dev:24594] * ext/zlib/zlib.c (gzreader_gets): use memchr() to to gain performance. [ruby-talk:117701] * sprintf.c (rb_f_sprintf): raise ArgumentError for extra arguments, unless (digit)$ style used. * ext/zlib/zlib.c (gzreader_gets): use memchr() to to gain performance. [ruby-talk:117701] * sprintf.c (rb_f_sprintf): raise ArgumentError for extra arguments, unless (digit)$ style used. * eval.c (frame_free): Guy Decoux solved the leak problem. Thanks. [ruby-core:03549] * ext/zlib/zlib.c (zstream_append_input): clear klass for z->input to avoid potential vulnerability. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@7119 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-01-26* parse.y (block_append): update nd_end for "real" head node.matz
[ruby-list:39058] * eval.c (proc_eq): Proc with empty body may not be equal. [ruby-dev:22590] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@5556 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-12-24* eval.c (catch_timer): do not call rb_thread_schedule() inside tomatz
avoid pthread_mutex_lock() deadlock. interrupts to system calls are detected by TRAP_END via EINTR error. * eval.c (thread_timer): do not post signal unless it is absolutely necessary. * rubysig.h (TRAP_END): add CHECK_INTS to switch thread. * regex.c (re_compile_pattern): check if nextp is smaller than pend. [ruby-dev:22372] * eval.c (umethod_bind): remove method overridden check. [ruby-dev:22366] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5279 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-09-30* eval.c (rb_eval): while/until should not capture break unlessmatz
they are destination of the break. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4629 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-09-16* regex.c (re_compile_pattern): should not translate charactermatz
class range edge. [ruby-list:38393] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4557 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-07-29* marshal.c (w_object): if object responds to 'marshal_dump',matz
Marshal.dump uses it to dump object. unlike '_dump', marshal_dump returns any kind of object. * marshal.c (r_object0): restore instance by calling 'marshal_load' method. unlike '_load', it's an instance method, to handle cyclic reference. * marshal.c (marshal_load): all objects read from file should be tainted. [ruby-core:01325] * lib/timeout.rb (Timeout::timeout): execute immediately if sec is zero. * ext/socket/socket.c (socks_init): typo fixed. [ruby-talk:77232] * ext/socket/extconf.rb: the default value for --enable-socks is taken from ENV["SOCKS_SERVER"]. [ruby-talk:77232] * ruby.c (proc_options): add -W option. -W0 to shut up all warning messages. [ruby-talk:77227] * error.c (rb_warn): no message will be printed if the value of $VERBOSE is "nil", i.e. perfect silence. * ruby.c (verbose_setter): $VERBOSE value is either true, false, or nil. * io.c (Init_IO): no "read" check for $stdin. in addition some function names has been changed. * regex.c (re_match_exec): incorrect multibyte match. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4220 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-07-24* gcc -Wall clean-up.matz
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4151 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-07-09* regex.c (mbctab_sjis): 0x80 is not shift jis first byte.nobu
[ruby-dev:20516] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4048 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-06-16* regex.c (calculate_must_string): should handle option_setmatz
properly. [ruby-talk:73481] * regex.c (re_compile_fastmap): a bug in flag manipulation. [ruby-talk:73549] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3944 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-05-14* regex.c (re_match_exec): \Z changed to be consistent with new $matz
(endbuf) behavior. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3792 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-05-01* regex.c (re_match_exec): $ _always_ matches at the end of string.matz
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3739 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-04-18* struct.c (rb_struct_eql): should compare values with "eql?".matz
* range.c (range_check): <=> returns nil for invalid values; should check. * regex.c (re_compile_pattern): should not set RE_OPTIMIZE_ANCHOR, if anychar_repeat is enclosed by parentheses. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3695 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-04-09* regex.c (re_compile_pattern): /[\--\-]/ was warned. warn /]/.akr
* mkconfig.rb: escape `]' in regexp. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3660 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-04-08* eval.c (Init_Proc): make Method and UnboundMethod independent.matz
They are like instance and its class. [ruby-core:00941] * parse.y (yylex): disallow global variables like "$1ve". [ruby-core:00945] * marshal.c (marshal_dump): Marshal.dump(0, false) should cause an error. (ruby-bugs-ja PR#421) * regex.c (re_compile_pattern): warn if '-' is the edge of character range. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3648 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-03-29* eval.c (avalue_to_svalue): use rb_check_array_type() again.matz
Clarify how "to_ary" and "to_a" work. [ruby-talk:68155] * eval.c (svalue_to_avalue): ditto. * eval.c (svalue_to_mrhs): ditto. * eval.c (rb_eval): unary splat to use to_a, but we need a hack to exclude Object#to_a until it's removed. * object.c (rb_Array): check obj.respond_to?("to_a"). Currently all object respond_to "to_a", but Object#to_a will be removed. * range.c (Init_Range): undefine to_ary. * re.c (Init_Regexp): ditto. * regex.c (re_compile_pattern): do not warn if "-" is at the top or last of character class. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3633 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-03-27* regex.c (re_compile_pattern): fix [:name:] handling.akr
/[\[:digit:]]/ was treated as /[[:digit:]]/. /[[:-@]/ was treated as /[\[:\-@]/. /[%-[:digit:]]/ was treated as /[%-\[:digit:]\]/. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3623 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-03-21* regex.c (re_compile_pattern): fix previous change.akr
* instruby.rb, ext/extmk.rb, ext/tk/lib/tk.rb, lib/benchmark.rb, lib/cgi.rb, lib/debug.rb, lib/getoptlong.rb, lib/jcode.rb, lib/optparse.rb, lib/time.rb, lib/date/format.rb, lib/irb/ruby-lex.rb: escape `[', `]', `-' in chracter class in regexp to avoid warning. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3595 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-03-21* regex.c (re_compile_pattern): give warning for unescaped squarematz
brackets and minus in character class. [ruby-dev:19868] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3593 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-01-24* parse.y: tMINUS should have lower precedence than tPOW.matz
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3405 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-01-23* parse.y (arg): syntaxify tPOW negative number hack.matz
* parse.y (negate_lit): new function to negate literal numeric values in compile time. * regex.c (re_match_exec): charset info may be stored in MBC region when $KCODE != NONE. * error.c (set_syserr): should preserve duplicated error names. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3397 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-01-20* regex.c (is_in_list): should work weill with UTF-8.matz
* regex.c (re_match_exec): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3363 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-01-02* regex.c (re_match):nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3277 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-12-25* regex.c (re_match_exec): fix odd \G behavior based on the patchmatz
from Nobu. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3216 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-11-22* file.c (rb_find_file_ext): should not terminate searching withmatz
empty path, just ignore. * dir.c: remove <sys/parm.h> inclusion. * compar.c (cmp_eq,cmp_gt,cmp_ge,cmp_lt,cmp_le): check using rb_cmpint(). * error.c (init_syserr): remove sys_nerr dependency. * numeric.c (num_cmp): added to satisfy Comparable assumption. * eval.c (rb_add_method): "initialize" should be public if it is a singleton method. * regex.c (re_match): avoid dereferencing if size == 0. (ruby-bugs-ja:PR#360) * time.c (time_cmp): should return nil if an operand is not a number nor time. (ruby-bugs-ja:PR#359) * file.c (rb_stat_cmp): should return nil if an operand is not File::Stat. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3076 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-09-26* regex.c (re_match): p1 may exceed pend limit.matz
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2891 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-09-25* dir.c (glob_helper): must not closedir() when exception raisednobu
while globbing "**". * marshal.c (w_uclass): unused variable. * re.c (match_clone): unused. * regex.c (re_compile_pattern): get rid of implicit promotion from plain char to int. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2890 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-06-14* parse.y (read_escape): deny zero-width hexadecimal character.nobu
(ruby-bugs-ja:PR#260) * parse.y (tokadd_escape): ditto. * regex.c (re_compile_pattern): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2568 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-05-21* object.c (Init_Object): should do exact match for Module#==.matz
* compar.c (cmp_eq): returns 'false' if <=> returns 'nil'. * compar.c (cmp_gt,cmp_ge,cmp_lt,cmp_le,cmp_between): ditto. * pack.c (pack_pack): should propagate taintedness. * pack.c (pack_unpack): ditto. * eval.c (rb_thread_schedule): need to preserve errno before calling rb_trap_exec(). * regex.c (calculate_must_string): a bug in charset/charset_not parsing. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2482 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-04-25* various files: macro fix-up by Michal Rokos.matz
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2411 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-04-24* io.c (rb_io_mode_flags): both 'r+b' and 'rb+' should be allowed.matz
* io.c (rb_io_mode_modenum): ditto. * gc.c (rb_memerror): rename from mem_error, and exported. * gc.c (Init_GC): pre-allocate NoMemoryError instance. * object.c (convert_type): error message changed from "failed to convert" to "cannot convert", since it does not try to convert if an object does not respond to the converting method. * eval.c (block_pass): convert Method to Proc using rb_check_convert_type(). * object.c (rb_check_convert_type): always convert T_DATA * eval.c (rb_thread_cleanup): should not terminate main_thread by Fatal error. * regex.c (is_in_list): need to not exclude NUL and NEWLINE. * re.c (rb_reg_expr_str): wrong backslash escapement. * re.c (rb_reg_expr_str): do not escape embedded space characters. * marshal.c (w_object): T_DATA process patch from Joel VanderWerf <vjoel@PATH.Berkeley.EDU>. This is temporary hack; it remains undocumented, and it will be removed when marshaling is re-designed. * marshal.c (r_object): ditto. * numeric.c (num_step): Integer#step is moved to Numeric#step; Fixnum#step is merged into this method. * numeric.c (int_dotimes): Fixnum#times is merged. * numeric.c (int_upto): Fixnum#upto is merged. * numeric.c (int_downto): Fixnum#downto is merged. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2401 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-04-19* eval.c (rb_thread_cleanup): current thread may be THREAD_STOPPED,matz
for example when terminated from signal handler. * regex.c (re_compile_pattern): remove /p support. * regex.h: ditto. * parse.y (parse_regx): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2385 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-03-25* regex.c (mbc_startpos_func): VC6 seems to be unable tonobu
understand forward declaration for static variables. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2274 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-03-25* regex.c (mbc_startpos_func): shoud be static.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2265 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-03-12* regex.c (re_compile_pattern): '\0111' should be '\011' plus '1',matz
since octal literals are formed by three digits at most. * marshal.c (w_object): module inclusion using extend() should also be detected. * eval.c (rb_eval_cmd): cbase should not be NULL; it should be either ruby_wrapper or Object. * enum.c (enum_each_with_index): should return self. * process.c (proc_setpgrp): should return value for non-void function. * process.c (proc_getpgid): should raise exception if getpgid() return -1. * string.c (rb_str_ljust): should return a duplicated string. * string.c (rb_str_rjust): ditto. * string.c (rb_str_center): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2187 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-02-19* eval.c (rb_eval_string_wrap): should hide the toplevel localmatz
variable bindings by PUSH_SCOPE(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2089 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-02-19* regex.c: fix prototypes of xmalloc(), xcalloc() and xrealloc().eban
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2087 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-02-16* regex.c (re_compile_fastmap): skip begpos.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2074 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-02-01* regex.c (mbc_startpos): become macro.nobu
* regex.c (euc_startpos): added for improvement. * regex.c (sjis_startpos): ditto. * regex.c (utf8_startpos): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2040 b2dd03c8-39d4-4d8f-98ff-823fe69b080e