You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@apr.apache.org by wr...@apache.org on 2020/08/05 16:15:59 UTC

svn commit: r1880610 - /apr/apr/trunk/build/lineends.pl

Author: wrowe
Date: Wed Aug  5 16:15:58 2020
New Revision: 1880610

URL: http://svn.apache.org/viewvc?rev=1880610&view=rev
Log:
Avoid traversing .git or .svn trees, avoid correcting non-file entities (e.g. links)

Modified:
    apr/apr/trunk/build/lineends.pl

Modified: apr/apr/trunk/build/lineends.pl
URL: http://svn.apache.org/viewvc/apr/apr/trunk/build/lineends.pl?rev=1880610&r1=1880609&r2=1880610&view=diff
==============================================================================
--- apr/apr/trunk/build/lineends.pl (original)
+++ apr/apr/trunk/build/lineends.pl Wed Aug  5 16:15:58 2020
@@ -14,6 +14,7 @@
 
 use IO::File;
 use File::Find;
+use Fcntl ':mode';
 
 # The ignore list is '-' seperated, with this leading hyphen and
 # trailing hyphens in ever concatinated list below.
@@ -102,8 +103,9 @@ sub totxt {
                 }
             }
         }
-        return if ($File::Find::dir =~ m|^(.+/)?.svn(/.+)?$|);
+        return if ($File::Find::dir =~ m|^(.+/)?(\.svn\|\.git)(/.+)?$|);
         @ostat = stat($oname);
+        return if (!S_ISREG($ostat[2]));
         $srcfl = new IO::File $oname, "r" or die;
         $dstfl = new IO::File $tname, "w" or die;
         binmode $srcfl;