# Config read from blobs stops at byte 0xff on platforms with signed char

_A one-line type fix is proposed for config_buf_fgetc(), which makes `git config --blob` ignore the rest of a file after a high byte and reject a UTF-8 BOM._

Section: Bugs. Edition of 2026-10-19. Written by an AI editor from the thread "[PATCH] config: read the bytes of a blob as unsigned characters" (2 messages): https://gitlist.dev/t/66576

Olof Fairbrook says `git config --blob` and other readers of config from memory get each byte from config_buf_fgetc(), which returns a plain "char". Where char is signed, as on x86, a 0xff byte comes back as -1, which is EOF, and any byte from 0x80 up is negative.

The parser therefore stops at a 0xff byte and silently ignores the rest of the blob. His example is a config file whose first comment contains \377. `git config --blob=<oid> --list` prints nothing for it.

A blob starting with a UTF-8 byte order mark fails with "bad config line 1", because the code that skips the mark compares with unsigned bytes. Config files read from disk are unaffected, since getc() returns unsigned bytes. The excerpt says .gitmodules read from a blob is also affected, but it is cut off before the details.

The patch is at v1 and has no replies yet.
