summaryrefslogtreecommitdiffhomepage
path: root/src/string.c
AgeCommit message (Collapse)Author
2016-12-12rename prefix RBASIC_ to MRB_; ref #3340Yukihiro "Matz" Matsumoto
2016-12-11Implement Object#freezeTakashi Kokubun
2016-12-08Removed unnecessary const macro - const keyword is already a dependencyFelix Jones
2016-12-08disable define const on VSYasuhiro Matsumoto
2016-12-07Removed the errno declaration from string.cFelix Jones
2016-12-07Wrapped string.c errno with ifndef macro for platforms that use inbuilt ↵Felix Jones
errno macro
2016-12-03add MRB_API to mrb_float_read(); ref #3270Yukihiro "Matz" Matsumoto
2016-12-03Import locale insensitive strtod() from Ruby1.8; fix #3270Yukihiro "Matz" Matsumoto
The function was renamed to `mrb_float_read(const char*, char**)`.
2016-11-24Get String length after args in String#chomp!Clayton Smith
Fixes RCE issue Reported by @bouk
2016-11-24Fixes for compiling mruby as C++Tomasz Dąbrowski
2016-11-17String#include? does not take integersYukihiro "Matz" Matsumoto
2016-11-16Correct argument specifications for few methods:Tomasz Dąbrowski
- Struct#values_at - Module#define_method - String#chop - String#chop!
2016-09-27mrb_str_strlen() should be MRB_API; ref #3216Yukihiro "Matz" Matsumoto
2016-09-25Remove needless MRB_APIKouhei Sutou
ref #3215 If a function (such as mrb_read_irep_file()) is declared without MRB_API in header file (such as include/mruby/dump.h), implementation of the function in source file (such as src/load.c) should also defined without MRB_API. If MRB_API is mismatch, Visual C++ reports link error with C2375 error code: https://msdn.microsoft.com/en-us/library/5k6kw95a.aspx
2016-02-05[cppcheck] mrb_str_rindex() remove unnecessary len update by chars2bytes()Yukihiro "Matz" Matsumoto
2016-02-04cache UTF8 status for utf8_strlen(); ref #980Yukihiro "Matz" Matsumoto
2016-01-14Fix all zero string caseSyohei YOSHIDA
2016-01-05bytes2chars() conversion to fail if target byte offset is not on the ↵Yukihiro "Matz" Matsumoto
character boundary; ref #3067 that means String#index matches first byte of a multi-byte character. this behavior is different from CRuby, but a compromise for mruby which does not have encoding stuffs.
2015-12-31Use memchr for performanceksss
```ruby s = "b" str = ("a" * 100 + s) t = Time.now str.index(s) puts Time.now - t ``` before => 0.000788 after => 0.000508 --- ```ruby s = "b" str = ("a" * 100 * 1024 * 1024 + s) t = Time.now str.index(s) puts Time.now - t ``` before => 0.225474 after => 0.008658
2015-12-22fix build on VS2012Yasuhiro Matsumoto
2015-12-16mrb_str_len_to_inum(): fixed a bug with MRB_INT_MIN conversion; fix #3048Yukihiro "Matz" Matsumoto
2015-12-16mrb_str_len_to_inum(): fixed a bug with underscores in digits; fix #3049Yukihiro "Matz" Matsumoto
2015-12-14mrb_str_len_to_inum(): string may not be NUL terminated; ref #3043Yukihiro "Matz" Matsumoto
2015-12-14mrb_str_len_to_inum(): fixed a bug with separating _ in the digits; ref #3043Yukihiro "Matz" Matsumoto
2015-12-12mrb_str_len_to_inum: should not raise "string contains null byte" error on ↵Yukihiro "Matz" Matsumoto
"0x"; fix #3043
2015-12-12mrb_str_len_to_inum: converting may not be terminated by NUL; fix #3044Yukihiro "Matz" Matsumoto
2015-12-01preserve original string for error messageYukihiro "Matz" Matsumoto
2015-12-01mrb_str_len_to_inum(): inspect string in error messageYukihiro "Matz" Matsumoto
2015-12-01new API function mrb_string_value_len()Yukihiro "Matz" Matsumoto
2015-12-01mrb_str_to_inum(): should treat null byte in strings properly; fix #3040Yukihiro "Matz" Matsumoto
2015-12-01mrb_cstr_to_inum(): should ignore trailing white spaces even when badcheck setYukihiro "Matz" Matsumoto
2015-12-01mrb_str_to_inum(): should raise error when string contains null byteYukihiro "Matz" Matsumoto
2015-12-01mrb_str_to_inum(): no need to call mrb_string_value_cstr() here; ref 05411eeYukihiro "Matz" Matsumoto
2015-12-01mrb_string_value_cstr() should not raise error for frozen stringsYukihiro "Matz" Matsumoto
cf. http://qiita.com/tsahara@github/items/b2a442af95ac893e10a1 (Japanese).
2015-11-27include changed from by quotes ("") to by brackets (<>); close #3032Yukihiro "Matz" Matsumoto
2015-10-20Increasing docs coverageSeba Gamboa
2015-09-29chop with utf-8. fix #2967Yasuhiro Matsumoto
2015-09-27fix String#inspect with MRB_UTF8_STRINGtakahashim
cf. #2963
2015-09-25inspect prints valid UTF-8 character without escapingYukihiro "Matz" Matsumoto
2015-09-25add boundary check to utf8len() to avoid oob memory accessYukihiro "Matz" Matsumoto
2015-09-24UTF-8 string support in coreYukihiro "Matz" Matsumoto
define MRB_UTF8_STRING (in mrbconf.h) to enable UTF-8 support.
2015-09-23String#rindex should no longer take integer argumentYukihiro "Matz" Matsumoto
2015-09-22String#index should no longer take integer argumentYukihiro "Matz" Matsumoto
2015-09-19Fix indentsJun Hiroe
2015-09-11Support windows localeYasuhiro Matsumoto
Add mrb_utf8_from_locale, mrb_utf8_free, mrb_locale_from_utf8, mrb_locale_free. Just works for windows.
2015-09-03unsigned long may be smaller than mrb_int; use uint64_t instead; fix #2935Yukihiro "Matz" Matsumoto
2015-09-02update string.h.md; ref #2931Yukihiro "Matz" Matsumoto
2015-08-27add String#freeze to the coreYukihiro "Matz" Matsumoto
2015-07-07Merge pull request #2877 from cremno/fix-dangling-ptrYukihiro "Matz" Matsumoto
Coverity: fix dangling pointer
2015-07-05Fix typo in comment in String#mrb_cstr_to_inum [skip ci]Anton Davydov