From a89534eb9653fa705dfb9b9c61d805cfe1888dcf Mon Sep 17 00:00:00 2001 From: Miran Date: Thu, 24 Jan 2019 14:40:16 +0100 Subject: [PATCH] fix #9556 (#10445) --- compiler/msgs.nim | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/compiler/msgs.nim b/compiler/msgs.nim index b5ecdf6f06..7f6fd4c46d 100644 --- a/compiler/msgs.nim +++ b/compiler/msgs.nim @@ -190,13 +190,13 @@ template toFullPath*(conf: ConfigRef; info: TLineInfo): string = proc toMsgFilename*(conf: ConfigRef; info: TLineInfo): string = if info.fileIndex.int32 < 0: result = "???" - return + return let absPath = conf.m.fileInfos[info.fileIndex.int32].fullPath.string - let relPath = conf.m.fileInfos[info.fileIndex.int32].projPath.string if optListFullPaths in conf.globalOptions: result = absPath else: - result = if absPath.len < relPath.len: absPath else: relPath + let relPath = conf.m.fileInfos[info.fileIndex.int32].projPath.string + result = if relPath.count("..") > 2: absPath else: relPath proc toLinenumber*(info: TLineInfo): int {.inline.} = result = int info.line