From 5783cd67a8eeed8597b0f5d97784c6382aa43396 Mon Sep 17 00:00:00 2001 From: Yuriy Glukhov Date: Wed, 11 Sep 2019 21:47:58 +0300 Subject: Fixed c filenames mangling (#12161) --- compiler/packagehandling.nim | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'compiler') 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) -- cgit 1.4.1-2-gfad0