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
commit 0e4e187476

View file

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