Skip to content
Browse files

fix for #25

git-svn-id: http://svn.macosforge.org/repository/ruby/MacRuby/trunk@54 23306eb0-4c56-4727-a40e-e92c0eb68959
  • Loading branch information...
1 parent d31a74f commit 09cb4a503f4718c8e0a6268826e441712a7f970c Laurent Sansonetti committed Mar 9, 2008
Showing with 9 additions and 4 deletions.
  1. +9 −4 objc.m
View
13 objc.m
@@ -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);
{

0 comments on commit 09cb4a5

Please sign in to comment.
Something went wrong with that request. Please try again.