flex
flex copied to clipboard
build: Fix unportable sed expression in mkskel.sh
'\r' in sed is not portable, at least to BSD sed (and macOS). Replace it with embedded CR character in sed expression.
Fixes #294 (regression caused by #243)
@stek29 and @jannick0, I need you to test this one as I don't have a BSD sed to do so.
@Explorer09 That looks good for LF and CRLF files where sed
from cygwin32 and msys2 is called. I cannot say anything about CR files, since I am on Windows, but I am curious if it works on macOS, as well.
@jannick0 I'm not caring for CR-only files yet. Since Mac OS Classic ports of sed
(if any) would need to treat CR as pattern space terminators anyway and is beyond what our sed expression can workaround already.
My idea was to accept both CR+LF and LF, but output in the OS-native line termination scheme (or whatever the sed
was configured to output). Any complex line termination scheme (CR only, NEL ('\x85'
) or form feeds ('\f'
)) is beyond the scope of this patch.
Note: sed
uses the pattern space concept instead of a line for processing. The reason is that sed
allows joining multiple lines into one pattern space for processing together (with N
command), or split a line into two spaces (P;D
commands combination) for processing. The pattern space is more flexible than a line in terms of stream processing.
Sorry for long wait I confirm it works fine with Apple (BSD?) sed.
Thanks for the confirmation.
On Friday, 27 April 2018, 12:09 pm +0000, Viktor Oreshkin [email protected] wrote:
Sorry for long wait I confirm it works fine with Apple (BSD?) sed.
-- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/westes/flex/pull/353#issuecomment-384951452
-- Will Estes [email protected]
Resolve #539
This got handled by other means.