Skip to content

Commit

Permalink
fix for #25
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.macosforge.org/repository/ruby/MacRuby/trunk@54 23306eb0-4c56-4727-a40e-e92c0eb68959
  • Loading branch information
lrz committed Mar 9, 2008
1 parent d31a74f commit 09cb4a5
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions objc.m
Expand Up @@ -2581,18 +2581,23 @@
{
char **newargv;
char *p1, *p2;
int n, i;

newargv = (char **)malloc((argc + 2) * sizeof(char *));
memcpy(newargv, argv, argc * sizeof(char *));
newargv = (char **)malloc(sizeof(char *) * (argc + 2));
for (i = n = 0; i < argc; i++) {
if (!strncmp(argv[i], "-psn_", 5) == 0)
newargv[n++] = argv[i];
}

p1 = (char *)malloc(PATH_MAX);
newargv[argc++] = (char *)resources_path(p1, PATH_MAX);
newargv[n++] = (char *)resources_path(p1, PATH_MAX);

p2 = (char *)malloc(PATH_MAX);
snprintf(p2, PATH_MAX, "%s/%s", &p1[2], path);
newargv[argc++] = p2;
newargv[n++] = p2;

argv = newargv;
argc = n;

ruby_sysinit(&argc, &argv);
{
Expand Down

0 comments on commit 09cb4a5

Please sign in to comment.