git://git.exim.org
/
users
/
jgh
/
exim.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
String handling: refactor the expanding-string routines and users to use a descriptor...
[users/jgh/exim.git]
/
src
/
src
/
lookups
/
lsearch.c
diff --git
a/src/src/lookups/lsearch.c
b/src/src/lookups/lsearch.c
index 6101d00ac521a54c2d7da1f9d07a3c32b0fdcbd7..745856d02e9ad50854a99a983556fb256c1de5fe 100644
(file)
--- a/
src/src/lookups/lsearch.c
+++ b/
src/src/lookups/lsearch.c
@@
-101,11
+101,10
@@
for (last_was_eol = TRUE;
Ufgets(buffer, sizeof(buffer), f) != NULL;
last_was_eol = this_is_eol)
{
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;
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
uschar *s = buffer;
/* Check whether this the final segment of a line. If it follows an
@@
-240,7
+239,7
@@
for (last_was_eol = TRUE;
/* Reset dynamic store, if we need to, and revert to the search pool */
/* 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;
{
store_reset(reset_point);
store_pool = old_pool;
@@
-254,11
+253,9
@@
for (last_was_eol = TRUE;
Initialize, and copy the first segment of data. */
this_is_comment = FALSE;
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)
if (*s != 0)
- yield = string_cat(yield,
&size, &ptr,
s);
+ yield = string_cat(yield, s);
/* Now handle continuations */
/* Now handle continuations */
@@
-294,18
+291,17
@@
for (last_was_eol = TRUE;
/* Join a physical or logical line continuation onto the result string. */
/* Join a physical or logical line continuation onto the result string. */
- yield = string_cat(yield,
&size, &ptr,
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 */
return OK;
}
/* Reset dynamic store, if we need to */
-if (reset_point
!= NULL
)
+if (reset_point)
{
store_reset(reset_point);
store_pool = old_pool;
{
store_reset(reset_point);
store_pool = old_pool;