diff options
Diffstat (limited to 'compiler/options.nim')
-rw-r--r-- | compiler/options.nim | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/compiler/options.nim b/compiler/options.nim index f096f22e0..561403077 100644 --- a/compiler/options.nim +++ b/compiler/options.nim @@ -537,15 +537,15 @@ proc shortenDir*(conf: ConfigRef; dir: string): string {. ## returns the interesting part of a dir var prefix = conf.projectPath.string & DirSep if startsWith(dir, prefix): - return substr(dir, len(prefix)) + return substr(dir, prefix.len) prefix = getPrefixDir(conf).string & DirSep if startsWith(dir, prefix): - return substr(dir, len(prefix)) + return substr(dir, prefix.len) result = dir proc removeTrailingDirSep*(path: string): string = - if (len(path) > 0) and (path[len(path) - 1] == DirSep): - result = substr(path, 0, len(path) - 2) + if (path.len > 0) and (path[^1] == DirSep): + result = substr(path, 0, path.len - 2) else: result = path @@ -643,7 +643,7 @@ template patchModule(conf: ConfigRef) {.dirty.} = let ov = conf.moduleOverrides[key] if ov.len > 0: result = AbsoluteFile(ov) -proc findFile*(conf: ConfigRef; f: string; suppressStdlib = false): AbsoluteFile {.procvar.} = +proc findFile*(conf: ConfigRef; f: string; suppressStdlib = false): AbsoluteFile = if f.isAbsolute: result = if f.existsFile: AbsoluteFile(f) else: AbsoluteFile"" else: |