Note the use of "rt" is non-standard, but we're restricting
its use here to systems that define O_BINARY, which should
invariably support "rt" mode.
* src/digest.c (): Where significant, explicitly use "rt" mode
with --text, as MSYS2 defaults to binary mode for fopen'd files
(though not for standard streams).
* NEWS: Mention the bug fix.
Fixes https://github.com/coreutils/coreutils/issues/123
* Noteworthy changes in release ?.? (????-??-??) [?]
+** Bug fixes
+
+ md5sum --text correctly translates CRLF line endings with the MSYS2 runtime.
+ This also applies to the sha*sum and b2sum utilities.
+ [This bug was present in "the beginning".]
+
* Noteworthy changes in release 9.9 (2025-11-10) [stable]
}
else
{
- fp = fopen (filename, (O_BINARY && *binary ? "rb" : "r"));
+ fp = fopen (filename, O_BINARY ? (*binary ? "rb" : "rt") : "r");
if (fp == nullptr)
{
if (ignore_missing && errno == ENOENT)