OS X adds a -psn_... argument to command line calls. Ignore that.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@8164 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
Matthias Melcher 2011-01-01 20:17:58 +00:00
parent 4562798f69
commit 028533b451
1 changed files with 8 additions and 2 deletions

View File

@ -112,8 +112,14 @@ main(int argc, // I - Number of command-line arguments
window = new Fl_Double_Window(400, 215, "File Chooser Test");
filter = new Fl_Input(50, 10, 315, 25, "Filter:");
if (argc > 1)
filter->value(argv[1]);
int argn = 1;
#ifdef __APPLE__
// OS X may add the process number as the first argument - ignore
if (argc>argn && strncmp(argv[1], "-psn_", 5)==0)
argn++;
#endif
if (argc > argn)
filter->value(argv[argn]);
else
filter->value("PDF Files (*.pdf)\t"
"PostScript Files (*.ps)\t"