Fix executable path under windoze

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@13609 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-Macdonald 2002-05-08 11:27:50 +00:00
parent a38c844fd9
commit f08f3d9f63
3 changed files with 13 additions and 6 deletions

View file

@ -1,3 +1,8 @@
2002-05-08 Richard Frith-Macdonald <rfm@gnu.org>
* Source/NSTask.m: When launching under windoze, don't forget to
use the fileSystemrepresentation of the program name.
2002-05-08 Richard Frith-Macdonald <rfm@gnu.org> 2002-05-08 Richard Frith-Macdonald <rfm@gnu.org>
* Source/Additions/GSXML.m: Fix function prototype ... gets rid of * Source/Additions/GSXML.m: Fix function prototype ... gets rid of

View file

@ -1018,6 +1018,7 @@ static DWORD WINAPI _threadFunction(LPVOID t)
NSMutableString *args; NSMutableString *args;
char *c_args; char *c_args;
int result; int result;
const char *executable;
if (_hasLaunched) if (_hasLaunched)
{ {
@ -1025,7 +1026,8 @@ static DWORD WINAPI _threadFunction(LPVOID t)
} }
lpath = [self _fullLaunchPath]; lpath = [self _fullLaunchPath];
args = [lpath mutableCopy]; executable = [lpath fileSystemRepresentation];
args = [[NSMutableString alloc] initWithCString: executable];
arg_enum = [[self arguments] objectEnumerator]; arg_enum = [[self arguments] objectEnumerator];
while ((arg = [arg_enum nextObject])) while ((arg = [arg_enum nextObject]))
{ {
@ -1042,7 +1044,7 @@ static DWORD WINAPI _threadFunction(LPVOID t)
start_info.hStdOutput = GetStdHandle(STD_OUTPUT_HANDLE); start_info.hStdOutput = GetStdHandle(STD_OUTPUT_HANDLE);
start_info.hStdError = GetStdHandle(STD_ERROR_HANDLE); start_info.hStdError = GetStdHandle(STD_ERROR_HANDLE);
result = CreateProcess([lpath fileSystemRepresentation], result = CreateProcess(executable,
c_args, c_args,
NULL, /* proc attrs */ NULL, /* proc attrs */
NULL, /* thread attrs */ NULL, /* thread attrs */
@ -1055,7 +1057,7 @@ static DWORD WINAPI _threadFunction(LPVOID t)
NSZoneFree(NSDefaultMallocZone(), c_args); NSZoneFree(NSDefaultMallocZone(), c_args);
if (result == 0) if (result == 0)
{ {
NSLog(@"Error launching task: %@", lpath); NSLog(@"Error launching task: %s", executable);
return; return;
} }
@ -1080,7 +1082,7 @@ static DWORD WINAPI _threadFunction(LPVOID t)
if (GetExitCodeProcess(procInfo.hProcess, &eCode) == 0) if (GetExitCodeProcess(procInfo.hProcess, &eCode) == 0)
{ {
NSLog(@"Error getting exit codef for process %d", _taskId); NSLog(@"Error getting exit code for process %d", _taskId);
} }
else if (eCode != STILL_ACTIVE) else if (eCode != STILL_ACTIVE)
{ {
@ -1360,7 +1362,7 @@ GSCheckTasks()
} }
} }
- (void) setStandardError: (id)hdl - (void) setStandard[self currentDirectoryPath]: (id)hdl
{ {
if (_usePseudoTerminal == YES) if (_usePseudoTerminal == YES)
{ {

View file

@ -4422,7 +4422,7 @@ printf(
a[argc+1] = 0; a[argc+1] = 0;
if (_spawnv(_P_NOWAIT, argv[0], a) == -1) if (_spawnv(_P_NOWAIT, argv[0], a) == -1)
{ {
fprintf(stderr, "gdomap - spawn failed - bye.\n"); fprintf(stderr, "gdomap - spawn '%s' failed - bye.\n", argv[0]);
exit(1); exit(1);
} }
if (debug) if (debug)