From befaf5ef9d5bd26acda6ebfac3f3063d8b957999 Mon Sep 17 00:00:00 2001 From: Per Cederqvist <ceder@lysator.liu.se> Date: Sun, 9 Aug 1998 19:06:50 +0000 Subject: [PATCH] (get_map): Set result.first_local_no correctly if the map in the conference is completely empty. --- src/server/text.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/server/text.c b/src/server/text.c index 484418d2d..4a0a8bfbe 100644 --- a/src/server/text.c +++ b/src/server/text.c @@ -1,5 +1,5 @@ /* - * $Id: text.c,v 0.54 1998/08/09 07:18:13 ceder Exp $ + * $Id: text.c,v 0.55 1998/08/09 19:06:50 ceder Exp $ * Copyright (C) 1991, 1992, 1993, 1994, 1995, 1996 Lysator Academic Computer Association. * * This file is part of the LysKOM server. @@ -29,7 +29,7 @@ */ static const char * -rcsid = "$Id: text.c,v 0.54 1998/08/09 07:18:13 ceder Exp $"; +rcsid = "$Id: text.c,v 0.55 1998/08/09 19:06:50 ceder Exp $"; #include "rcs.h" USE(rcsid); @@ -3023,11 +3023,16 @@ get_map(Conf_no conf_no, return FAILURE; } + /* Get the lowest existing text, or, if no text exists, the next + text number that will be used. */ res_first = l2g_next_key(&conf_c->texts, 0); - /* Bug compatibility: accept first_local_no==0 because lyskomd - 1.9.0 did so. */ - res_first = max(res_first, 1); + if (res_first == 0) + res_first = l2g_first_appendable_key(&conf_c->texts); + + /* Start where the user wants to start, unless that is too small. */ res_first = max(res_first, first_local_no); + + /* Find the endpoint. */ first_unwanted = min(highest+1, first_local_no + no_of_texts); if (first_unwanted >= res_first) -- GitLab