So far this hasn't been an issue as each user of dir2text wanted files
with a specific pattern. But if we want every file in the directory, we
need to skip the special files '.' and '..'.

Signed-off-by: Aaron Lauterer <[email protected]>
---
 PVE/Report.pm | 1 +
 1 file changed, 1 insertion(+)

diff --git a/PVE/Report.pm b/PVE/Report.pm
index c9109dca..435458b9 100644
--- a/PVE/Report.pm
+++ b/PVE/Report.pm
@@ -13,6 +13,7 @@ my sub dir2text {
     my $text = '';
     PVE::Tools::dir_glob_foreach($target_dir, $regexp, sub {
        my ($file) = @_;
+       return if $file eq '.' || $file eq '..';
        $text .=  "\n# cat $target_dir$file\n";
        $text .= PVE::Tools::file_get_contents($target_dir.$file)."\n";
     });
-- 
2.39.2



_______________________________________________
pve-devel mailing list
[email protected]
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

Reply via email to