mirror of
https://github.com/nim-lang/Nim.git
synced 2026-04-21 06:45:27 +00:00
make more tests green
This commit is contained in:
@@ -74,11 +74,11 @@ proc rawInsert[T](c: var CritBitTree[T], key: string): Node[T] =
|
||||
var newByte = 0
|
||||
block blockX:
|
||||
while newbyte < key.len:
|
||||
if it.key[newbyte] != key[newbyte]:
|
||||
if newbyte >= it.key.len or it.key[newbyte] != key[newbyte]:
|
||||
newotherbits = it.key[newbyte].ord xor key[newbyte].ord
|
||||
break blockX
|
||||
inc newbyte
|
||||
if it.key[newbyte] != '\0':
|
||||
if newbyte < it.key.len:
|
||||
newotherbits = it.key[newbyte].ord
|
||||
else:
|
||||
return it
|
||||
|
||||
@@ -196,7 +196,7 @@ proc joinPath*(head, tail: string): string {.
|
||||
else:
|
||||
result = head & tail
|
||||
else:
|
||||
if tail[0] in {DirSep, AltSep}:
|
||||
if tail.len > 0 and tail[0] in {DirSep, AltSep}:
|
||||
result = head & tail
|
||||
else:
|
||||
result = head & DirSep & tail
|
||||
|
||||
Reference in New Issue
Block a user