From ce3d25d3e5a7e82fd59fd30dff7acc39baed8b5e Mon Sep 17 00:00:00 2001 From: Viktor Dukhovni Date: Sat, 13 Feb 2016 02:53:13 -0500 Subject: [PATCH] Fix some issues near recent chomp changes. Reviewed-by: Richard Levitte --- apps/CA.pl.in | 6 +++--- crypto/perlasm/x86_64-xlate.pl | 2 +- util/files.pl | 6 +++--- util/mk1mf.pl | 4 +++- util/mkfiles.pl | 4 ++-- 5 files changed, 12 insertions(+), 10 deletions(-) diff --git a/apps/CA.pl.in b/apps/CA.pl.in index fbba457646..f5e8e4a191 100644 --- a/apps/CA.pl.in +++ b/apps/CA.pl.in @@ -120,9 +120,9 @@ if ($WHAT eq '-newcert' ) { close OUT; # ask user for existing CA certificate print "CA certificate filename (or enter to create)\n"; - $FILE = ; - $FILE = s|\R$|| if $FILE; - if ($FILE) { + $FILE = "" unless defined($FILE = ); + $FILE =~ s{\R$}{}; + if ($FILE ne "") { copy_pemfile($FILE,"${CATOP}/private/$CAKEY", "PRIVATE"); copy_pemfile($FILE,"${CATOP}/$CACERT", "CERTIFICATE"); } else { diff --git a/crypto/perlasm/x86_64-xlate.pl b/crypto/perlasm/x86_64-xlate.pl index a0b3bc0670..0a023fb82f 100755 --- a/crypto/perlasm/x86_64-xlate.pl +++ b/crypto/perlasm/x86_64-xlate.pl @@ -850,7 +850,7 @@ ___ OPTION DOTNAME ___ } -while($line=<>) { +while(defined($line=<>)) { $line =~ s|\R$||; # Better chomp diff --git a/util/files.pl b/util/files.pl index d984196616..32e712586d 100755 --- a/util/files.pl +++ b/util/files.pl @@ -25,8 +25,8 @@ while (<>) { $b=$`; # Keep what is before the backslash $o.=$b." "; - $b=<>; - $b =~ s|\R$||; # Better chomp + $b = "" unless defined($b = <>); + $b =~ s{\R$}{}; } else { @@ -43,7 +43,7 @@ while (<>) } } -$pwd=`pwd`; $pwd =~ s|\R$||; +($pwd=`pwd`) =~ s{\R$}{}; if ($sym{'TOP'} eq ".") { diff --git a/util/mk1mf.pl b/util/mk1mf.pl index 3a9f0d76b8..f29e50bb77 100755 --- a/util/mk1mf.pl +++ b/util/mk1mf.pl @@ -553,8 +553,10 @@ if ($fips) { open (IN, "util/fipslib_path.txt") || fipslib_error(); $fipslibdir = ; - $fipslibdir =~ s|\R$||; close IN; + $fipslibdir = "" unless defined($fipslibdir); + $fipslibdir =~ s{\R$}{}; + fipslib_error() if ($fipslibdir eq ""); } fips_check_files($fipslibdir, "fipscanister.lib", "fipscanister.lib.sha1", diff --git a/util/mkfiles.pl b/util/mkfiles.pl index 4fbe29ac75..55dfbc64e3 100755 --- a/util/mkfiles.pl +++ b/util/mkfiles.pl @@ -107,8 +107,8 @@ while () { $b=$`; $o.=$b." "; - $b=; - $b =~ s|\R$||; + $b = "" unless defined($b = ); + $b =~ s{\R$}{}; } else { -- 2.25.1