Fix some issues near recent chomp changes.

Reviewed-by: Richard Levitte <levitte@openssl.org>
This commit is contained in:
Viktor Dukhovni 2016-02-13 02:53:13 -05:00
parent e314c34073
commit ce3d25d3e5
5 changed files with 12 additions and 10 deletions

View File

@ -120,9 +120,9 @@ if ($WHAT eq '-newcert' ) {
close OUT; close OUT;
# ask user for existing CA certificate # ask user for existing CA certificate
print "CA certificate filename (or enter to create)\n"; print "CA certificate filename (or enter to create)\n";
$FILE = <STDIN>; $FILE = "" unless defined($FILE = <STDIN>);
$FILE = s|\R$|| if $FILE; $FILE =~ s{\R$}{};
if ($FILE) { if ($FILE ne "") {
copy_pemfile($FILE,"${CATOP}/private/$CAKEY", "PRIVATE"); copy_pemfile($FILE,"${CATOP}/private/$CAKEY", "PRIVATE");
copy_pemfile($FILE,"${CATOP}/$CACERT", "CERTIFICATE"); copy_pemfile($FILE,"${CATOP}/$CACERT", "CERTIFICATE");
} else { } else {

View File

@ -850,7 +850,7 @@ ___
OPTION DOTNAME OPTION DOTNAME
___ ___
} }
while($line=<>) { while(defined($line=<>)) {
$line =~ s|\R$||; # Better chomp $line =~ s|\R$||; # Better chomp

View File

@ -25,8 +25,8 @@ while (<>)
{ {
$b=$`; # Keep what is before the backslash $b=$`; # Keep what is before the backslash
$o.=$b." "; $o.=$b." ";
$b=<>; $b = "" unless defined($b = <>);
$b =~ s|\R$||; # Better chomp $b =~ s{\R$}{};
} }
else else
{ {
@ -43,7 +43,7 @@ while (<>)
} }
} }
$pwd=`pwd`; $pwd =~ s|\R$||; ($pwd=`pwd`) =~ s{\R$}{};
if ($sym{'TOP'} eq ".") if ($sym{'TOP'} eq ".")
{ {

View File

@ -553,8 +553,10 @@ if ($fips)
{ {
open (IN, "util/fipslib_path.txt") || fipslib_error(); open (IN, "util/fipslib_path.txt") || fipslib_error();
$fipslibdir = <IN>; $fipslibdir = <IN>;
$fipslibdir =~ s|\R$||;
close IN; close IN;
$fipslibdir = "" unless defined($fipslibdir);
$fipslibdir =~ s{\R$}{};
fipslib_error() if ($fipslibdir eq "");
} }
fips_check_files($fipslibdir, fips_check_files($fipslibdir,
"fipscanister.lib", "fipscanister.lib.sha1", "fipscanister.lib", "fipscanister.lib.sha1",

View File

@ -107,8 +107,8 @@ while (<IN>)
{ {
$b=$`; $b=$`;
$o.=$b." "; $o.=$b." ";
$b=<IN>; $b = "" unless defined($b = <IN>);
$b =~ s|\R$||; $b =~ s{\R$}{};
} }
else else
{ {