Fixed c filenames mangling (#12161)
This commit is contained in:
parent
e134a722de
commit
5783cd67a8
2 changed files with 4 additions and 4 deletions
|
|
@ -39,11 +39,11 @@ proc getPackageName*(conf: ConfigRef; path: string): string =
|
|||
if parents <= 0: break
|
||||
|
||||
proc fakePackageName*(conf: ConfigRef; path: AbsoluteFile): string =
|
||||
# foo/../bar becomes foo@..@bar
|
||||
result = relativeTo(path, conf.projectPath, '/').string.multiReplace({"/": "@", "@": "@@"})
|
||||
# foo-#head/../bar becomes @foo-@hhead@s..@sbar
|
||||
result = "@" & relativeTo(path, conf.projectPath, '/').string.multiReplace({"/": "@s", "#": "@h", "@": "@@"})
|
||||
|
||||
proc demanglePackageName*(path: string): string =
|
||||
result = path.multiReplace({"@@": "@", "@": "/"})
|
||||
result = path[1 .. ^1].multiReplace({"@@": "@", "@h": "#", "@s": "/"})
|
||||
|
||||
proc withPackageName*(conf: ConfigRef; path: AbsoluteFile): AbsoluteFile =
|
||||
let x = getPackageName(conf, path.string)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue