mirror of
https://github.com/YosysHQ/yosys.git
synced 2026-08-28 17:14:11 +02:00
Support ~ for home directory
This is tested on Linux only v2: Wrap functioanlity in ifndef _WIN32 (eddiehung) Find '~/' instead of '~' (cliffordwolf) Signed-off-by: Ben Widawsky <[email protected]>
This commit is contained in:
@@ -651,6 +651,10 @@ void rewrite_filename(std::string &filename)
|
||||
filename = filename.substr(1, GetSize(filename)-2);
|
||||
if (filename.substr(0, 2) == "+/")
|
||||
filename = proc_share_dirname() + filename.substr(2);
|
||||
#ifndef _WIN32
|
||||
if (filename.substr(0, 2) == "~/")
|
||||
filename = filename.replace(0, 1, getenv("HOME"));
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef YOSYS_ENABLE_TCL
|
||||
|
||||
Reference in New Issue
Block a user