mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* encoding.c (RUBY_MAX_CHAR_LEN): defined.
* encoding.c (str_cat_char): use RUBY_MAX_CHAR_LEN. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19358 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
5fc383f9a3
commit
0791d297dd
2 changed files with 8 additions and 1 deletions
|
@ -1,3 +1,9 @@
|
||||||
|
Mon Sep 15 14:34:32 2008 NARUSE, Yui <naruse@ruby-lang.org>
|
||||||
|
|
||||||
|
* encoding.c (RUBY_MAX_CHAR_LEN): defined.
|
||||||
|
|
||||||
|
* encoding.c (str_cat_char): use RUBY_MAX_CHAR_LEN.
|
||||||
|
|
||||||
Mon Sep 15 13:53:33 2008 NARUSE, Yui <naruse@ruby-lang.org>
|
Mon Sep 15 13:53:33 2008 NARUSE, Yui <naruse@ruby-lang.org>
|
||||||
|
|
||||||
* encoding.c (rb_enc_compatible): accepst other than strings and
|
* encoding.c (rb_enc_compatible): accepst other than strings and
|
||||||
|
|
3
string.c
3
string.c
|
@ -43,6 +43,7 @@
|
||||||
VALUE rb_cString;
|
VALUE rb_cString;
|
||||||
VALUE rb_cSymbol;
|
VALUE rb_cSymbol;
|
||||||
|
|
||||||
|
#define RUBY_MAX_CHAR_LEN 16
|
||||||
#define STR_TMPLOCK FL_USER7
|
#define STR_TMPLOCK FL_USER7
|
||||||
#define STR_NOEMBED FL_USER1
|
#define STR_NOEMBED FL_USER1
|
||||||
#define STR_SHARED FL_USER2 /* = ELTS_SHARED */
|
#define STR_SHARED FL_USER2 /* = ELTS_SHARED */
|
||||||
|
@ -3790,7 +3791,7 @@ rb_str_to_s(VALUE str)
|
||||||
static void
|
static void
|
||||||
str_cat_char(VALUE str, int c, rb_encoding *enc)
|
str_cat_char(VALUE str, int c, rb_encoding *enc)
|
||||||
{
|
{
|
||||||
char s[16];
|
char s[RUBY_MAX_CHAR_LEN];
|
||||||
int n = rb_enc_codelen(c, enc);
|
int n = rb_enc_codelen(c, enc);
|
||||||
|
|
||||||
rb_enc_mbcput(c, s, enc);
|
rb_enc_mbcput(c, s, enc);
|
||||||
|
|
Loading…
Reference in a new issue