[Pgp-tools-commit] r867 - trunk/caff

Guilhem Moulin guilhem-guest at moszumanska.debian.org
Tue Jul 12 19:34:34 UTC 2016


Author: guilhem-guest
Date: 2016-07-12 19:34:34 +0000 (Tue, 12 Jul 2016)
New Revision: 867

Modified:
   trunk/caff/caff
Log:
caff: Ensure each array reference is defined before pushing into it.

Modified: trunk/caff/caff
===================================================================
--- trunk/caff/caff	2016-07-12 19:34:31 UTC (rev 866)
+++ trunk/caff/caff	2016-07-12 19:34:34 UTC (rev 867)
@@ -1318,7 +1318,7 @@
             }
             debug( "Imported $fpr for ".join(',', @matching_keyids));
             info( "Key " .join(',', @matching_keyids).' '. ($r == 0 ? 'not changed' : 'imported'), ($r == 0 ? undef : 1) ) if $verbose;
-            push @{$status{$_}}, $fpr foreach @matching_keyids;
+            push @{$status{$_} //= []}, $fpr foreach @matching_keyids;
         }
         elsif (/^\[GNUPG:\] IMPORT_OK \d+ ([0-9A-F]{32})$/) {
             mywarn("Imported v3 key $1.  Version 3 keys are obsolete, should not be used, and are not and will not be properly supported.");
@@ -1397,7 +1397,7 @@
 }
 sub merge_import_status($$) {
     foreach my $keyid (keys %{$_[1]}) {
-        push @{$_[0]->{$keyid}}, @{$_[1]->{$keyid}};
+        push @{$_[0]->{$keyid} //= []}, @{$_[1]->{$keyid}};
     }
 }
 




More information about the Pgp-tools-commit mailing list