aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoey Yakimowich-Payne <jyapayne@gmail.com>2018-07-10 13:53:53 +0900
committerJoey Yakimowich-Payne <jyapayne@gmail.com>2018-07-10 15:22:50 +0900
commitf5e8535ce83c79d66e32e1ebe2d5f1a945f61c77 (patch)
tree5e0ea66cfa61b74512bbb9359cc4e9d39f0b10ad
parent2e894dc90702b92290c226dd683a198b3d092634 (diff)
downloadnimgen-f5e8535ce83c79d66e32e1ebe2d5f1a945f61c77.tar.gz
nimgen-f5e8535ce83c79d66e32e1ebe2d5f1a945f61c77.zip
Fix windows paths
-rw-r--r--nimgen.nim5
1 files changed, 2 insertions, 3 deletions
diff --git a/nimgen.nim b/nimgen.nim
index 6baea3b..94fa48c 100644
--- a/nimgen.nim
+++ b/nimgen.nim
@@ -225,8 +225,7 @@ proc search(file: string): string =
quit(1)
# Only keep relative directory
- result = result.replace(gProjectDir & $DirSep, "")
- return result.replace(re"[\\/]", $DirSep)
+ return result.multiReplace([("\\", $DirSep), ("//", $DirSep), (gProjectDir & $DirSep, "")])
# ###
# Loading / unloading
@@ -389,7 +388,7 @@ proc getIncls(file: string, inline=false): seq[string] =
# OSError if the file does not exist
let
finc = expandFileName(curPath / addInc)
- fname = extractFileName(finc).search()
+ fname = finc.replace(curPath & $DirSep, "")
if fname.len() > 0:
# only add if the file is non-empty