summaryrefslogtreecommitdiff
path: root/ext/stringio
AgeCommit message (Collapse)Author
2018-08-07Removed needless date attribute from gemspec of default gems.hsbt
They are assigned automatically when pushing gem file to rubygems.org. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64213 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-02-16no ID cache in Init functionsnobu
Init functions are called only once, cache is useless. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62429 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-22[DOC] StringIO#write accepts multiple arguments since r60377 [ci skip]kazu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61407 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-23stringio.c: write multiple argumentsnobu
* ext/stringio/stringio.c (strio_write_m): make StringIO#write accept multiple arguments, as well as IO#write. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60377 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-09-27ext: adjust indent [ci skip]nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60042 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-09-15To use github url for gemspec.hsbt
[Bug #13906][ruby-core:82817] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59931 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-09-14Update gemspec for gem released versions.hsbt
* These are dbm, fcntl, io-console, sdbm, stringio, strscan, zlib, cmath, scanf. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59873 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-08-13stringio.c: suppress a warning [ci skip]nobu
* ext/stringio/stringio.c (strio_read): suppress an implicit-fallthrough warning. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59583 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-08-13stringio.c: encoding at empty chomped resultnobu
* ext/stringio/stringio.c (strio_gets): should return string with the external encoding, at empty chomped result . git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59582 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-08-13stringio.c: encoding at empty resultnobu
* ext/stringio/stringio.c (strio_gets): should return string with the external encoding, at empty result. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59581 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-08-12stringio.c: encoding at EOFnobu
* ext/stringio/stringio.c (strio_read): should return string with the external encoding, at EOF too. [ruby-core:82349] [Bug #13806] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59578 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-06-19Make string literal to frozen object on gemspec of defulte gems.hsbt
Added following gemspecs. * extensions: date, dbm, etc, fiddle, gdbm, sdbm, stringio, strscan, zlib * pure ruby libraries: cmath, csv, fileutils, scanf, webrick psych and rdoc is out of scope of this commit. I will merge after upstream was change to `frozen_string_literal: true`. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59115 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-03-22stringio.gemspec: requires ruby 2.2nobu
* ext/stringio/stringio.gemspec: bump up required ruby version to 2.2, which exports rb_get_kwargs() first. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58059 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-03-22stringio.c: RB_INTEGER_TYPE_Pnobu
* ext/stringio/stringio.c (RB_INTEGER_TYPE_P): fallback definition for 2.3 or earlier. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58057 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-03-22Use https URL instead of http URLkazu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58055 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-03-22ruby tool/update-deps --fixshyouhei
Onigumo 6 (r57045) introduced new onigumo.h header file, which is required from quite much everywhere. This commit adds necessary dependencies. Note: ruby/oniguruma.h now includes onigumo.h, ruby/io.h includes oniguruma.h, ruby/encoding.h also includes oniguruma.h, and internal.h includes encoding.h. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58054 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-03-22gemify stringionobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58049 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-03-21stringio.c: check rangenobu
* ext/stringio/stringio.c (strio_ungetc): raise RangeError instead of TypeError at too big value, as well as IO#ungetc. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58041 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-03-21stringio.c: check character codenobu
* ext/stringio/stringio.c (strio_ungetc): check if the character code is valid in the encoding. reported by Ahmad Sherif (ahmadsherif) at https://hackerone.com/reports/209593. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58040 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-03-17remove branches in dmark and dfree GC callbacksnormal
dmark and dfree callbacks are never called in gc.c for NULL DATA_PTR values, not even for zombie objects. * compile.c (ibf_loader_mark): remove branch for pointer validity * compile.c (ibf_loader_free): ditto * cont.c (cont_free): ditto * cont.c (fiber_free): ditto * dir.c (dir_free): ditto * ext/stringio/stringio.c (strio_mark): ditto * proc.c (binding_free): ditto * thread_sync.c (mutex_free): ditto * vm.c (thread_free): ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58006 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-12-10stringio.c: chomp CRnobu
* ext/stringio/stringio.c (strio_getline): chomp CR not only LF, as well as String#chomp. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57043 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-12-03stringio: chomp optionnobu
* ext/stringio/stringio.c (strio_getline): implement chomp option. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56970 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-09-26stringio.c: fix signed integer overflowrhe
* ext/stringio/stringio.c (strio_seek): Avoid signed integer overflow. It's not harmful in practice here, but is still undefined behavior. * ext/stringio/stringio.c (strio_extend): Check that the new length does not exceed LONG_MAX. This fixes the invalid write on the overflow. * test/stringio/test_stringio.rb (test_write_integer_overflow): Add a test case for the above fix in strio_extend(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56253 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-07-11stringio.c: convert arguments just oncenobu
* ext/stringio/stringio.c (strio_each, strio_readlines): convert arguments just once before reading, instead of conversions for each lines, as r55603. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55629 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-07-06Update dependenciesnobu
* common.mk (compile.o, loadpath.o): update dependencies. * common.mk (vm_call.o): remove stale object dependencies. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55589 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-06-17stringio.c: fix index overflownobu
* ext/stringio/stringio.c (strio_getline): fix pointer index overflow. reported by Guido Vranken <guido AT guidovranken.nl>. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55432 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-06-09strio_init: return self for tail call optimizationnobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55333 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-06-08ext/stringio/README.md: update [ci skip]nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55326 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-30stringio.c: share stringsnobu
* ext/stringio/stringio.c (enc_subseq): share the return value and the buffer as possible. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55210 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-04-27stringio.c: warn block for newnobu
* ext/stringio/stringio.c (strio_s_new): warn if a block is given, as well as IO.new. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54792 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-01-04stringio: binmode sets encoding to ASCII-8BITnormal
This should match the behavior of IO#binmode as far as treating content as ASCII-8BIT (binary). * ext/stringio/stringio.c (strio_binmode): implement to set encoding * test/stringio/test_stringio.rb (test_binmode): new test [ruby-core:72699] [Bug #11945] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53435 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-23prefer rb_syserr_failnobu
* file.c, io.c, util.c: prefer rb_syserr_fail with saved errno over setting errno then call rb_sys_fail, not to be clobbered potentially and to reduce thread local errno accesses. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53264 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-18stringio.c: separate encoding from buffernobu
* ext/stringio/stringio.c (strio_set_encoding): add StringIO's own encoding and separate it from the buffer string to override the encoding of string when reading. [ruby-core:72189] [Bug #11827] note that setting the encoding of its buffer string may cause unpredictable behavior. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53188 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-18stringio.c: strio_unget_bytesnobu
* ext/stringio/stringio.c (strio_unget_bytes): extract from strio_ungetbyte to share with strio_ungetc. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53185 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-18stringio.c: padding in ungetbytenobu
* ext/stringio/stringio.c (strio_ungetbyte): pad with \000 when the current position is after the end. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53181 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-16handle ext/ as r53141naruse
g -L frozen_string_literal ext/**/*.rb|xargs ruby -Ka -e'ARGV.each{|fn|puts fn;open(fn,"r+"){|f|s=f.read.sub(/\A(#!.*\n)?(#.*coding.*\n)?/,"\\&# frozen_string_literal: false\n");f.rewind;f.write s}}' git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53143 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-09stringio.c: unused variablenobu
* ext/stringio/stringio.c (strio_memsize): remove a variable which is no longer used. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52991 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-09* ext/**/*.c (*_memsize): same as r52986 for extensions.ko1
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52988 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-10-25use rb_check_arity [ci skip]nobu
* ext: use rb_check_arity and rb_error_arity to raise ArgumentError. [Feature #9025] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52275 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-07-11stringio.c: Fix an example doc [ci skip]nobu
* ext/stringio/stringio.c (Init_stringio): [DOC] Fix an example, StringIO#puts should be set "\n" at last. [Fix GH-965] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51218 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-07-10stringio.c: remove unnecessary checknobu
* ext/stringio/stringio.c (writable): remove unnecessary check for deprecated safe level 4. [Fix GH-963] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51207 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-07-02delay `exception: false' checks for minor speedupnormal
Delay hash lookups until we are about to hit an exception. This gives a minor speedup ratio of 2-3% in the new bm_io_nonblock_noex benchmark as well as reducing code. * benchmark/bm_io_nonblock_noex.rb: new benchmark * ext/openssl/ossl_ssl.c (no_exception_p): new function (ossl_start_ssl): adjust for no_exception_p (ossl_ssl_connect): adjust ossl_start_ssl call (ossl_ssl_connect_nonblock): ditto (ossl_ssl_accept): ditto (ossl_ssl_accept_nonblock): ditto (ossl_ssl_read_internal): adjust for no_exception_p (ossl_ssl_write_internal): ditto (ossl_ssl_write): adjust ossl_write_internal call (ossl_ssl_write_nonblock): ditto * ext/stringio/stringio.c (strio_read_nonblock): delay exception check * io.c (no_exception_p): new function (io_getpartial): call no_exception_p (io_readpartial): adjust for io_getpartial (get_kwargs_exception): remove (io_read_nonblock): adjust for io_getpartial, check no_exception_p on EOF (io_write_nonblock): call no_exception_p (rb_io_write_nonblock): do not check `exception: false' (argf_getpartial): adjust for io_getpartial [ruby-core:69778] [Feature #11318] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51113 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-03-13stringio.c: don't raise after closenobu
* ext/stringio/stringio.c (strio_close): don't raise on dobule close for consistent to IO#close. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49962 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-03-09stringio.c: don't raise after closenobu
* ext/stringio/stringio.c (strio_close): don't raise on dobule close for consistent to IO#close. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49905 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-12-01use 0 for reservednobu
use 0 for rb_data_type_t::reserved instead of NULL, since its type may be changed in the future and possibly not a pointer type. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48662 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-10-10ruby/io.h: deprecate old macrosnobu
* include/ruby/io.h (rb_io_mode_flags, rb_io_modenum_flags): deprecate old macros for compatibility for ruby 1.8 and older. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47861 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-09-30protoize no-arguments functionsnobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47744 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-09-26stringio.c: ASCII-8BIT StringIO rejects no encodingsnobu
* ext/stringio/stringio.c (strio_write): ASCII-8BIT StringIO should be writable any encoding strings, without conversion. [ruby-core:65240] [Bug #10285] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47716 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-04-23stringio.c: use rb_str_append other than ASCII-8BITnobu
* ext/stringio/stringio.c (strio_write): use rb_str_append to reuse coderange bits other than ASCII-8BIT, and keep taintedness. [ruby-dev:48118] [Bug #9769] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45677 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-04-23stringio.c: move GC guardnobu
* ext/stringio/stringio.c (strio_write): move GC guard after the last using position. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45676 b2dd03c8-39d4-4d8f-98ff-823fe69b080e