Use full file path for CRC checks.

Ref nim-lang/nimsuggest#6. Ref nim-lang/nimsuggest#4.
This commit is contained in:
Dominik Picheta
2015-06-14 20:19:49 +01:00
parent 2f68b0baf0
commit 0e4e187476

View File

@@ -51,19 +51,19 @@ proc crcChanged(fileIdx: int32): bool =
of crcNotChanged:
result = false
of crcCached:
let newCrc = secureHashFile(fileIdx.toFilename)
let newCrc = secureHashFile(fileIdx.toFullPath)
result = newCrc != gMemCacheData[fileIdx].crc
gMemCacheData[fileIdx].crc = newCrc
updateStatus()
of crcNotTaken:
gMemCacheData[fileIdx].crc = secureHashFile(fileIdx.toFilename)
gMemCacheData[fileIdx].crc = secureHashFile(fileIdx.toFullPath)
result = true
updateStatus()
proc doCRC(fileIdx: int32) =
if gMemCacheData[fileIdx].crcStatus == crcNotTaken:
# echo "FIRST CRC: ", fileIdx.ToFilename
gMemCacheData[fileIdx].crc = secureHashFile(fileIdx.toFilename)
gMemCacheData[fileIdx].crc = secureHashFile(fileIdx.toFullPath)
proc addDep(x: PSym, dep: int32) =
growCache gMemCacheData, dep