summaryrefslogtreecommitdiffhomepage
path: root/mrbgems/mruby-string-ext/src/string.c
AgeCommit message (Collapse)Author
2017-06-16Use `MRB_PRId` instead of `d` for mrb_int decimal specifier; ref #3701Yukihiro "Matz" Matsumoto
2017-06-16Use `mrb_str_new()` instead of `malloc()`; ref #3701Yukihiro "Matz" Matsumoto
Otherwise the function may terminate and cause memory leaks.
2017-06-16Should not use `sizeof(buf)` when `buf` is `char*`; #3701Yukihiro "Matz" Matsumoto
2017-06-14Use malloc instead of dynamic allocationksss
2017-06-14Fix arena overflow errorksss
2017-06-14Reimplement String#uptoksss
2017-05-21String#concat: Try to convert when not stringksss
2017-04-25Silence warnings caused by implicit type casting.Yukihiro "Matz" Matsumoto
2017-04-03Unify `else` clause styleYukihiro "Matz" Matsumoto
2017-02-10String#ljust and String#rjust reimplemented with optimized RubyTomasz Dabrowski
2017-02-10String#ljust and String#rjust reimplementation (fix #3445)Tomasz Dabrowski
- String#ljust and String#rjust are now C functions to improve performance - infinite loop because of an empty padding argument is now prevented (ArgumentError is raised) - extra tests for ljust/rjust added
2017-01-23Changed the behavior of mrb_range_beg_len(); close #3411Yukihiro "Matz" Matsumoto
The new API is: int mrb_range_beg_len(mrb, range, &beg, &len, len, trunc) The new argument `trunc` is a boolean value that specifies whether the function truncates the range. The new return value is an integer instead of a boolean, that is: 0: not a range 1: range with proper edges 2: out of range To get the old behavior, you have to rewrite: mrb_range_beg_len(mrb, range, &beg, &len, len) to: mrn_range_beg_len(mrb, range, &beg, &len, len, TRUE) == 1 [Breaking Change]
2017-01-04Rewrite String#prepend with Rubyksss
Fix #3357
2016-12-28save/restore arena index around yield; ref #3359Yukihiro "Matz" Matsumoto
2016-11-24Read length after args in String#setbyteCraig Lehmann
Prevents RCE Reported by https://hackerone.com/raydot
2016-11-16Fixed memory disclosure in String#linesYukihiro "Matz" Matsumoto
Reported from from Alex Snaps via Mathieu Leduc-Hamel, both from shopify.com. Thank you!
2016-08-17Fix String#ord failure which return a negative valueHiroshi Mimaki
2015-11-27include changed from by quotes ("") to by brackets (<>); close #3032Yukihiro "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-08-05add String#setbyte and String#byteslice to mruby-string-extYukihiro "Matz" Matsumoto
2015-05-28remove unnecessary including of <ctype.h>cremno
Not needed anymore since 85075bef7583edd0a48cfbdfaa632cbdacf78f2c
2015-04-18Suppress warnings generated by -Wwrite-stringsKouhei Sutou
Here are suppressed warnings: src/fmt_fp.c: In function 'fmt_fp': src/fmt_fp.c:124:16: warning: initialization discards 'const' qualifier from pointer target type char *ss = (t&32)?"inf":"INF"; ^ src/fmt_fp.c:125:17: warning: assignment discards 'const' qualifier from pointer target type if (y!=y) ss=(t&32)?"nan":"NAN"; ^ mrbgems/mruby-string-ext/src/string.c: In function 'mrb_str_succ_bang': mrbgems/mruby-string-ext/src/string.c:302:27: warning: assignment discards 'const' qualifier from pointer target type if (e == b) prepend = "1"; ^ mrbgems/mruby-string-ext/src/string.c:305:27: warning: assignment discards 'const' qualifier from pointer target type if (e == b) prepend = "a"; ^ mrbgems/mruby-string-ext/src/string.c:308:27: warning: assignment discards 'const' qualifier from pointer target type if (e == b) prepend = "A"; ^ mrbgems/mruby-bin-mruby/tools/mruby/mruby.c: In function 'main': mrbgems/mruby-bin-mruby/tools/mruby/mruby.c:213:13: warning: assignment discards 'const' qualifier from pointer target type cmdline = args.cmdline ? args.cmdline : "-"; ^ mrbgems/mruby-bin-debugger/tools/mrdb/cmdbreak.c: In function 'print_breakpoint': mrbgems/mruby-bin-debugger/tools/mrdb/cmdbreak.c:159:3: warning: initialization discards 'const' qualifier from pointer target type char* enable_letter[] = {BREAK_INFO_MSG_DISABLE, BREAK_INFO_MSG_ENABLE}; ^ mrbgems/mruby-bin-debugger/tools/mrdb/cmdbreak.c:159:3: warning: initialization discards 'const' qualifier from pointer target type
2014-12-17mrb_str_new(mrb, "", len) creates an unmodifiable string object; ref #2674Yukihiro "Matz" Matsumoto
2014-12-17Add String#prependJun Hiroe
2014-08-21use mrb_str_cat_lit() instead of mrb_str_cat_cstr().Tatsuhiko Kubo
2014-08-11"-a-a-".succ should be "-a-b-"mattn
2014-08-11Fix String#succ. "-a-".succ should be "-b-"mattn
2014-08-11Fix String#succ. "-".succ should be "."mattn
2014-08-08Add String#succ, String#succ!, String#next, String#next!mattn
2014-06-11String#clear: use String#replace to simpleksss
2014-06-11Add NOFREE macrosJun Hiroe
2014-06-07move String#clear to mruby-string-ext; ref #2370Yukihiro "Matz" Matsumoto
2014-06-04fix String#lines comment; ref mattn@2e1855aYukihiro "Matz" Matsumoto
2014-06-04Add String#linesmattn
2014-06-03Implement String#chrJun Hiroe
2014-04-25Use mrb_int in mrbgem rest argument getting.take_cheeze
2014-04-14reduce RSTRING_PTR usagecremno
2014-03-27add String#octcubicdaiya
2014-03-27Implement String#hexmattn
2014-03-06make embed string when create literalsksss
2014-03-06embed small stringksss
use flags 4 for *this object is embed* use flags 8~64 for *embed string length*
2014-01-07remove superfluous includescremno
- reduce compile time by a little bit (full-core: ~0.7s for me) - thanks to 'include-what-you-use' for some help - include Standard C header files before any other (coding style)
2013-08-26Merge branch 'mruby' into pr-typeerror-string-start-end-withTomoyuki Sahara
Conflicts: mrbgems/mruby-string-ext/src/string.c mrbgems/mruby-string-ext/test/string.rb
2013-08-26Merge pull request #1485 from fjmilens3/string_end_withYukihiro "Matz" Matsumoto
Bug in String#end_with? resulting from incorrect length determination
2013-08-23Check type of arguments for #start_with and #end_with.Tomoyuki Sahara
2013-08-22Refactor of String#start_with? comparison logic.Frederick John Milens III
2013-08-22Refactor of String#end_with? comparison logic.Frederick John Milens III
2013-08-22Fix for string-length-related issue in String#end_with? logic.Frederick John Milens III
2013-08-22Fix for string-length-related issue in String#start_with? logic.Frederick John Milens III
2013-04-25rename every ARGS_XXX to MRB_ARGS_XXX; ref #1206Yukihiro "Matz" Matsumoto