my @file_vars = ( "database", "certificate", "serial", "crlnumber",
"crl", "private_key", "RANDFILE" );
while(<STDIN>) {
- chomp;
+ s|\R$||;
foreach my $d (@directory_vars) {
if (/^(\s*\#?\s*${d}\s*=\s*)\.\/([^\s\#]*)([\s\#].*)$/) {
$_ = "$1sys\\\$disk:\[.$2$3";
open DEMANGLER_DATA, $ARGV[0]
or die "Couldn't open $ARGV[0]: $!\n";
while(<DEMANGLER_DATA>) {
- chomp;
+ s|\R$||;
(my $translated, my $original) = split /\$/;
$translations{$original} = $translated.'$';
}
# ask user for existing CA certificate
print "CA certificate filename (or enter to create)\n";
$FILE = <STDIN>;
- chop $FILE if $FILE;
+ $FILE = s|\R$|| if $FILE;
if ($FILE) {
copy_pemfile($FILE,"${CATOP}/private/$CAKEY", "PRIVATE");
copy_pemfile($FILE,"${CATOP}/$CACERT", "CERTIFICATE");
while (<>)
{
next unless /^node/;
- chop;
+ s|\R$||; # Better chomp
@a=split;
$num{$a[3]}++;
}
}
$out=$t;
}
- chop $out;
+ chop $out; # Get rid of the last comma
print OUT "$out";
}
else
$o=0;
while(<NUMIN>)
{
- chop;
+ s|\R$||;
$o++;
s/#.*$//;
next if /^\s*$/;
$o=0;
while (<IN>)
{
- chop;
+ s|\R$||;
$o++;
if (/^!module\s+(.*)$/)
{
while (<IN>)
{
- chomp;
+ s|\R$||; # Better chomp
my ($name, $num) = /^(\S+)\s+(\S+)$/;
$oid_tbl{$name} = $num;
}
while (<IN>)
{
- chomp;
+ s|\R$||; # Better chomp
s/#.*$//;
next if (/^\S*$/);
my ($xr, $p1, $p2) = /^(\S+)\s+(\S+)\s+(\S+)/;
my ($chk) = @_;
if (!exists $oid_tbl{$chk})
{
- die "Can't find \"$chk\", $!\n";
+ die "Can't find \"$chk\"\n";
}
}
if ($flavour eq "mingw64") { $gas=1; $elf=0; $win64=1;
$prefix=`echo __USER_LABEL_PREFIX__ | $ENV{CC} -E -P -`;
- chomp($prefix);
+ $prefix =~ s|\R$||; # Better chomp
}
elsif ($flavour eq "macosx") { $gas=1; $elf=0; $prefix="_"; $decor="L\$"; }
elsif ($flavour eq "masm") { $gas=0; $elf=0; $masm=$masmref; $win64=1; $decor="\$L\$"; }
}
while($line=<>) {
- chomp($line);
+ $line =~ s|\R$||; # Better chomp
$line =~ s|[#!].*$||; # get rid of asm-style comments...
$line =~ s|/\*.*\*/||; # ... and C-style comments...
my $searchterm = "";
my $goal = "";
while (<$minfo>) {
- chomp;
+ s|\R$||;
if (/^RELATIVE_DIRECTORY=(.*)$/) {
$reldir=$1;
$/ = ""; # Eat a paragraph at once.
while(<STDIN>) {
- chop;
+ s|\R$||;
s/\n/ /gm;
if (/^=head1 /) {
$name = 0;
$s="";
while (<>)
{
- chop;
+ s|\R$||;
s/#.*//;
if (/^([^\s=]+)\s*=\s*(.*)$/)
{
{
if ($b =~ /\\$/)
{
- chop($b);
+ $b=$`; # Keep what is before the backslash
$o.=$b." ";
$b=<>;
- chop($b);
+ $b =~ s|\R$||; # Better chomp
}
else
{
}
}
-$pwd=`pwd`; chop($pwd);
+$pwd=`pwd`; $pwd =~ s|\R$||;
if ($sym{'TOP'} eq ".")
{
@_=split(/\//,$pwd);
$z=$#_-$n+1;
foreach $i ($z .. $#_) { $dir.=$_[$i]."/"; }
- chop($dir);
+ chop($dir); # Remove the last slash
}
print "RELATIVE_DIRECTORY=$dir\n";
$fips_hash=<$sha1_res>;
close $sha1_res;
unlink $fips_target.".sha1";
-chomp $fips_hash;
+$fips_hash =~ s|\R$||; # Better chomp
die "Get hash failure" if $? != 0;
$hashfile = <IN>;
close IN;
$hashval = `$sha1_exe ${fips_libdir}/$filename`;
- chomp $hashfile;
- chomp $hashval;
+ $hashfile =~ s|\R$||; # Better chomp
+ $hashval =~ s|\R$||; # Better chomp
$hashfile =~ s/^.*=\s+//;
$hashval =~ s/^.*=\s+//;
die "Invalid hash syntax in file" if (length($hashfile) != 40);
{
open (IN, "util/fipslib_path.txt") || fipslib_error();
$fipslibdir = <IN>;
- chomp $fipslibdir;
+ $fipslibdir =~ s|\R$||;
close IN;
}
fips_check_files($fipslibdir,
elsif ($var eq "SSLOBJ")
{ $ret.="\$(OBJ_D)\\\$(SSL).res "; }
}
- chomp($ret);
+ chomp($ret); # Does this actually do something? /RL
$ret.="\n\n";
return($ret);
}
if($parens > 0) {
#Inside a DEPRECATEDIN
$stored_multiline .= $_;
- chomp $stored_multiline;
+ $stored_multiline =~ s|\R$||; # Better chomp
print STDERR "DEBUG: Continuing multiline DEPRECATEDIN: $stored_multiline\n" if $debug;
$parens = count_parens($stored_multiline);
if ($parens == 0) {
}
if (/\\$/) {
- chomp; # remove eol
- chop; # remove ending backslash
- $line = $_;
+ $line = $`; # keep what was before the backslash
next;
}
$cpp++ if /^#\s*if/;
$cpp-- if /^#\s*endif/;
next;
- }
+ }
$cpp = 1 if /^#.*ifdef.*cplusplus/;
s/{[^{}]*}//gs; # ignore {} blocks
\@current_algorithms);
} else {
$stored_multiline = $_;
- chomp $stored_multiline;
+ $stored_multiline =~ s|\R$||;
print STDERR "DEBUG: Found multiline DEPRECATEDIN starting with: $stored_multiline\n" if $debug;
next;
}
open(IN,"<$name") || die "unable to open $name:$!\n";
while (<IN>) {
- chop;
+ s|\R$||; # Better chomp
s/#.*$//;
next if /^\s*$/;
@a=split;
if (open(IN,"<$cfile")) {
my $line = "";
while (<IN>) {
- chomp;
+ s|\R$||; # Better chomp
$_ = $line . $_;
$line = "";
if (/{ERR_(FUNC|REASON)\(/) {
while (<IN>)
{
- chop;
+ s|\R$||;
s/#.*//;
if (/^([^\s=]+)\s*=\s*(.*)$/)
{
{
if ($b =~ /\\$/)
{
- chop($b);
+ $b=$`;
$o.=$b." ";
$b=<IN>;
- chop($b);
+ $b =~ s|\R$||;
}
else
{
$cversion=`$cc --version` if $cversion eq "";
$cversion =~ s/Reading specs.*\n//;
$cversion =~ s/usage.*\n//;
-chomp $cversion;
+$cversion =~ s|\R$||;
if (open(IN,"<CHANGES")) {
while(<IN>) {
$header=0 if /^[dr]sa/;
if (/^type/) { $header=0; next; }
next if $header;
- chop;
+ s|\R$||;
@a=split;
if ($a[0] =~ /^[dr]sa$/)
{