mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-26 14:01:45 +00:00
- escape double quotes in Cocoa IWAD picker's extra arguments
https://forum.zdoom.org/viewtopic.php?t=71675
This commit is contained in:
parent
d18b74b537
commit
952d43b884
1 changed files with 3 additions and 1 deletions
|
@ -389,6 +389,8 @@ static void RestartWithParameters(const WadStuff& wad, NSString* parameters)
|
||||||
@try
|
@try
|
||||||
{
|
{
|
||||||
NSString* executablePath = [NSString stringWithUTF8String:Args->GetArg(0)];
|
NSString* executablePath = [NSString stringWithUTF8String:Args->GetArg(0)];
|
||||||
|
NSString* escapedParameters = [parameters stringByReplacingOccurrencesOfString:@"\"" withString:@"\\\""];
|
||||||
|
NSString* cvarArgument = [NSString stringWithFormat:@"+osx_additional_parameters \"%@\"", escapedParameters];
|
||||||
|
|
||||||
NSMutableArray* const arguments = [[NSMutableArray alloc] init];
|
NSMutableArray* const arguments = [[NSMutableArray alloc] init];
|
||||||
[arguments addObject:@"-arch"];
|
[arguments addObject:@"-arch"];
|
||||||
|
@ -398,7 +400,7 @@ static void RestartWithParameters(const WadStuff& wad, NSString* parameters)
|
||||||
[arguments addObject:[NSString stringWithUTF8String:wad.Path]];
|
[arguments addObject:[NSString stringWithUTF8String:wad.Path]];
|
||||||
[arguments addObject:@"+defaultiwad"];
|
[arguments addObject:@"+defaultiwad"];
|
||||||
[arguments addObject:[NSString stringWithUTF8String:wad.Name]];
|
[arguments addObject:[NSString stringWithUTF8String:wad.Name]];
|
||||||
[arguments addObject:[NSString stringWithFormat:@"+osx_additional_parameters \"%@\"", parameters]];
|
[arguments addObject:cvarArgument];
|
||||||
|
|
||||||
for (int i = 1, count = Args->NumArgs(); i < count; ++i)
|
for (int i = 1, count = Args->NumArgs(); i < count; ++i)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue