Put sanitizePath in search()

This commit is contained in:
Joey Yakimowich-Payne 2018-07-18 07:52:45 +09:00
commit 6343567a91
4 changed files with 5 additions and 5 deletions

View file

@ -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

View file

@ -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()

View file

@ -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":

View file

@ -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