-
- const char *Args[3];
- Args[0] = Prog->Binary;
- if (Comp == true)
- Args[1] = Prog->CompArgs;
- else
- Args[1] = Prog->UnCompArgs;
- Args[2] = 0;
- execvp(Args[0],(char **)Args);
+
+ std::vector<char const*> Args;
+ Args.push_back(Prog.Binary.c_str());
+ std::vector<std::string> const * const addArgs =
+ (Comp == true) ? &(Prog.CompressArgs) : &(Prog.UncompressArgs);
+ for (std::vector<std::string>::const_iterator a = addArgs->begin();
+ a != addArgs->end(); ++a)
+ Args.push_back(a->c_str());
+ Args.push_back(NULL);
+
+ execvp(Args[0],(char **)&Args[0]);