• Mattias Engdegård's avatar
    Fix ASCII-only conversion logic (bug#40407) · d3e2c880
    Mattias Engdegård authored
    To sidestep conversion altogether when EOL conversion applies, we must
    either be encoding a string without NL, or decoding without CR.
    
    * src/coding.c (string_ascii_p): Revert to a pure predicate.
    (code_convert_string): Fix logic.  Don't use uninitialised
    ascii_p (removed).  Use memchr to detect CR or LF in string when needed.
    * test/src/coding-tests.el (coding-nocopy-ascii):
    Update tests to include encodings with explicit EOL conversions.
    d3e2c880
coding-tests.el 16.5 KB