Skip to content

Commit

Permalink
* ruby.c (set_arg0): fill argv other than the first with an empty
Browse files Browse the repository at this point in the history
  string instead of NULL.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@10731 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information
nobu committed Aug 16, 2006
1 parent e03d60d commit 44fcb03
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
5 changes: 5 additions & 0 deletions ChangeLog
@@ -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.

Wed Aug 16 11:08:00 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>

* win32/win32.h: removed an excess macro. fixed: [ruby-dev:29258]
Expand Down
17 changes: 6 additions & 11 deletions ruby.c
Expand Up @@ -1065,18 +1065,13 @@ set_arg0(val, 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
}
Expand Down

0 comments on commit 44fcb03

Please sign in to comment.