From: Dr. David von Oheimb Date: Tue, 15 Nov 2022 15:33:21 +0000 (+0100) Subject: ParseC.pm: gracefully handle DOS-style end-of-line in source files X-Git-Tag: openssl-3.2.0-alpha1~1707 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c507db9678f50482df5f6c58e42572fe6fe3007c;p=thirdparty%2Fopenssl.git ParseC.pm: gracefully handle DOS-style end-of-line in source files When header files happen to have \r\n at line end, prevent hick-ups like: Unmatched parentheses at include/openssl/asn1.h line 520 make[1]: *** [Makefile:4757: util/libcrypto.num] Error 255 make[1]: *** Waiting for unfinished jobs.... make: *** [Makefile:3387: build_sw] Error 2 Reviewed-by: Richard Levitte Reviewed-by: Tomas Mraz Reviewed-by: David von Oheimb (Merged from https://github.com/openssl/openssl/pull/19686) --- diff --git a/util/perl/OpenSSL/ParseC.pm b/util/perl/OpenSSL/ParseC.pm index 3f14cac9cd2..661bd118185 100644 --- a/util/perl/OpenSSL/ParseC.pm +++ b/util/perl/OpenSSL/ParseC.pm @@ -822,7 +822,7 @@ sub parse { # We use ¦undef¦ as a marker for a new line from the file. # Since we convert one line to several and unshift that into @lines, # that's the only safe way we have to track the original lines - my @lines = map { ( undef, $_ ) } split $/, $line; + my @lines = map { ( undef, $_ ) } split m|\R|, $line; # Remember that extra # we added above? Now we remove it pop @lines;