summaryrefslogtreecommitdiff
path: root/regex.c
AgeCommit message (Collapse)Author
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
2002-01-30* regex.c (re_adjust_startpos): fix for SJIS.nobu
* regex.c (mbc_startpos): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2032 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-01-29* regex.c (re_adjust_startpos): search start of multibytenobu
backward. * regex.c (mbc_startpos): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2031 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-01-23* array.c (Init_Array): remove Array#filter.matz
* object.c (rb_mod_initialize): should accept zero argument. * object.c (rb_mod_cmp): should raise ArgumentError if inheritance/inclusion relation between two classes/modules is not defined. [new] * io.c (rb_io_fsync): new method. [new] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2014 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-01-07* string.c (rb_str_new2): NULL pointer check added.matz
* class.c (rb_define_module_under): should locate predefined module using rb_const_defined_at(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1969 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-01-04* process.c (rb_f_system): abandon vfork.matz
* io.c (pipe_open): ditto. * defines.h: sparc linux needs different FLUSH_REGISTER_WINDOWS * regex.c (re_search): abandon stclass optimization. * bignum.c (rb_cstr2inum): deny "0_". * bignum.c (rb_cstr2inum): allow "0\n" and so on. * error.c (rb_invalid_str): utility function to show inspect()'ed string. * bignum.c (rb_cstr2inum): prints invalid strings in inspect()'ed format. * object.c (rb_Float): ditto. * object.c (rb_convert_type): no longer use rb_rescue(). * re.c (rb_reg_search): initialize taint status of match object. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1959 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-12-10* array.c (rb_ary_modify): should copy the internal buffer if thematz
modifying buffer is shared. * array.c (ary_make_shared): make an internal buffer of an array to be shared. * array.c (rb_ary_shift): avoid sliding an internal buffer by using shared buffer. * array.c (rb_ary_subseq): avoid copying the buffer. * parse.y (gettable): should freeze __LINE__ string. * io.c (rb_io_puts): old behavoir restored. rationale: a) if you want to call to_s for arrays, you can just call print a, "\n". b) to_s wastes memory if array (and sum of its contents) is huge. c) now any object that has to_ary is treated as an array, using rb_check_convert_type(). * hash.c (rb_hash_initialize): now accepts a block to calculate the default value. [new] * hash.c (rb_hash_aref): call "default" method to get the value corrensponding to the non existing key. * hash.c (rb_hash_default): get the default value based on the block given to 'new'. Now it takes an optinal "key" argument. "default" became the method to get the value for non existing key. Users may override "default" method to change the hash behavior. * hash.c (rb_hash_set_default): clear the flag if a block is given to 'new' * object.c (Init_Object): undef Data.allocate, left Data.new. * ext/curses/curses.c (window_scrollok): use RTEST(). * ext/curses/curses.c (window_idlok): ditto. * ext/curses/curses.c (window_keypad): ditto. * ext/curses/curses.c (window_idlok): idlok() may return void on some platforms; so don't use return value. * ext/curses/curses.c (window_scrollok): ditto for consistency. * ext/curses/curses.c: replace FIX2INT() by typechecking NUM2INT(). * parse.y (str_extend): should not process immature #$x and #@x interpolation, e.g #@#@ etc. * enum.c (enum_sort_by): sort_by does not have to be stable always. * enum.c (enum_sort_by): call qsort directly to gain performance. * util.c (ruby_qsort): ruby_qsort(qs6) is now native thread safe. * error.c (rb_sys_fail): it must be a bug if it's called when errno == 0. * regex.c (WC2MBC1ST): should not pass through > 0x80 number in UTF-8. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1896 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-10-30* string.c (rb_str_chomp_bang): do smart chomp if $/ == '\n'.matz
* io.c (rb_io_puts): don't treat Array specially. * bignum.c (rb_big_cmp): should convert bignum to float. * eval.c (rb_f_eval): can't modify untainted binding. * regex.c (re_compile_pattern): should preverve p0 value. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1803 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-10-03* marshal.c (r_object): better allocation type check formatz
TYPE_UCLASS. usage of allocation framework is disabled for now. * variable.c (rb_class_path): Module may have subclass. * string.c (rb_str_update): should maintain original negative offset. * string.c (rb_str_subpat_set): ditto * string.c (rb_str_aset): ditto. * re.c (rb_reg_nth_match): should check negative nth. * re.c (rb_reg_nth_defined): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1764 b2dd03c8-39d4-4d8f-98ff-823fe69b080e