* pack.c (pack_unpack): change names of local variables because their

names are overlapped.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2609 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
usa 2002-06-28 14:53:03 +00:00
parent f0221db462
commit cd6cffa7b6
3 changed files with 23 additions and 18 deletions

View File

@ -1,3 +1,8 @@
Fri Jun 28 23:49:34 2002 NAKAMURA Usaku <usa@ruby-lang.org>
* pack.c (pack_unpack): change names of local variables because their
names are overlapped.
Fri Jun 28 17:54:07 2002 Tanaka Akira <akr@m17n.org> Fri Jun 28 17:54:07 2002 Tanaka Akira <akr@m17n.org>
* lib/pp.rb: fix object address. * lib/pp.rb: fix object address.

32
pack.c
View File

@ -1491,8 +1491,8 @@ pack_unpack(str, fmt)
case 'u': case 'u':
{ {
VALUE str = infected_str_new(0, (send - s)*3/4, str); VALUE buf = infected_str_new(0, (send - s)*3/4, str);
char *ptr = RSTRING(str)->ptr; char *ptr = RSTRING(buf)->ptr;
int total = 0; int total = 0;
while (s < send && *s > ' ' && *s < 'a') { while (s < send && *s > ' ' && *s < 'a') {
@ -1502,9 +1502,9 @@ pack_unpack(str, fmt)
hunk[3] = '\0'; hunk[3] = '\0';
len = (*s++ - ' ') & 077; len = (*s++ - ' ') & 077;
total += len; total += len;
if (total > RSTRING(str)->len) { if (total > RSTRING(buf)->len) {
len -= total - RSTRING(str)->len; len -= total - RSTRING(buf)->len;
total = RSTRING(str)->len; total = RSTRING(buf)->len;
} }
while (len > 0) { while (len > 0) {
@ -1539,16 +1539,16 @@ pack_unpack(str, fmt)
s += 2; /* possible checksum byte */ s += 2; /* possible checksum byte */
} }
RSTRING(str)->ptr[total] = '\0'; RSTRING(buf)->ptr[total] = '\0';
RSTRING(str)->len = total; RSTRING(buf)->len = total;
rb_ary_push(ary, str); rb_ary_push(ary, buf);
} }
break; break;
case 'm': case 'm':
{ {
VALUE str = infected_str_new(0, (send - s)*3/4, str); VALUE buf = infected_str_new(0, (send - s)*3/4, str);
char *ptr = RSTRING(str)->ptr; char *ptr = RSTRING(buf)->ptr;
int a,b,c = 0,d; int a,b,c = 0,d;
static int first = 1; static int first = 1;
static int b64_xtable[256]; static int b64_xtable[256];
@ -1583,15 +1583,15 @@ pack_unpack(str, fmt)
*ptr++ = b << 4 | c >> 2; *ptr++ = b << 4 | c >> 2;
} }
*ptr = '\0'; *ptr = '\0';
RSTRING(str)->len = ptr - RSTRING(str)->ptr; RSTRING(buf)->len = ptr - RSTRING(buf)->ptr;
rb_ary_push(ary, str); rb_ary_push(ary, buf);
} }
break; break;
case 'M': case 'M':
{ {
VALUE str = infected_str_new(0, send - s, str); VALUE buf = infected_str_new(0, send - s, str);
char *ptr = RSTRING(str)->ptr; char *ptr = RSTRING(buf)->ptr;
int c1, c2; int c1, c2;
while (s < send) { while (s < send) {
@ -1610,8 +1610,8 @@ pack_unpack(str, fmt)
s++; s++;
} }
*ptr = '\0'; *ptr = '\0';
RSTRING(str)->len = ptr - RSTRING(str)->ptr; RSTRING(buf)->len = ptr - RSTRING(buf)->ptr;
rb_ary_push(ary, str); rb_ary_push(ary, buf);
} }
break; break;

View File

@ -1,4 +1,4 @@
#define RUBY_VERSION "1.7.2" #define RUBY_VERSION "1.7.2"
#define RUBY_RELEASE_DATE "2002-06-26" #define RUBY_RELEASE_DATE "2002-06-28"
#define RUBY_VERSION_CODE 172 #define RUBY_VERSION_CODE 172
#define RUBY_RELEASE_CODE 20020626 #define RUBY_RELEASE_CODE 20020628