Fix to escape VERILATOR_ROOT file paths (#3764) (#3765)

This commit is contained in:
Jiacheng Qian
2022-11-20 10:25:41 -05:00
committed by GitHub
parent 278d532368
commit 47253450a4
6 changed files with 40 additions and 30 deletions
+3
View File
@@ -100,6 +100,9 @@ public:
static string quotePercent(const string& str) { return quoteAny(str, '%', '%'); }
// Surround a raw string by double quote and escape if necessary
// e.g. input abc's becomes "\"abc\'s\""
static string escapeStringForPath(const string& str);
// Escape path in Windows
// e.g. input `C:\Program Files\My Program\My Program.exe` becomes `C:\\Program\ Files\\My\ Program\\My\ Program.exe`
static string quoteStringLiteralForShell(const string& str);
// Replace any unprintable with space
// This includes removing tabs, so column tracking is correct