Increment argv to skip the process serial number in the arguments list passed to SM_main. Also, "-psn_" has 5 characters.

This commit is contained in:
Steve Checkoway
2007-05-08 11:29:39 +00:00
parent 60350ee449
commit b8c95a7938
+8 -3
View File
@@ -46,11 +46,16 @@
- (id) initWithArgc:(int)argc argv:(char **)argv - (id) initWithArgc:(int)argc argv:(char **)argv
{ {
[super init]; [super init];
if( argc == 2 && !strncmp(argv[1], "-psn_", 4) ) if( argc == 2 && !strncmp(argv[1], "-psn_", 5) )
{
m_iArgc = 1; m_iArgc = 1;
m_pArgv = argv + 1;
}
else else
{
m_iArgc = argc; m_iArgc = argc;
m_pArgv = argv; m_pArgv = argv;
}
return self; return self;
} }
@@ -148,7 +153,7 @@ int main( int argc, char **argv )
// Set up the menubar. // Set up the menubar.
SetupMenus(); SetupMenus();
// Create SDLMain and make it the app delegate. // Create SMMain and make it the app delegate.
sm = [[SMMain alloc] initWithArgc:argc argv:argv]; sm = [[SMMain alloc] initWithArgc:argc argv:argv];
[NSApp setDelegate:sm]; [NSApp setDelegate:sm];