elua: properly copy flags around
authorDaniel Kolesa <d.kolesa@samsung.com>
Tue, 3 Jun 2014 14:55:34 +0000 (15:55 +0100)
committerDaniel Kolesa <d.kolesa@samsung.com>
Tue, 10 Jun 2014 14:48:52 +0000 (15:48 +0100)
src/bin/elua/modules/xgettext/generator.lua

index c442e6d..b68caf0 100644 (file)
@@ -39,9 +39,11 @@ local cmp_msgs = function(msg1, msg2)
 end
 
 local new_msg = function(msg)
+    local copyflags = {}
+    for i, v in ipairs(msg.flags) do copyflags[#copyflags + 1] = v end
     return {
         msg[1], msg[2], msg.context, comments = { msg.comment },
-        xcomment = msg.xcomment, lines = { msg.line }
+        xcomment = msg.xcomment, lines = { msg.line }, flags = copyflags
     }
 end
 
@@ -55,6 +57,9 @@ local gen_grouped_messages = function(ps)
             if cmp_msgs(msg, amsg) then
                 amsg.lines   [#amsg.lines    + 1] = msg.line
                 amsg.comments[#amsg.comments + 1] = msg.comment
+                for i, v in ipairs(msg.flags) do
+                    amsg.flags[#amsg.flags + 1] = v
+                end
                 found = true
                 break
             end