]> err.no Git - pwstore/commitdiff
Allow comments at start of file, before access line
authorTollef Fog Heen <tfheen@err.no>
Mon, 4 Jun 2012 20:38:15 +0000 (22:38 +0200)
committerTollef Fog Heen <tfheen@err.no>
Mon, 4 Jun 2012 20:38:15 +0000 (22:38 +0200)
pws

diff --git a/pws b/pws
index 827a67858feca01048e4842026ff16bb070898e2..3790b4f0982f425caddbeb6841557e3cc13dbf0a 100755 (executable)
--- a/pws
+++ b/pws
@@ -410,10 +410,14 @@ class EncryptedFile
   end
 
   def EncryptedFile.targets(text)
-    metaline = text.split("\n").first
-    m = /^access: (.*)/.match metaline
-    return [] unless m
-    return m[1].strip.split(/[\t ,]+/)
+    text.split("\n").each do |line|
+      if /^#/.match line
+        next
+      end
+      m = /^access: (.*)/.match line
+      return [] unless m
+      return m[1].strip.split(/[\t ,]+/)
+    end
   end