diff options
| author | Joey Yakimowich-Payne <jyapayne@gmail.com> | 2018-07-18 07:52:45 +0900 |
|---|---|---|
| committer | Joey Yakimowich-Payne <jyapayne@gmail.com> | 2018-07-18 07:52:45 +0900 |
| commit | 6343567a9182dccac9edb61c636bd5ddf2732cfe (patch) | |
| tree | 1260f91641fc6fb82e5451dfa192e1ebc174b4e0 | |
| parent | 5e3c0999e0f969f7fb18fa14b8587b177e52666e (diff) | |
| download | nimgen-6343567a9182dccac9edb61c636bd5ddf2732cfe.tar.gz nimgen-6343567a9182dccac9edb61c636bd5ddf2732cfe.zip | |
Put sanitizePath in search()
| -rw-r--r-- | src/nimgen/c2nim.nim | 2 | ||||
| -rw-r--r-- | src/nimgen/external.nim | 2 | ||||
| -rw-r--r-- | src/nimgen/file.nim | 4 | ||||
| -rw-r--r-- | src/nimgen/runcfg.nim | 2 |
4 files changed, 5 insertions, 5 deletions
diff --git a/src/nimgen/c2nim.nim b/src/nimgen/c2nim.nim index fe257f2..f171e8d 100644 --- a/src/nimgen/c2nim.nim +++ b/src/nimgen/c2nim.nim @@ -6,7 +6,7 @@ template relativePath(path: untyped): untyped = path.multiReplace([(gOutput, ""), ("\\", "/"), ("//", "/")]) proc c2nim*(fl, outfile: string, c2nimConfig: c2nimConfigObj) = - var file = search(fl).sanitizePath + var file = search(fl) if file.len() == 0: return diff --git a/src/nimgen/external.nim b/src/nimgen/external.nim index 350c841..c0d5fdc 100644 --- a/src/nimgen/external.nim +++ b/src/nimgen/external.nim @@ -118,7 +118,7 @@ proc runPreprocess*(file, ppflags, flags: string, inline: bool): string = var rdata: Rope start = false - sfile = file.replace("\\", "/") + sfile = file.sanitizePath if inline: sfile = sfile.parentDir() diff --git a/src/nimgen/file.nim b/src/nimgen/file.nim index d78c692..708ae4a 100644 --- a/src/nimgen/file.nim +++ b/src/nimgen/file.nim @@ -1,6 +1,6 @@ import os, ospaths, pegs, regex, strutils, tables -import globals +import globals, external # ### # File loction @@ -44,7 +44,7 @@ proc search*(file: string): string = quit(1) # Only keep relative directory - return result.multiReplace([("\\", $DirSep), ("//", $DirSep), (gProjectDir & $DirSep, "")]) + return result.sanitizePath.replace(gProjectDir & "/", "") proc rename*(file: string, renfile: string) = if file.splitFile().ext == ".nim": diff --git a/src/nimgen/runcfg.nim b/src/nimgen/runcfg.nim index cafb48e..7255c52 100644 --- a/src/nimgen/runcfg.nim +++ b/src/nimgen/runcfg.nim @@ -25,7 +25,7 @@ proc getKey(ukey: string): tuple[key: string, val: bool] = proc runFile*(file: string, cfgin: OrderedTableRef = newOrderedTable[string, string]()) = var cfg = cfgin - sfile = search(file).sanitizePath + sfile = search(file) if sfile in gDoneRecursive: return |
