···9191 void** sp;
9292 int pushCount = 0;
9393 const char* apple[3];
9494- char *filename, *p;
9595-9494+ char *filename, *p = NULL;
9595+ // sys_execve() passes the original file path appended to the mldr path in argv[0].
9696+ if (argc > 0)
9797+ p = strchr(argv[0], '!');
9898+9699 if (argc <= 1)
97100 {
9898- fprintf(stderr, "mldr is part of Darling. It is not to be executed directly.\n");
9999- return 1;
101101+ if (p == NULL) {
102102+ fprintf(stderr, "mldr is part of Darling. It is not to be executed directly.\n");
103103+ return 1;
104104+ }
105105+ else
106106+ {
107107+ fprintf(stderr, "mldr: warning: Executing with no argv[0]. Continuing anyway, but this is probably a bug.\n");
108108+ }
100109 }
101110102102- // sys_execve() passes the original file path appended to the mldr path in argv[0].
103103-104104- p = strchr(argv[0], '!');
105111 if (p != NULL)
106112 {
107113 filename = (char*) __builtin_alloca(strlen(argv[0])+1);