src/cache_hash.cpp: support file paths that contain spaces;

ref: #1510
This commit is contained in:
kristopher tate 2018-09-13 23:34:01 +09:00
parent e70c543bc4
commit 6d0a122816
No known key found for this signature in database
GPG Key ID: AEE8EEAD03E20816

View File

@ -337,6 +337,16 @@ Error cache_hit(CacheHash *ch, Buf *out_digest) {
return ErrorInvalidFormat;
}
// We should be at the last item,
// so switch from iterating on spaces ' ' to newlines '\n'
// First, check to make sure we have the runway to do so:
if (it.index == it.buffer.len) {
os_file_close(ch->manifest_file);
return ErrorInvalidFormat;
}
it.index++;
// Too close for missiles, Im switching to guns
it.split_bytes = str("\n");
Optional<Slice<uint8_t>> opt_file_path = SplitIterator_next(&it);
if (!opt_file_path.is_some) {
os_file_close(ch->manifest_file);