aboutsummaryrefslogtreecommitdiffstats
path: root/string.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-11-09 06:20:15 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-11-09 06:20:15 +0000
commit03d68e3ba44e457669b8115546355ef73b95f338 (patch)
treef055cbbed00cf4a34f4a62b900505d66ce4b3033 /string.c
parentc23d67293221c287f30320ff83ee957f6c63757a (diff)
downloadruby-03d68e3ba44e457669b8115546355ef73b95f338.tar.gz
* string.c (rb_str_squeeze_bang): initialize squeezing table if no
arguments given. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13851 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'string.c')
-rw-r--r--string.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/string.c b/string.c
index a23a9b6626..07ccf897c7 100644
--- a/string.c
+++ b/string.c
@@ -3591,7 +3591,7 @@ tr_setup_table(VALUE str, char stable[256], int first,
char buf[256];
struct tr tr;
int c;
- VALUE table = 0, ptable;
+ VALUE table = 0, ptable = 0;
int i, cflag = 0;
tr.p = RSTRING_PTR(str); tr.pend = tr.p + RSTRING_LEN(str);
@@ -3752,6 +3752,7 @@ rb_str_squeeze_bang(int argc, VALUE *argv, VALUE str)
int i;
if (argc == 0) {
+ memset(squeez, 1, sizeof(squeez));
enc = rb_enc_get(str);
}
else {