* Exim - an Internet mail transport agent *
*************************************************/
-/* Copyright (c) University of Cambridge 1995 - 2015 */
+/* Copyright (c) University of Cambridge 1995 - 2018 */
/* See the file NOTICE for conditions of use and distribution. */
#include "../exim.h"
Ufgets(buffer, sizeof(buffer), f) != NULL;
last_was_eol = this_is_eol)
{
- int ptr, size;
int p = Ustrlen(buffer);
int linekeylength;
BOOL this_is_comment;
- uschar *yield;
+ gstring * yield;
uschar *s = buffer;
/* Check whether this the final segment of a line. If it follows an
/* Reset dynamic store, if we need to, and revert to the search pool */
- if (reset_point != NULL)
+ if (reset_point)
{
store_reset(reset_point);
store_pool = old_pool;
Initialize, and copy the first segment of data. */
this_is_comment = FALSE;
- size = 100;
- ptr = 0;
- yield = store_get(size);
+ yield = string_get(100);
if (*s != 0)
- yield = string_cat(yield, &size, &ptr, s, Ustrlen(s));
+ yield = string_cat(yield, s);
/* Now handle continuations */
/* Join a physical or logical line continuation onto the result string. */
- yield = string_cat(yield, &size, &ptr, s, Ustrlen(s));
+ yield = string_cat(yield, s);
}
- yield[ptr] = 0;
- store_reset(yield + ptr + 1);
- *result = yield;
+ store_reset(yield->s + yield->ptr + 1);
+ *result = string_from_gstring(yield);
return OK;
}
/* Reset dynamic store, if we need to */
-if (reset_point != NULL)
+if (reset_point)
{
store_reset(reset_point);
store_pool = old_pool;