summaryrefslogtreecommitdiff
path: root/test/file_chooser.cxx
diff options
context:
space:
mode:
authorMatthias Melcher <fltk@matthiasm.com>2011-01-01 20:17:58 +0000
committerMatthias Melcher <fltk@matthiasm.com>2011-01-01 20:17:58 +0000
commit028533b451f391905f9c49258d8f9ddb39815acb (patch)
tree857c85bb8b31c0ce17f5774be60255704ef49112 /test/file_chooser.cxx
parent4562798f69448c4d1f1615571548de214736fca2 (diff)
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
Diffstat (limited to 'test/file_chooser.cxx')
-rw-r--r--test/file_chooser.cxx10
1 files changed, 8 insertions, 2 deletions
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"