diff --git a/ChangeLog b/ChangeLog index 74cd5f1ee..abe1f20a1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2005-04-02 Richard Frith-Macdonald + + * Source/NSTask.m: Fix missing nul terminator to arguments under win32 + 2005-04-01 Richard Frith-Macdonald * Source/NSBundle.m: Minor debug/warning log tweaks. diff --git a/Source/NSTask.m b/Source/NSTask.m index 464c30c3a..7c3756213 100644 --- a/Source/NSTask.m +++ b/Source/NSTask.m @@ -1082,11 +1082,10 @@ quotedFromString(NSString *aString) } lpath = [self _fullLaunchPath]; - wexecutable = [[lpath localFromOpenStepPath] unicharString]; + lpath = [lpath localFromOpenStepPath]; + wexecutable = [lpath unicharString]; - args = [[NSMutableString alloc] initWithString: - quotedFromString([NSString stringWithCharacters: wexecutable - length: wcslen(wexecutable)])]; + args = [[NSMutableString alloc] initWithString: quotedFromString(lpath)]; arg_enum = [[self arguments] objectEnumerator]; while ((arg = [arg_enum nextObject])) { @@ -1097,6 +1096,7 @@ quotedFromString(NSString *aString) w_args = NSZoneMalloc(NSDefaultMallocZone(), sizeof(wchar_t) * ([args length] + 1)); [args getCharacters: (unichar*)w_args]; + w_args[[args length]] = 0; env = [self environment]; if ([env count] > 0)