Commit 4b621942 authored by Per Cederqvist's avatar Per Cederqvist
Browse files

(prot_a_output_text_mapping): Emit range-begin and range-end.

parent adefe3bc
/*
* $Id: prot-a-output.c,v 0.40 1999/02/05 21:47:03 ceder Exp $
* $Id: prot-a-output.c,v 0.41 1999/04/05 00:43:32 ceder Exp $
* Copyright (C) 1991, 1992, 1993, 1994, 1995, 1996 Lysator Academic Computer Association.
*
* This file is part of the LysKOM server.
......@@ -35,7 +35,7 @@
#endif
static const char *
rcsid = "$Id: prot-a-output.c,v 0.40 1999/02/05 21:47:03 ceder Exp $";
rcsid = "$Id: prot-a-output.c,v 0.41 1999/04/05 00:43:32 ceder Exp $";
#include "rcs.h"
USE(rcsid);
......@@ -958,7 +958,7 @@ prot_a_output_text_mapping(Connection *fp,
use a dense or sparse representation. */
for (l2gi_searchsome(&iter, map->l2g, map->first, 0),
highest = (lowest = iter.lno) - 1;
highest = (lowest = iter.search_ended?map->first:iter.lno) - 1;
!iter.search_ended && nonzeroes < map->no_of_texts;
l2gi_next(&iter))
{
......@@ -969,6 +969,13 @@ prot_a_output_text_mapping(Connection *fp,
limit = highest + 1;
mux_printf(fp, " %lu", (unsigned long)map->first);
if (iter.search_ended)
mux_printf(fp, " %lu",
(unsigned long)l2g_first_appendable_key(map->l2g));
else
mux_printf(fp, " %lu", (unsigned long)limit);
/* Emit the "later-texts-exists" flag. */
mux_printf(fp, " %c", iter.search_ended ? '0' : '1');
......@@ -978,7 +985,7 @@ prot_a_output_text_mapping(Connection *fp,
if (nonzeroes == 0)
{
/* Special case: an emtpy array. Use the sparse format so
/* Special case: an empty array. Use the sparse format so
that we don't have to philosophize about what the lower
limit in the text-list should be. */
mux_printf(fp, " 0 0 *");
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment