diff --git a/src/server/text.c b/src/server/text.c index 484418d2d39cb211eabb6ebd86dc01bfd13a267a..4a0a8bfbe1d23138e40612edf9f5601854acfede 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)