]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
ParseC.pm: gracefully handle DOS-style end-of-line in source files
authorDr. David von Oheimb <David.von.Oheimb@siemens.com>
Tue, 15 Nov 2022 15:33:21 +0000 (16:33 +0100)
committerDr. David von Oheimb <dev@ddvo.net>
Fri, 18 Nov 2022 06:47:44 +0000 (07:47 +0100)
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 <levitte@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: David von Oheimb <david.von.oheimb@siemens.com>
(Merged from https://github.com/openssl/openssl/pull/19686)

util/perl/OpenSSL/ParseC.pm

index 3f14cac9cd2c809966d6da76e58fbfe1e731f92c..661bd1181850d6c1004f0cfaf6e7f9fcd17f56b1 100644 (file)
@@ -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;