if (ctx.config.direct_mode()) {
if (!is_pch) { // else: the file has already been hashed.
- int result;
-#ifdef INODE_CACHE_SUPPORTED
- if (ctx.config.inode_cache()) {
- result = hash_source_code_file(ctx, fhash, path.c_str());
- } else {
-#endif
- char* source = nullptr;
- size_t size;
- if (st.size() > 0) {
- if (!read_file(path.c_str(), st.size(), &source, &size)) {
- return false;
- }
- } else {
- source = x_strdup("");
- size = 0;
- }
-
- result =
- hash_source_code_string(ctx, fhash, source, size, path.c_str());
- free(source);
-#ifdef INODE_CACHE_SUPPORTED
- }
-#endif
+ int result = hash_source_code_file(ctx, fhash, path.c_str());
if (result & HASH_SOURCE_CODE_ERROR
|| result & HASH_SOURCE_CODE_FOUND_TIME) {
return false;