From 028533b451f391905f9c49258d8f9ddb39815acb Mon Sep 17 00:00:00 2001 From: Matthias Melcher Date: Sat, 1 Jan 2011 20:17:58 +0000 Subject: 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 --- test/file_chooser.cxx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'test/file_chooser.cxx') diff --git a/test/file_chooser.cxx b/test/file_chooser.cxx index a928b714c..a36a489b0 100644 --- a/test/file_chooser.cxx +++ b/test/file_chooser.cxx @@ -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" -- cgit v1.2.3