]> Sergey Matveev's repositories - swg.git/commitdiff
Fixed files ignoring
authorSergey Matveev <stargrave@stargrave.org>
Thu, 15 May 2025 11:11:45 +0000 (14:11 +0300)
committerSergey Matveev <stargrave@stargrave.org>
Thu, 15 May 2025 11:11:45 +0000 (14:11 +0300)
zk

diff --git a/zk b/zk
index ef115e8472b6f424831e7a65e6c9c6f4a4547559..5ce87c34b3ccb80ab57bbbd85abbe162106ad70e 100755 (executable)
--- a/zk
+++ b/zk
@@ -73,10 +73,10 @@ sub noindex {
     my $mtime;
     sub wanted {
         my $fn = $_;
-        return if ($fn =~ /^[.]/) && ($fn ne q{.});
+        return if (($fn =~ /^[.]/) && ($fn ne q{.}));
         $pth = $File::Find::name;
         $pth = decode q{UTF-8}, $pth;
-        $pth =~ s/^[.][\/]?//;
+        $pth =~ s/^[.]\/?//;
         if (-d $fn) {
             return if isignored "$pth/";
             opendir my $dh, $fn or croak "$!";
@@ -86,14 +86,14 @@ sub noindex {
                 next if /^[.]/;
                 $_ = decode q{UTF-8}, $_;
                 if (-d "$fn/$_") {
-                    next if isignored(($fn eq q{.}) ? $_ : "$fn/$_/");
                     $_ = "$pth/$_/";
                     s/^\///;
+                    next if isignored $_;
                     push @_dirs, $_;
                 } else {
-                    next if isignored(($fn eq q{.}) ? $_ : "$fn/$_");
                     $_ = "$pth/$_";
                     s/^\///;
+                    next if isignored $_;
                     push @_files, $_;
                 }
             }