Commit a22be40
[gobby-cli-#958] fix: restore full-stream NUL scan in gcode is_binary
#951 (CodeRabbit triage) reverted the #17356 loop back to a single 8192-byte
read while keeping the "null bytes anywhere in the stream" doc comment, so a
file with a NUL byte past the first 8KB was misclassified as text and indexed —
the late-NUL regression (Gobby #17344). Restore the chunked loop (already bounded
by MAX_FILE_SIZE via is_safe_text_file) and add a rationale comment so it is not
narrowed again.
Validation:
- cargo nextest run -p gobby-code -E 'test(/late_nul/)' with AND without default
features: 3 passed (skips_content_only/ast_*_late_nul_byte, explicit route).
- cargo clippy -p gobby-code [--no-default-features] -- -D warnings: clean.
- cargo fmt --all --check: clean.
Note: 3 serial_db tests fail locally on a missing/dirty postgres test DB; they
pass in CI (which provisions a clean postgres service).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent 420ab81 commit a22be40
1 file changed
Lines changed: 17 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
48 | 53 | | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
54 | 66 | | |
55 | 67 | | |
56 | 68 | | |
| |||
0 commit comments