From 9aa9d6a94266a8f21875035ab940f799429dabd1 Mon Sep 17 00:00:00 2001 From: "Dr. David von Oheimb" Date: Tue, 15 Nov 2022 16:33:21 +0100 Subject: [PATCH] ParseC.pm: gracefully handle DOS-style end-of-line in source files Reviewed-by: Richard Levitte Reviewed-by: Tomas Mraz Reviewed-by: David von Oheimb (Merged from https://github.com/openssl/openssl/pull/19686) (cherry picked from commit c507db9678f50482df5f6c58e42572fe6fe3007c) --- util/perl/OpenSSL/ParseC.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/perl/OpenSSL/ParseC.pm b/util/perl/OpenSSL/ParseC.pm index e3cfe07827631..f98dd0e25e3b8 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;