Fix args for embedded repo

When we generate a binary with an embedded repo,
we add various args (-vRepo.Authoritative etc) to the end
of the command line. But the argument "--" is taken to mean
"pass the rest of the args to the script". So if you use
"--" on such a binary, it gets rather badly broken.

Reorder the args so that the inserted ones come first.
Esse commit está contido em:
mwilliams
2013-03-20 16:22:43 -07:00
commit de Sara Golemon
commit 9c78f77577
+4 -1
Ver Arquivo
@@ -31,10 +31,13 @@ int main(int argc, char** argv) {
return HPHP::execute_program(argc, argv);
}
std::vector<char*> args;
args.insert(args.begin(), argv, argv + argc);
args.push_back(argv[0]);
args.push_back("-vRepo.Authoritative=true");
args.push_back("-vRepo.Local.Mode=r-");
repo = "-vRepo.Local.Path=" + repo;
args.push_back(const_cast<char*>(repo.c_str()));
if (argc > 1) {
args.insert(args.end(), argv + 1, argv + argc);
}
return HPHP::execute_program(args.size(), &args[0]);
}