diff --git a/compiler/docgen.nim b/compiler/docgen.nim index 307761409c..71af95a5f2 100644 --- a/compiler/docgen.nim +++ b/compiler/docgen.nim @@ -148,7 +148,7 @@ proc cmpDecimalsIgnoreCase(a, b: string): int = limitB = iB while limitA < aLen and isDigit(a[limitA]): inc limitA while limitB < bLen and isDigit(b[limitB]): inc limitB - var pos = max(limitA-iA, limitB-iA) + var pos = max(limitA-iA, limitB-iB) while pos > 0: if limitA-pos < iA: # digit in `a` is 0 effectively result = ord('0') - ord(b[limitB-pos])