ruby-changes:47959
From: nobu <ko1@a...>
Date: Sat, 30 Sep 2017 20:06:10 +0900 (JST)
Subject: [ruby-changes:47959] nobu:r60074 (trunk): gdbm.c: use the default external encoding
nobu 2017-09-30 20:06:05 +0900 (Sat, 30 Sep 2017) New Revision: 60074 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=60074 Log: gdbm.c: use the default external encoding Modified files: trunk/ext/gdbm/gdbm.c Index: ext/gdbm/gdbm.c =================================================================== --- ext/gdbm/gdbm.c (revision 60073) +++ ext/gdbm/gdbm.c (revision 60074) @@ -334,7 +334,7 @@ rb_gdbm_fetch2(GDBM_FILE dbm, VALUE keys https://github.com/ruby/ruby/blob/trunk/ext/gdbm/gdbm.c#L334 datum key; long len; - StringValue(keystr); + ExportStringValue(keystr); len = RSTRING_LEN(keystr); if (TOO_LONG(len)) return Qnil; key.dptr = RSTRING_PTR(keystr); @@ -450,7 +450,7 @@ fgdbm_key(VALUE obj, VALUE valstr) https://github.com/ruby/ruby/blob/trunk/ext/gdbm/gdbm.c#L450 GDBM_FILE dbm; VALUE keystr, valstr2; - StringValue(valstr); + ExportStringValue(valstr); GetDBM2(obj, dbmp, dbm); for (keystr = rb_gdbm_firstkey(dbm); RTEST(keystr); keystr = rb_gdbm_nextkey(dbm, keystr)) { @@ -538,7 +538,7 @@ rb_gdbm_delete(VALUE obj, VALUE keystr) https://github.com/ruby/ruby/blob/trunk/ext/gdbm/gdbm.c#L538 long len; rb_gdbm_modify(obj); - StringValue(keystr); + ExportStringValue(keystr); len = RSTRING_LEN(keystr); if (TOO_LONG(len)) return Qnil; key.dptr = RSTRING_PTR(keystr); @@ -725,8 +725,8 @@ fgdbm_store(VALUE obj, VALUE keystr, VAL https://github.com/ruby/ruby/blob/trunk/ext/gdbm/gdbm.c#L725 GDBM_FILE dbm; rb_gdbm_modify(obj); - StringValue(keystr); - StringValue(valstr); + ExportStringValue(keystr); + ExportStringValue(valstr); key.dptr = RSTRING_PTR(keystr); key.dsize = RSTRING_LENINT(keystr); @@ -991,7 +991,7 @@ fgdbm_has_key(VALUE obj, VALUE keystr) https://github.com/ruby/ruby/blob/trunk/ext/gdbm/gdbm.c#L991 GDBM_FILE dbm; long len; - StringValue(keystr); + ExportStringValue(keystr); len = RSTRING_LENINT(keystr); if (TOO_LONG(len)) return Qfalse; key.dptr = RSTRING_PTR(keystr); @@ -1018,7 +1018,7 @@ fgdbm_has_value(VALUE obj, VALUE valstr) https://github.com/ruby/ruby/blob/trunk/ext/gdbm/gdbm.c#L1018 GDBM_FILE dbm; VALUE keystr, valstr2; - StringValue(valstr); + ExportStringValue(valstr); GetDBM2(obj, dbmp, dbm); for (keystr = rb_gdbm_firstkey(dbm); RTEST(keystr); keystr = rb_gdbm_nextkey(dbm, keystr)) { -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/