Skip to content

Commit 8a63cac

Browse files
disruptekAraq
authored andcommitted
fixes disruptek/nimph#102 multi-level nim.cfg use (nim-lang#13001) [backport]
1 parent 584e8c8 commit 8a63cac

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

compiler/nimblecmd.nim

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,10 @@ proc getPathVersion*(p: string): tuple[name, version: string] =
6969
result.version = ""
7070

7171
const specialSeparator = "-#"
72-
var sepIdx = p.find(specialSeparator)
72+
let last = p.rfind(p.lastPathPart) # the index where the last path part begins
73+
var sepIdx = p.find(specialSeparator, start = last)
7374
if sepIdx == -1:
74-
sepIdx = p.rfind('-')
75+
sepIdx = p.rfind('-', start = last)
7576

7677
if sepIdx == -1:
7778
result.name = p

0 commit comments

Comments
 (0)