]> git.pond.sub.org Git - empserver/commitdiff
Permit omitting rows at the end of tables nat and game
authorMarkus Armbruster <armbru@pond.sub.org>
Tue, 14 Jun 2011 07:09:19 +0000 (09:09 +0200)
committerMarkus Armbruster <armbru@pond.sub.org>
Sat, 25 Jun 2011 14:51:56 +0000 (16:51 +0200)
When not enough rows are supplied for a table with fixed size, treat
the rows missing at the end just like rows omitted elsewhere: make
them blank if the omission is permitted (tables nat and game), else
fail (tables sect and realm; no change).

src/lib/common/xundump.c

index e361c8bc4691771dbaf87034a5de2d5d037f3562..387c721c0517598a9f3885d2163769d13abf0be9 100644 (file)
@@ -268,8 +268,10 @@ tbl_part_done(void)
                if (!ef_truncate(cur_type, cur_id + 1))
                    return -1;
            } else {
-               return gripe("Expected %d more rows",
-                            ep->fids - (cur_id + 1));
+               if (!may_omit_id)
+                   return gripe("Expected %d more rows",
+                                ep->fids - (cur_id + 1));
+               omit_ids(cur_id + 1, ep->fids);
            }
        } else {
            exp_id = expected_id(cur_id + 1, ep->fids);