Thank you for the suggestion! Your fix is indeed cleaner — handling
the optional \r directly in the sed pattern avoids spawning an extra
tr process.

Best regard
Liaiss

On Fri, May 22, 2026 at 5:48 AM LIU Hao <[email protected]> wrote:
>
> 在 2026-5-22 11:11, LIU Hao 写道:
> > 在 2026-5-21 23:12, Liaiss Merzougue 写道:
> >> bash ../../src/mingw-w64-crt/configure
> >> --prefix=/it/sbx/wave-ms/x86_64-windows64/mingw-w64/pkg
> >> --build=x86_64-w64-mingw32 --host=x86_64-w64-mingw32 --enable-wildcard
> >> CFLAGS=-Wno-expansion-to-defined
> >> make -j 1
> >
> > The value to `--build` is incorrect; it should be `x86_64-pc-cygwin`.
> >
> > I haven't looked into configure further but I suspect this invokes a native 
> > C preprocessor which outputs
> > CRLF line endings.
>
> When writing to standard output, a native Windows program is supposed to 
> output CRLF line endings. The
> Cygwin sed does not treat CR as part of a line break:
>
>     $ file crlf.txt
>     crlf.txt: ASCII text, with CRLF line terminators
>
>     $ cat crlf.txt
>     foo@4
>
>     $ cat crlf.txt | sed -E 's/@[0-9]+$//'
>     foo@4
>
> However, this issue doesn't occur with the MSYS2 sed, which treats CRLF as a 
> whole line break:
>
>     $ cat crlf.txt | /cygdrive/c/msys64/usr/bin/sed -E 's/@[0-9]+$//'
>     foo
>
> So indeed this may be an issue. However, instead of invoking another program, 
> does this work for you if
> it's fixed directly in the sed pattern?
>
>     sed -E 's/^([^ ]+)@[0-9]+( |\r?$$)/\1\2/'
>
>                                 ^^^ ignore optional CR before LF
>
> --
> Best regards,
> LIU Hao


_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to