]> mj.ucw.cz Git - libucw.git/blobdiff - lib/sorter/govern.c
Empty final bucket should be turned into a file as well.
[libucw.git] / lib / sorter / govern.c
index d90dda2a8777a33286179664c2b8268559e0b49a..3606163c557cb827542a9c378a11d0e680498d45 100644 (file)
@@ -180,7 +180,7 @@ sorter_join(struct sort_bucket *b)
 
   if (!sbuck_has_file(join))
     {
-      // The final bucket doesn't have any fb associated yet, so replace
+      // The final bucket doesn't have any file associated yet, so replace
       // it with the new bucket.
       SORT_XTRACE("Replaced final bucket");
       b->flags |= SBF_FINAL;
@@ -300,6 +300,7 @@ sorter_run(struct sort_context *ctx)
     }
 
   sorter_free_buf(ctx);
+  sbuck_write(bout);           // Force empty bucket to a file
   SORT_XTRACE("Final size: %jd", (uintmax_t) sbuck_size(bout));
   ctx->out_fb = sbuck_read(bout);
 }