Fix missing nul terminator causing occasional launch failures under win32

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@21036 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-Macdonald 2005-04-02 08:23:05 +00:00
parent 71ce433dad
commit fe7fbf59b4
2 changed files with 8 additions and 4 deletions

View file

@ -1,3 +1,7 @@
2005-04-02 Richard Frith-Macdonald <rfm@gnu.org>
* Source/NSTask.m: Fix missing nul terminator to arguments under win32
2005-04-01 Richard Frith-Macdonald <rfm@gnu.org>
* Source/NSBundle.m: Minor debug/warning log tweaks.

View file

@ -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)