| ... | @@ -337,6 +337,16 @@ Error cache_hit(CacheHash *ch, Buf *out_digest) { | ... | @@ -337,6 +337,16 @@ Error cache_hit(CacheHash *ch, Buf *out_digest) { |
| 337 | return ErrorInvalidFormat; | 337 | return ErrorInvalidFormat; |
| 338 | } | 338 | } |
| 339 | | 339 | |
| | 340 | // We should be at the last item, |
| | 341 | // so switch from iterating on spaces ' ' to newlines '\n' |
| | 342 | // First, check to make sure we have the runway to do so: |
| | 343 | if (it.index == it.buffer.len) { |
| | 344 | os_file_close(ch->manifest_file); |
| | 345 | return ErrorInvalidFormat; |
| | 346 | } |
| | 347 | it.index++; |
| | 348 | // Too close for missiles, I’m switching to guns |
| | 349 | it.split_bytes = str("\n"); |
| 340 | Optional<Slice<uint8_t>> opt_file_path = SplitIterator_next(&it); | 350 | Optional<Slice<uint8_t>> opt_file_path = SplitIterator_next(&it); |
| 341 | if (!opt_file_path.is_some) { | 351 | if (!opt_file_path.is_some) { |
| 342 | os_file_close(ch->manifest_file); | 352 | os_file_close(ch->manifest_file); |