diff --git a/ChangeLog b/ChangeLog index 13bca038fa..ff18b64cd5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Wed Aug 16 11:09:26 2006 Nobuyoshi Nakada + + * ruby.c (set_arg0): fill argv other than the first with an empty + string instead of NULL. + Tue Aug 15 11:21:08 2006 Minero Aoki * lib/net/smtp.rb: support SMTP/SSL. Thanks Kazuhiro NISHIYAMA. diff --git a/ruby.c b/ruby.c index 32278888ee..1fa10e1f00 100644 --- a/ruby.c +++ b/ruby.c @@ -1079,18 +1079,13 @@ set_arg0(VALUE val, ID id) if (i >= len) { i = len; - memcpy(origargv[0], s, i); - origargv[0][i] = '\0'; - } - else { - memcpy(origargv[0], s, i); - s = origargv[0]+i; - *s++ = '\0'; - while (++i < len) - *s++ = ' '; - for (i = 1; i < origargc; i++) - origargv[i] = 0; } + memcpy(origargv[0], s, i); + s = origargv[0] + i; + *s = '\0'; + if (++i < len) memset(s + 1, ' ', len - i); + for (i = 1; i < origargc; i++) + origargv[i] = s; rb_progname = rb_tainted_str_new2(origargv[0]); #endif }