Fix launching from .app on OSX

(cherry picked from commit 6962fd91c6)
This commit is contained in:
Ariel Manzur 2016-04-29 10:45:31 -03:00 committed by Rémi Verschelde
parent 70644301dd
commit 227604a566
1 changed files with 9 additions and 1 deletions

View File

@ -36,6 +36,14 @@
int main(int argc, char** argv) { int main(int argc, char** argv) {
int first_arg = 1;
const char* dbg_arg = "-NSDocumentRevisionsDebugMode";
printf("arguments\n");
for (int i=0; i<argc; i++) {
if (strcmp(dbg_arg, argv[i]) == 0)
first_arg = i+2;
printf("%i: %s\n", i, argv[i]);
};
if (argc>=1 && argv[0][0]=='/') { if (argc>=1 && argv[0][0]=='/') {
@ -74,7 +82,7 @@ int main(int argc, char** argv) {
OS_OSX os; OS_OSX os;
Error err = Main::setup(argv[0],argc-1,&argv[1]); Error err = Main::setup(argv[0],argc-first_arg,&argv[first_arg]);
if (err!=OK) if (err!=OK)
return 255; return 255;