32 #include <boost/algorithm/string.hpp>
49 fprintf(stderr,
"[librospack]: error while executing command\n");
59 std::string full_cmd = std::string(
"rospack ") + cmd;
63 std::vector<std::string> full_cmd_split;
64 boost::split(full_cmd_split, full_cmd,
65 boost::is_any_of(
" "),
66 boost::token_compress_on);
67 argc = full_cmd_split.size();
68 argv =
new char*[argc];
70 for(std::vector<std::string>::const_iterator it = full_cmd_split.begin();
71 it != full_cmd_split.end();
74 argv[i] =
new char[it->size()+1];
75 memset(argv[i], 0, it->size()+1);
76 memcpy(argv[i], it->c_str(), it->size());
80 int ret =
run(argc, argv);
82 for(
int i=0; i<argc; i++)