escape spaces with backslash when writing dep file
filenames are sparated by spaces in the dep file. if a filename in the dep file contains spaces they must be escaped, otherwise the tool that reads the dep file will see multiple wrong filenames.
This commit is contained in:
@@ -482,6 +482,20 @@ void remove_directory(std::string dirname)
|
||||
#endif
|
||||
}
|
||||
|
||||
std::string escape_filename_spaces (const std::string& filename)
|
||||
{
|
||||
std::string out;
|
||||
out.reserve (filename.size ());
|
||||
for (auto c : filename)
|
||||
{
|
||||
if (c == ' ')
|
||||
out += "\\ ";
|
||||
else
|
||||
out.push_back (c);
|
||||
}
|
||||
return out;
|
||||
}
|
||||
|
||||
int GetSize(RTLIL::Wire *wire)
|
||||
{
|
||||
return wire->width;
|
||||
|
||||
Reference in New Issue
Block a user