diff --git a/ChangeLog b/ChangeLog index 3cd7a03de..cf17c60fe 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,6 +3,7 @@ Thu Sep 2 16:42:00 1999 Richard Frith-Macdonald * NSWorkspace.m: Trivial fix to pass app when opening files. * GSServicesManager.m: Fix to send open commands to app delegate rather than to application object itsself. + * NSApplication.m: Fix to recognise file open request on commandline. Thu Sep 2 12:50:00 1999 Richard Frith-Macdonald diff --git a/Source/NSApplication.m b/Source/NSApplication.m index 125920552..1aa0f2468 100644 --- a/Source/NSApplication.m +++ b/Source/NSApplication.m @@ -209,18 +209,29 @@ NSApplication *NSApp = nil; /* * Now check to see if we were launched with arguments asking to - * open a file. + * open a file. We permit some variations on the default name. */ - if ((filePath = [defs stringForKey: @"GSFilePath"]) != nil) + filePath = [defs stringForKey: @"-GSFilePath"]; + if (filePath == nil) + filePath = [defs stringForKey: @"--GSFilePath"]; + if (filePath == nil) + filePath = [defs stringForKey: @"GSFilePath"]; + if (filePath != nil) { if ([delegate respondsToSelector: @selector(application:openFile:)]) { [delegate application: self openFile: filePath]; } } - else if ((filePath = [defs stringForKey: @"GSTempPath"]) != nil) + else { - if ([delegate respondsToSelector: @selector(application:openTempFile:)]) + filePath = [defs stringForKey: @"-GSTempPath"]; + if (filePath == nil) + filePath = [defs stringForKey: @"--GSTempPath"]; + if (filePath == nil) + filePath = [defs stringForKey: @"GSTempPath"]; + if (filePath != nil + && [delegate respondsToSelector: @selector(application:openTempFile:)]) { [delegate application: self openTempFile: filePath]; }