diff options
author | Gilles Peskine <Gilles.Peskine@arm.com> | 2021-04-23 09:44:59 +0200 |
---|---|---|
committer | Gilles Peskine <Gilles.Peskine@arm.com> | 2021-04-23 09:44:59 +0200 |
commit | e10a783bb38cc47753c9c0f04b85ca27b358ed73 (patch) | |
tree | 839b43ffbf1a817ca28a628541e428f1ed42a93a | |
parent | e7a2aec109785dd48e72b5c4dd3e17fccbc2f280 (diff) | |
download | mbedtls-archive/dev/gilles-peskine-arm/no-generated-files-3.0-windows.zip mbedtls-archive/dev/gilles-peskine-arm/no-generated-files-3.0-windows.tar.gz mbedtls-archive/dev/gilles-peskine-arm/no-generated-files-3.0-windows.tar.bz2 |
Accept Windows line endings on inputs on any platformarchive/dev/gilles-peskine-arm/no-generated-files-3.0-windows
Accept Windows line endings in input files on any platform. This makes
the scripts work even when running a Unix perl with a source tree that
has Windows line endings, as happens for example on our Travis Windows
instances. This change is harmless in the common case where the input
has the platform's default line endings.
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
-rwxr-xr-x | scripts/generate_errors.pl | 4 | ||||
-rwxr-xr-x | scripts/generate_features.pl | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/scripts/generate_errors.pl b/scripts/generate_errors.pl index ed17a0d..606714f 100755 --- a/scripts/generate_errors.pl +++ b/scripts/generate_errors.pl @@ -56,7 +56,7 @@ my @high_level_modules = qw( CIPHER DHM ECP MD my $line_separator = $/; undef $/; -open(FORMAT_FILE, "$error_format_file") or die "Opening error format file '$error_format_file': $!"; +open(FORMAT_FILE, '<:crlf', "$error_format_file") or die "Opening error format file '$error_format_file': $!"; my $error_format = <FORMAT_FILE>; close(FORMAT_FILE); @@ -66,7 +66,7 @@ my @files = <$include_dir/*.h>; my @necessary_include_files; my @matches; foreach my $file (@files) { - open(FILE, "$file"); + open(FILE, '<:crlf', "$file"); my @grep_res = grep(/^\s*#define\s+MBEDTLS_ERR_\w+\s+\-0x[0-9A-Fa-f]+/, <FILE>); push(@matches, @grep_res); close FILE; diff --git a/scripts/generate_features.pl b/scripts/generate_features.pl index 74a9527..6b1dcbf 100755 --- a/scripts/generate_features.pl +++ b/scripts/generate_features.pl @@ -45,13 +45,13 @@ my @sections = ( "System support", "mbed TLS modules", my $line_separator = $/; undef $/; -open(FORMAT_FILE, "$feature_format_file") or die "Opening feature format file '$feature_format_file': $!"; +open(FORMAT_FILE, '<:crlf', "$feature_format_file") or die "Opening feature format file '$feature_format_file': $!"; my $feature_format = <FORMAT_FILE>; close(FORMAT_FILE); $/ = $line_separator; -open(CONFIG_H, "$include_dir/config.h") || die("Failure when opening config.h: $!"); +open(CONFIG_H, '<:crlf', "$include_dir/config.h") || die("Failure when opening config.h: $!"); my $feature_defines = ""; my $in_section = 0; |