summaryrefslogtreecommitdiff
path: root/hw/darwin/apple/X11Controller.m
diff options
context:
space:
mode:
Diffstat (limited to 'hw/darwin/apple/X11Controller.m')
-rw-r--r--hw/darwin/apple/X11Controller.m20
1 files changed, 5 insertions, 15 deletions
diff --git a/hw/darwin/apple/X11Controller.m b/hw/darwin/apple/X11Controller.m
index acac313f4..fbc9c7402 100644
--- a/hw/darwin/apple/X11Controller.m
+++ b/hw/darwin/apple/X11Controller.m
@@ -1,5 +1,4 @@
/* X11Controller.m -- connect the IB ui, also the NSApp delegate
- $Id: X11Controller.m,v 1.40 2006/09/06 21:19:32 jharper Exp $
Copyright (c) 2002-2007 Apple Inc. All rights reserved.
@@ -294,26 +293,17 @@
- (void) launch_client:(NSString *)filename
{
const char *command = [filename UTF8String];
- const char *shell;
- const char *argv[5];
+ const char *argv[7];
int child1, child2 = 0;
int status;
- /* this old code doesn't work with csh ...
- shell = getenv("SHELL");
- if (shell == NULL) shell = "/bin/bash";
-
- argv[0] = shell;
- argv[1] = "-l";
- argv[2] = "-c";
- argv[3] = command;
- argv[4] = NULL;
- ... but the new code doesn't work with spaces in a command :(
- */
-
argv[0] = "/usr/bin/login";
argv[1] = "-fp";
argv[2] = getlogin();
+ argv[3] = "/bin/sh";
+ argv[4] = "-c";
+ argv[5] = command;
+ argv[6] = NULL;
/* Do the fork-twice trick to avoid having to reap zombies */