]> git.e2factory.org Git - e2factory.git/commitdiff
e2lib: vrfy_dict_exp_keys() erroneously reported only the last error
authorTobias Ulmer <tu@emlix.com>
Thu, 1 Dec 2016 17:50:17 +0000 (18:50 +0100)
committerTobias Ulmer <tu@emlix.com>
Thu, 1 Dec 2016 17:50:17 +0000 (18:50 +0100)
Signed-off-by: Tobias Ulmer <tu@emlix.com>
generic/e2lib.lua

index dc8aeaa87fc958bbb88cc80c62e234da19710215..8444553392e0c55799135d96f1f81c29a9121d03 100644 (file)
@@ -2484,15 +2484,13 @@ function e2lib.vrfy_dict_exp_keys(t, name, ekeyvec)
         lookup[v] = true
     end
 
-    local msg, e = nil
+    local e = nil
     for k,_ in pairs(t) do
         if not lookup[k] then
-            if not e then
-                e = err.new("unexpected key %q in %s",
-                    tostring(k), name)
+            if e then
+                e:append("unexpected key %q in %s", tostring(k), name)
             else
-                e = err.new("unexpected key %q in %s",
-                    tostring(k), name)
+                e = err.new("unexpected key %q in %s", tostring(k), name)
             end
         end
     end