mirror of
https://github.com/fscotto/fsnap.git
synced 2026-11-26 03:09:51 +00:00
Three problems in load_in_memory, all visible from the command line: An empty snapshot was treated as an error, though create() produces one for an empty directory and list() accepts it. Diffing against it should report every record of the other side as added or deleted. A malformed record jumped to cleanup without setting errno and without naming the offending line, so main() printed strerror() of whatever was left over, normally 0: $ fsnap diff old.fsnap malformed.fsnap diff failed: Success The enum Fields it passed to RecordObjectUnpack was uninitialised and then discarded, even though list() uses the same out-parameter to say which field failed. Report parse failures the way list() does, with snapshot:line: field, and give them the same distinct 128 status so main() does not append a second, meaningless message. Guard qsort against the now-reachable NULL array, and check fflush(stdout) as scan() already does. $ fsnap diff old.fsnap malformed.fsnap malformed.fsnap:3: unparsable line Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018KyCHPAxWzqa3vHKdXJkgx