#244 Escape spaces in filenames

master
Marius Kintel 2014-10-14 16:31:09 -04:00
parent d20e1efbbd
commit f7b15e92a5
1 changed files with 5 additions and 6 deletions

View File

@ -15,12 +15,11 @@ const char *make_command = NULL;
void handle_dep(const std::string &filename)
{
fs::path filepath(filename);
if ( boosty::is_absolute( filepath )) {
dependencies.insert(filename);
}
else {
dependencies.insert((fs::current_path() / filepath).string());
}
std::string dep;
if (boosty::is_absolute(filepath)) dep = filename;
else dep = (fs::current_path() / filepath).string();
dependencies.insert(boost::regex_replace(filename, boost::regex("\\ "), "\\\\ "));
if (!fs::exists(filepath) && make_command) {
std::stringstream buf;
buf << make_command << " '" << boost::regex_replace(filename, boost::regex("'"), "'\\''") << "'";