Skip to content

Commit

Permalink
ParseC.pm: gracefully handle DOS-style end-of-line in source files
Browse files Browse the repository at this point in the history
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 #19686)

(cherry picked from commit c507db9)
  • Loading branch information
DDvO committed Nov 18, 2022
1 parent 3e0a1c2 commit 9aa9d6a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion util/perl/OpenSSL/ParseC.pm
Expand Up @@ -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;
Expand Down

0 comments on commit 9aa9d6a

Please sign in to comment.