GH355: Implement HKDF
[openssl.git] / util / files.pl
index d5c78bafc1bfecc696c3cc594fc45937ef51b083..32e712586d72bfac676f454f53ff92afa8b40ec4 100755 (executable)
@@ -13,7 +13,7 @@ while ($ARGV[0] =~ /^([^\s=]+)\s*=\s*(.*)$/)
 $s="";
 while (<>)
        {
-       chop;
+       s|\R$||;
        s/#.*//;
        if (/^([^\s=]+)\s*=\s*(.*)$/)
                {
@@ -23,10 +23,10 @@ while (<>)
                        {
                        if ($b =~ /\\$/)
                                {
-                               chop($b);
+                               $b=$`; # Keep what is before the backslash
                                $o.=$b." ";
-                               $b=<>;
-                               chop($b);
+                               $b = "" unless defined($b = <>);
+                               $b =~ s{\R$}{};
                                }
                        else
                                {
@@ -43,7 +43,7 @@ while (<>)
                }
        }
 
-$pwd=`pwd`; chop($pwd);
+($pwd=`pwd`) =~ s{\R$}{};
 
 if ($sym{'TOP'} eq ".")
        {
@@ -55,7 +55,7 @@ else  {
        @_=split(/\//,$pwd);
        $z=$#_-$n+1;
        foreach $i ($z .. $#_) { $dir.=$_[$i]."/"; }
-       chop($dir);
+       chop($dir);             # Remove the last slash
        }
 
 print "RELATIVE_DIRECTORY=$dir\n";