diff options
author | Yuriy Glukhov <yglukhov@users.noreply.github.com> | 2019-09-11 21:47:58 +0300 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2019-09-11 20:47:58 +0200 |
commit | 5783cd67a8eeed8597b0f5d97784c6382aa43396 (patch) | |
tree | 163e6dbdf741e3135a31ac3b598a5d982a927b75 /compiler | |
parent | e134a722decf06b8477559e3e07c2229d9c67890 (diff) | |
download | Nim-5783cd67a8eeed8597b0f5d97784c6382aa43396.tar.gz |
Fixed c filenames mangling (#12161)
Diffstat (limited to 'compiler')
-rw-r--r-- | compiler/packagehandling.nim | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/compiler/packagehandling.nim b/compiler/packagehandling.nim index 54fbe23a4..561d6dfc4 100644 --- a/compiler/packagehandling.nim +++ b/compiler/packagehandling.nim @@ -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) |