Skip to content

Commit

Permalink
fixes disruptek/nimph#102 multi-level nim.cfg use (nim-lang#13001) [b…
Browse files Browse the repository at this point in the history
…ackport]

(cherry picked from commit 8a63cac)
  • Loading branch information
disruptek authored and narimiran committed Jan 5, 2020
1 parent 7afe6b1 commit 46be787
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions compiler/nimblecmd.nim
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,10 @@ proc getPathVersion*(p: string): tuple[name, version: string] =
result.version = ""

const specialSeparator = "-#"
var sepIdx = p.find(specialSeparator)
let last = p.rfind(p.lastPathPart) # the index where the last path part begins
var sepIdx = p.find(specialSeparator, start = last)
if sepIdx == -1:
sepIdx = p.rfind('-')
sepIdx = p.rfind('-', start = last)

if sepIdx == -1:
result.name = p
Expand Down

0 comments on commit 46be787

Please sign in to comment.