diff options
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | ruby.c | 17 |
2 files changed, 11 insertions, 11 deletions
@@ -1,3 +1,8 @@ +Wed Aug 16 11:09:26 2006 Nobuyoshi Nakada <nobu@ruby-lang.org> + + * 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 <aamine@loveruby.net> * lib/net/smtp.rb: support SMTP/SSL. Thanks Kazuhiro NISHIYAMA. @@ -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 } |