X-Git-Url: https://feistymeow.org/gitweb/?a=blobdiff_plain;f=nucleus%2Flibrary%2Ffilesystem%2Ffile_info.cpp;h=13e503f4c62c1d92698d16f703d0956ac58de40a;hb=56a8b71bcfe324f83044a12738004151ff2fc064;hp=ed66d7b4de58ff28ab4c227990b515954461ca9b;hpb=457b128b77b5b4a0b7dd3094de543de2ce1477ad;p=feisty_meow.git diff --git a/nucleus/library/filesystem/file_info.cpp b/nucleus/library/filesystem/file_info.cpp index ed66d7b4..13e503f4 100644 --- a/nucleus/library/filesystem/file_info.cpp +++ b/nucleus/library/filesystem/file_info.cpp @@ -134,7 +134,10 @@ bool file_info::calculate(const astring &prefix, bool just_size, int checksum_ed bool skip_tail = false; // true if we don't need the tail piece. double head_start = 0, head_end = 0, tail_start = 0, tail_end = _file_size - 1; - if (_file_size <= double(2 * checksum_edge)) { + if (_file_size == 0) { + head_end = 0; + skip_tail = true; + } else if (_file_size <= double(2 * checksum_edge)) { // we're applying a rule for when the file is too small compared to // the chunk factor doubled; we'll just read the whole file. head_end = _file_size - 1; @@ -188,6 +191,7 @@ int file_info::packed_size() const void file_info::pack(byte_array &packed_form) const { + FUNCDEF("pack"); filename::pack(packed_form); attach(packed_form, _file_size); _time.pack(packed_form);